From 7f12f9cdd93aaba36bcd1a950676c1e34501700d Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 26 Aug 2003 13:47:46 +0000 Subject: [PATCH] 'Extras' in cached course modinfo activities is now returned. This means that Resources can now employ them on the index listing. Specifically, Resources that are popup now popup from there too. --- lib/datalib.php | 6 +++++- mod/resource/index.php | 14 +++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 9b46954d98..a1ae05a36a 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1480,7 +1480,11 @@ function get_all_instances_in_course($modulename, $course) { foreach ($modinfo as $mod) { if ($mod->mod == $modulename and $mod->visible > $invisible) { - $outputarray[] = $rawmods[$mod->cm]; + $instance = $rawmods[$mod->cm]; + if (!empty($mod->extra)) { + $instance->extra = $mod->extra; + } + $outputarray[] = $instance; } } diff --git a/mod/resource/index.php b/mod/resource/index.php index e855f46536..2780b62890 100644 --- a/mod/resource/index.php +++ b/mod/resource/index.php @@ -50,25 +50,29 @@ $tt = "$resource->section"; } } else { - $tt = "".userdate($resource->timemodified); + $tt = "".userdate($resource->timemodified); + } + if (!empty($resource->extra)) { + $extra = urldecode($resource->extra); + } else { + $extra = ""; } if (!$resource->visible) { //Show dimmed if the mod is hidden - $table->data[] = array ($tt, "coursemodule\">$resource->name", + $table->data[] = array ($tt, "coursemodule\">$resource->name", text_to_html($resource->summary) ); } else { //Show normal if the mod is visible - $table->data[] = array ($tt, "coursemodule\">$resource->name", + $table->data[] = array ($tt, "coursemodule\">$resource->name", text_to_html($resource->summary) ); } } - echo "
"; + echo "
"; print_table($table); print_footer($course); - ?> -- 2.39.5