require_login($course);
- $sitecontext = get_context_instance(CONTEXT_SYSTEM);
+ $systemcontext = get_context_instance(CONTEXT_SYSTEM);
$frontpagectx = get_context_instance(CONTEXT_COURSE, SITEID);
if ($context->id != $frontpagectx->id) {
require_capability('moodle/course:viewparticipants', $context);
} else {
- require_capability('moodle/site:viewparticipants', $sitecontext);
+ require_capability('moodle/site:viewparticipants', $systemcontext);
// override the default on frontpage
$roleid = optional_param('roleid', -1, PARAM_INT);
}
// Otherwise they appear in every participant list
$canviewroles = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context);
- $doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext);
+ $doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $systemcontext);
if ($context->id == $frontpagectx->id) {
//we want admins listed on frontpage too
}
$currenttab = 'participants';
$user = $USER;
+ $userindexpage = true;
require_once($CFG->dirroot .'/user/tabs.php');
foreach ($mycourses as $mycourse) {
$courselist[$mycourse->id] = format_string($mycourse->shortname);
}
- if (has_capability('moodle/site:viewparticipants', $sitecontext)) {
+ if (has_capability('moodle/site:viewparticipants', $systemcontext)) {
unset($courselist[SITEID]);
$courselist = array(SITEID => format_string($SITE->shortname)) + $courselist;
}
if ($usercontexts = get_parent_contexts($context)) {
$listofcontexts = '('.implode(',', $usercontexts).')';
} else {
- $listofcontexts = '('.$sitecontext->id.')'; // must be site
+ $listofcontexts = '('.$systemcontext->id.')'; // must be site
}
if ($roleid > 0) {
$selectrole = " AND r.roleid = :roleid ";
}
}
- if ($user->id == $USER->id) {
+ if (empty($userindexpage) && $user->id == $USER->id) {
+
+ /// Portfolio tab
require_once($CFG->libdir . '/portfoliolib.php');
if (portfolio_instances(true, false)) {
// @todo permissions check?
$toprow[] = new tabobject('portfolios', $CFG->wwwroot .'/user/portfolio.php', get_string('portfolios', 'portfolio'));
}
- }
-///added a new messaging tab
- if (has_capability('moodle/user:editownmessageprofile', $systemcontext)) {
- $toprow[] = new tabobject('editmessage', $wwwroot.'/message/edit.php?id='.$user->id.'&course='.$course->id, get_string('editmymessage', 'message'));
+ /// Messaging tab
+ if (has_capability('moodle/user:editownmessageprofile', $systemcontext)) {
+ $toprow[] = new tabobject('editmessage', $CFG->wwwroot.'/message/edit.php?id='.$user->id.'&course='.$course->id, get_string('editmymessage', 'message'));
+ }
}
+
/// Add second row to display if there is one
if (!empty($secondrow)) {