Skip to content

Commit

Permalink
Merge branch 'mdl-46427-m27' of git://github.com/deraadt/moodle into …
Browse files Browse the repository at this point in the history
…MOODLE_27_STABLE
  • Loading branch information
Sam Hemelryk committed Jul 20, 2014
2 parents 1d0f235 + d35f49b commit 28d6752
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions user/profile.php
Expand Up @@ -375,19 +375,19 @@
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++;
Expand Down
6 changes: 3 additions & 3 deletions user/view.php
Expand Up @@ -319,19 +319,19 @@
$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 . ", ";
Expand Down

0 comments on commit 28d6752

Please sign in to comment.