MDL-38632 folder: observe show_expanded on course page

This commit is contained in:
Eloy Lafuente (stronk7) 2013-03-21 17:04:50 +01:00
parent 373a8e052c
commit d86db37c44

View file

@ -426,7 +426,7 @@ function folder_dndupload_handle($uploadinfo) {
function folder_get_coursemodule_info($cm) { function folder_get_coursemodule_info($cm) {
global $DB; global $DB;
if (!($folder = $DB->get_record('folder', array('id' => $cm->instance), if (!($folder = $DB->get_record('folder', array('id' => $cm->instance),
'id, name, display, intro, introformat'))) { 'id, name, display, show_expanded, intro, introformat'))) {
return NULL; return NULL;
} }
$cminfo = new cached_cm_info(); $cminfo = new cached_cm_info();
@ -434,6 +434,7 @@ function folder_get_coursemodule_info($cm) {
if ($folder->display == FOLDER_DISPLAY_INLINE) { if ($folder->display == FOLDER_DISPLAY_INLINE) {
// prepare folder object to store in customdata // prepare folder object to store in customdata
$fdata = new stdClass(); $fdata = new stdClass();
$fdata->show_expanded = $folder->show_expanded;
if ($cm->showdescription && strlen(trim($folder->intro))) { if ($cm->showdescription && strlen(trim($folder->intro))) {
$fdata->intro = $folder->intro; $fdata->intro = $folder->intro;
if ($folder->introformat != FORMAT_MOODLE) { if ($folder->introformat != FORMAT_MOODLE) {