Permalink
Browse files

print_section now uses cached course modinfo to lessen load in database

  • Loading branch information...
moodler
moodler committed Nov 10, 2002
1 parent dfc9ba9 commit c408b0c49b37e8b805b4f4b217b96ac727c65c32
Showing with 2 additions and 1 deletion.
  1. +2 −1 course/lib.php
View
@@ -468,6 +468,7 @@ function get_all_categories() {
function print_section($course, $section, $mods, $modnamesused, $absolute=false, $width="100%") {
global $CFG;
+ $modinfo = unserialize($course->modinfo);
echo "<TABLE WIDTH=\"$width\"><TR><TD>\n";
if ($section->sequence) {
@@ -476,7 +477,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
foreach ($sectionmods as $modnumber) {
$mod = $mods[$modnumber];
- $instancename = get_field("$mod->modname", "name", "id", "$mod->instance");
+ $instancename = urldecode($modinfo[$modnumber]->name);
echo "<IMG SRC=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";
echo " <FONT SIZE=2><A TITLE=\"$mod->modfullname\"";
echo " HREF=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">$instancename</A></FONT>";

0 comments on commit c408b0c

Please sign in to comment.