'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.
This commit is contained in:
moodler
2003-08-26 13:47:46 +00:00
parent 5b47275684
commit 7f12f9cdd9
2 changed files with 14 additions and 6 deletions
+5 -1
View File
@@ -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;
}
}
+9 -5
View File
@@ -50,25 +50,29 @@
$tt = "$resource->section";
}
} else {
$tt = "<FONT SIZE=1>".userdate($resource->timemodified);
$tt = "<font size=1>".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, "<A class=\"dimmed\" HREF=\"view.php?id=$resource->coursemodule\">$resource->name</A>",
$table->data[] = array ($tt, "<a class=\"dimmed\" $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
text_to_html($resource->summary) );
} else {
//Show normal if the mod is visible
$table->data[] = array ($tt, "<A HREF=\"view.php?id=$resource->coursemodule\">$resource->name</A>",
$table->data[] = array ($tt, "<a $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
text_to_html($resource->summary) );
}
}
echo "<BR>";
echo "<br />";
print_table($table);
print_footer($course);
?>