Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

'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.
  • Loading branch information...
commit 7f12f9cdd93aaba36bcd1a950676c1e34501700d 1 parent 5b47275
moodler authored
Showing with 14 additions and 6 deletions.
  1. +5 −1 lib/datalib.php
  2. +9 −5 mod/resource/index.php
6 lib/datalib.php
View
@@ -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;
}
}
14 mod/resource/index.php
View
@@ -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);
-
?>
Please sign in to comment.
Something went wrong with that request. Please try again.