Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'wip-mdl-29274-m21' of git://github.com/rajeshtaneja/moo…
…dle into MOODLE_21_STABLE
  • Loading branch information
stronk7 committed Feb 29, 2012
2 parents 0915af2 + d3bc407 commit b6ea277
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions blocks/participants/block_participants.php
Expand Up @@ -19,10 +19,13 @@ function get_content() {
$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;
Expand All @@ -33,6 +36,7 @@ function get_content() {
return $this->content;
}
}

$icon = '<img src="'.$OUTPUT->pix_url('i/users') . '" class="icon" alt="" />&nbsp;';
$this->content->items[] = '<a title="'.get_string('listofallpeople').'" href="'.
$CFG->wwwroot.'/user/index.php?contextid='.$currentcontext->id.'">'.$icon.get_string('participants').'</a>';
Expand All @@ -46,5 +50,3 @@ function applicable_formats() {
}

}


0 comments on commit b6ea277

Please sign in to comment.