Skip to content

Commit

Permalink
MDL-45895 user: Preferences page presence in the navigation
Browse files Browse the repository at this point in the history
Part of MDL-45774
  • Loading branch information
Frederic Massart authored and abgreeve committed Apr 10, 2015
1 parent 36ffc15 commit 9461ea0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lang/en/moodle.php
Expand Up @@ -1907,7 +1907,7 @@
$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';
Expand All @@ -1934,7 +1934,7 @@
$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';
Expand Down
4 changes: 3 additions & 1 deletion lib/navigationlib.php
Expand Up @@ -4187,12 +4187,14 @@ protected function generate_user_settings($courseid, $userid, $gstitle='usercurr
$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
Expand Down

0 comments on commit 9461ea0

Please sign in to comment.