]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed a notice on PHP 5
authormoodler <moodler>
Sun, 8 Aug 2004 05:28:26 +0000 (05:28 +0000)
committermoodler <moodler>
Sun, 8 Aug 2004 05:28:26 +0000 (05:28 +0000)
blocks/section_links/block_section_links.php

index cdbad6c7884a4a6caf740ad2cb7c7361e2954a86..a3d8b7b54fe0a5ca5b059e812d0ac103c407ba9f 100644 (file)
@@ -3,13 +3,15 @@
 class CourseBlock_section_links extends MoodleBlock {
 
     function CourseBlock_section_links ($course) {
-        if ($course->format == 'topics') {
-            $this->title = get_string('topics', 'block_section_links');
-        }
-        else if ($course->format == 'weeks') {
-            $this->title = get_string('weeks', 'block_section_links');
-        }
-        else {
+        if (isset($course->format)) {
+            if ($course->format == 'topics') {
+                $this->title = get_string('topics', 'block_section_links');
+            } else if ($course->format == 'weeks') {
+                $this->title = get_string('weeks', 'block_section_links');
+            } else {
+                $this->title = get_string('blockname', 'block_section_links');
+            }
+        } else {
             $this->title = get_string('blockname', 'block_section_links');
         }
         $this->content_type = BLOCK_TYPE_TEXT;