MDL-45895 user: Preferences page presence in the navigation
Part of MDL-45774
This commit is contained in:
committed by
Adrian Greeve
parent
36ffc1511c
commit
9461ea0679
+2
-2
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user