Merge branch 'mdl-46427-master' of git://github.com/deraadt/moodle
authorSam Hemelryk <sam@moodle.com>
Sun, 20 Jul 2014 23:12:05 +0000 (11:12 +1200)
committerSam Hemelryk <sam@moodle.com>
Sun, 20 Jul 2014 23:12:05 +0000 (11:12 +1200)
user/profile.php
user/view.php

index 291fc13..8b1bb5c 100644 (file)
@@ -375,19 +375,19 @@ if (!isset($hiddenfields['mycourses'])) {
             if ($mycourse->category) {
                 context_helper::preload_from_record($mycourse);
                 $ccontext = context_course::instance($mycourse->id);
-                $class = '';
+                $linkattributes = null;
                 if ($mycourse->visible == 0) {
                     if (!has_capability('moodle/course:viewhiddencourses', $ccontext)) {
                         continue;
                     }
-                    $class = 'class="dimmed"';
+                    $linkattributes['class'] = 'dimmed';
                 }
                 $params = array('id' => $user->id, 'course' => $mycourse->id);
                 if ($showallcourses) {
                     $params['showallcourses'] = 1;
                 }
                 $url = new moodle_url('/user/view.php', $params);
-                $courselisting .= html_writer::link($url, $ccontext->get_context_name(false), array('class' => $class));
+                $courselisting .= html_writer::link($url, $ccontext->get_context_name(false), $linkattributes);
                 $courselisting .= ', ';
             }
             $shown++;
index 06a8bac..4430991 100644 (file)
@@ -319,19 +319,19 @@ if (!isset($hiddenfields['mycourses'])) {
                 $ccontext = context_course::instance($mycourse->id);
                 $cfullname = $ccontext->get_context_name(false);
                 if ($mycourse->id != $course->id) {
-                    $class = '';
+                    $linkattributes = null;
                     if ($mycourse->visible == 0) {
                         if (!has_capability('moodle/course:viewhiddencourses', $ccontext)) {
                             continue;
                         }
-                        $class = 'class="dimmed"';
+                        $linkattributes['class'] = 'dimmed';
                     }
                     $params = array('id' => $user->id, 'course' => $mycourse->id);
                     if ($showallcourses) {
                         $params['showallcourses'] = 1;
                     }
                     $url = new moodle_url('/user/view.php', $params);
-                    $courselisting .= html_writer::link($url, $ccontext->get_context_name(false), array('class' => $class));
+                    $courselisting .= html_writer::link($url, $ccontext->get_context_name(false), $linkattributes);
                     $courselisting .= ', ';
                 } else {
                     $courselisting .= $cfullname . ", ";