diff --git a/Changes.md b/Changes.md index 3eb74ea..7155a48 100644 --- a/Changes.md +++ b/Changes.md @@ -11,6 +11,7 @@ Version 4.2.0.2 the 'restrictedmoduleicon' icon. 4. Set the 'restrictedmoduleicon' to have a font size of 50px. 5. Set '.format-vsf .activity .vsf-icon img.modpic', '.original' and '.custom' to an opacity of 0.5 when restricted. +6. Show folder modules on the page when inline. Version 4.2.0.1 ----------------------------- diff --git a/classes/course_renderer.php b/classes/course_renderer.php index dd43cf6..08dac37 100644 --- a/classes/course_renderer.php +++ b/classes/course_renderer.php @@ -73,6 +73,8 @@ protected function course_section_cm_classes_vsf(cm_info $mod) { * @return string. */ public function course_section_cm_text_vsf($course, cm_info $mod, $vsfavailability = false, $displayoptions = []) { + global $DB; + if (!$mod->is_visible_on_course_page()) { // Nothing to be displayed to the user. return ''; @@ -173,6 +175,17 @@ public function course_section_cm_text_vsf($course, cm_info $mod, $vsfavailabili ['class' => 'vsf-mod-description pt-2'] ); } + if ($mod->modname == 'folder') { + $folder = $DB->get_record('folder', array('id' => $mod->instance), 'display', MUST_EXIST); + if ($folder->display == FOLDER_DISPLAY_INLINE) { + $modcontent = $mod->get_formatted_content(['overflowdiv' => true, 'noclean' => true]); + $output .= html_writer::tag( + 'div', + $modcontent, + ['class' => 'vsf-mod-content pt-2'] + ); + } + } if (!empty($endcontent)) { if (empty($output)) {