MDL-45895 user: Preferences page presence in the navigation

Part of MDL-45774
This commit is contained in:
Frederic Massart
2015-04-10 17:17:06 +08:00
committed by Adrian Greeve
parent 36ffc1511c
commit 9461ea0679
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -1907,7 +1907,7 @@ $string['usemessageform'] = 'or use the form below to send a message to the sele
$string['user'] = 'User';
$string['useraccount'] = 'User account';
$string['userconfirmed'] = 'Confirmed {$a}';
$string['usercurrentsettings'] = 'My profile settings';
$string['usercurrentsettings'] = 'Preferences';
$string['useractivity'] = 'Activity';
$string['userdata'] = 'User data';
$string['userdeleted'] = 'This user account has been deleted';
@@ -1934,7 +1934,7 @@ $string['usersnew'] = 'New users';
$string['usersnoaccesssince'] = 'Inactive for more than';
$string['userswithfiles'] = 'Users with files';
$string['useruploadtype'] = 'User upload type: {$a}';
$string['userviewingsettings'] = 'Profile settings for {$a}';
$string['userviewingsettings'] = '{$a}\'s preferences';
$string['userzones'] = 'User zones';
$string['usetheme'] = 'Use theme';
$string['usingexistingcourse'] = 'Using existing course';
+3 -1
View File
@@ -4187,12 +4187,14 @@ class settings_navigation extends navigation_node {
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $this->page->context));
$key = $gstitle;
$prefurl = new moodle_url('/user/preferences.php');
if ($gstitle != 'usercurrentsettings') {
$key .= $userid;
$prefurl->param('userid', $userid);
}
// Add a user setting branch
$usersetting = $this->add(get_string($gstitle, 'moodle', $fullname), null, self::TYPE_CONTAINER, null, $key);
$usersetting = $this->add(get_string($gstitle, 'moodle', $fullname), $prefurl, self::TYPE_CONTAINER, null, $key);
$usersetting->id = 'usersettings';
if ($this->page->context->contextlevel == CONTEXT_USER && $this->page->context->instanceid == $user->id) {
// Automatically start by making it active