MDL-40260 Course overview: code tidy for previous commit
authorDamyon Wiese <damyon@moodle.com>
Mon, 22 Jul 2013 08:12:26 +0000 (16:12 +0800)
committerDamyon Wiese <damyon@moodle.com>
Mon, 22 Jul 2013 08:12:26 +0000 (16:12 +0800)
Moving this check inside the following if makes it clear which code
branch it applies to.

blocks/course_overview/renderer.php

index 85b5fa8..6f33899 100644 (file)
@@ -103,10 +103,10 @@ class block_course_overview_renderer extends plugin_renderer_base {
 
             // No need to pass title through s() here as it will be done automatically by html_writer.
             $attributes = array('title' => $course->fullname);
-            if (empty($course->visible) && ($course->id > 0)) {
-                $attributes['class'] = 'dimmed';
-            }
             if ($course->id > 0) {
+                if (empty($course->visible)) {
+                    $attributes['class'] = 'dimmed';
+                }
                 $courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
                 $coursefullname = format_string($course->fullname, true, $course->id);
                 $link = html_writer::link($courseurl, $coursefullname, $attributes);