Skip to content

Commit

Permalink
Show folder modules on the page when inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Jun 8, 2024
1 parent 8122f10 commit 3bc622e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------------
Expand Down
13 changes: 13 additions & 0 deletions classes/course_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 3bc622e

Please sign in to comment.