]> git.mjollnir.org Git - moodle.git/commitdiff
A little more robustness
authormoodler <moodler>
Mon, 13 Jan 2003 14:11:05 +0000 (14:11 +0000)
committermoodler <moodler>
Mon, 13 Jan 2003 14:11:05 +0000 (14:11 +0000)
course/lib.php

index 8452c91d4db918abd960ad719a40a502d13eee23..403aacac54a9d2b2f63d9e2a778d12c79c86b34f 100644 (file)
@@ -2,6 +2,10 @@
    // Library of useful functions
 
 
+if (isset($COURSE_MAX_LOG_DISPLAY)) {  // Being included again - should never happen!!
+    return;
+}
+
 $COURSE_MAX_LOG_DISPLAY = 150;       // days
 
 $COURSE_MAX_LOGS_PER_PAGE = 1000;    // records
@@ -11,6 +15,7 @@ $COURSE_TEACHER_COLOR = "#990000";   // To hilight certain items that are teache
 $COURSE_LIVELOG_REFRESH = 60;        // Seconds
 
 
+
 function print_log_selector_form($course, $selecteduser=0, $selecteddate="today") {
 
     global $USER, $CFG;
@@ -514,6 +519,9 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
         $sectionmods = explode(",", $section->sequence);
 
         foreach ($sectionmods as $modnumber) {
+            if (empty($mods[$modnumber])) {
+                continue;
+            }
             $mod = $mods[$modnumber];
             $instancename = urldecode($modinfo[$modnumber]->name);
             echo "<IMG SRC=\"$CFG->wwwroot/mod/$mod->modname/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"$mod->modfullname\">";