mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Merge branch 'wip-mdl-29274' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
d5d9d96ab4
@ -19,10 +19,13 @@ class block_participants extends block_list {
|
||||
$this->content->icons = array();
|
||||
$this->content->footer = '';
|
||||
|
||||
/// MDL-13252 Always get the course context or else the context may be incorrect in the user/index.php
|
||||
$currentcontext = $this->page->context;
|
||||
// user/index.php expect course context, so get one if page has module context.
|
||||
$currentcontext = $this->page->context->get_course_context(false);
|
||||
|
||||
if ($this->page->course->id == SITEID) {
|
||||
if (empty($currentcontext)) {
|
||||
$this->content = '';
|
||||
return $this->content;
|
||||
} else if ($this->page->course->id == SITEID) {
|
||||
if (!has_capability('moodle/site:viewparticipants', get_context_instance(CONTEXT_SYSTEM))) {
|
||||
$this->content = '';
|
||||
return $this->content;
|
||||
@ -33,6 +36,7 @@ class block_participants extends block_list {
|
||||
return $this->content;
|
||||
}
|
||||
}
|
||||
|
||||
$icon = '<img src="'.$OUTPUT->pix_url('i/users') . '" class="icon" alt="" /> ';
|
||||
$this->content->items[] = '<a title="'.get_string('listofallpeople').'" href="'.
|
||||
$CFG->wwwroot.'/user/index.php?contextid='.$currentcontext->id.'">'.$icon.get_string('participants').'</a>';
|
||||
@ -46,5 +50,3 @@ class block_participants extends block_list {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user