$string['usernamenotfound'] = 'The username was not found in the database';
$string['usernotconfirmed'] = 'Could not confirm $a';
$string['userpic'] = 'User picture';
-$string['userprofilefor'] = 'User profile for $a';
$string['users'] = 'Users';
$string['userselectorpreserveselected'] = 'Keep selected users, even if they no longer match the search';
$string['userselectorautoselectunique'] = 'If only one user matches the search, select them automatically';
$string['version'] = 'Version';
$string['view'] = 'View';
$string['viewfileinpopup'] = 'View file in a popup window';
-$string['viewmyprofile'] = 'View my profile';
+$string['viewprofile'] = 'View profile';
$string['views'] = 'Views';
$string['viewsolution'] = 'view solution';
$string['virusfound'] = 'Attention administrator! Clam AV has found a virus in a file uploaded by $a->user for the course $a->course. Here is the output of clamscan:';
/** @var page object */
protected $page;
/** @var bool */
+ protected $ignoreactive = false;
+ /** @var bool */
protected $duringinstall = false;
/**
return false;
}
$this->page->navigation->initialise();
- return (count($this->page->navbar->children)>0 || $this->page->navigation->contains_active_node() || $this->page->settingsnav->contains_active_node());
+ return (count($this->page->navbar->children)>0 || (!$this->ignoreactive && (
+ $this->page->navigation->contains_active_node() ||
+ $this->page->settingsnav->contains_active_node())
+ ));
+ }
+
+ public function ignore_active($setting=true) {
+ $this->ignoreactive = ($setting);
}
/**
$customchildren = (count($this->children) > 0);
// Check if navigation contains the active node
- if ($this->page->navigation->contains_active_node()) {
+ if (!$this->ignoreactive && $this->page->navigation->contains_active_node()) {
// Parse the navigation tree to get the active node
$output .= $this->parse_branch_to_html($this->page->navigation->children, true, $customchildren);
- } else if ($this->page->settingsnav->contains_active_node()) {
+ } else if (!$this->ignoreactive && $this->page->settingsnav->contains_active_node()) {
// Parse the settings navigation to get the active node
$output .= $this->parse_branch_to_html($this->page->settingsnav->children, true, $customchildren);
} else {
// Add a link to view the user profile
if ($currentuser) {
- $usersetting->add(get_string('viewmyprofile'), $profileurl, self::TYPE_SETTING);
+ $usersetting->add(get_string('viewprofile'), $profileurl, self::TYPE_SETTING);
} else {
- $usersetting->add(get_string('userprofilefor','',$fullname), $profileurl, self::TYPE_SETTING);
+ $usersetting->add(get_string('viewprofile','',$fullname), $profileurl, self::TYPE_SETTING);
}
// Add the profile edit link
$personalcontext = get_context_instance(CONTEXT_USER, $user->id);
if ($user->id == $USER->id || has_capability('moodle/user:viewdetails', $coursecontext) || has_capability('moodle/user:viewdetails', $personalcontext) ) {
- $toprow[] = new tabobject('profile', $CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id, get_string('profile'));
+ $toprow[] = new tabobject('profile', $CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$course->id, get_string('viewprofile'));
}
if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
$link = new moodle_url($CFG->wwwroot."/user/index.php", array('id'=>$course->id));
}
+ $PAGE->navbar->ignore_active();
$PAGE->navbar->add($strparticipants, $link);
/// If the user being shown is not ourselves, then make sure we are allowed to see them!