From 7193ea2cd2ccdacaf2110ce821e37831fa43ea4d Mon Sep 17 00:00:00 2001 From: Dave Cooper Date: Tue, 28 Apr 2015 14:02:49 +0800 Subject: [PATCH] MDL-49845 profile: changed 'My preferences' display logic --- lang/en/deprecated.txt | 1 + lang/en/moodle.php | 3 ++- lib/myprofilelib.php | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lang/en/deprecated.txt b/lang/en/deprecated.txt index 558e5b736df..c0c321783fb 100644 --- a/lang/en/deprecated.txt +++ b/lang/en/deprecated.txt @@ -23,3 +23,4 @@ mypreferences,core_grades myprofile,core myprofilemyblogs,core_blog viewallmyentries,core_blog +userspreferences,core_moodle diff --git a/lang/en/moodle.php b/lang/en/moodle.php index ddca3401072..3344306a540 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -1934,7 +1934,6 @@ $string['usernameoremail'] = 'Enter either username or email address'; $string['usernotconfirmed'] = 'Could not confirm {$a}'; $string['userpic'] = 'User picture'; $string['users'] = 'Users'; -$string['userspreferences'] = 'User {$a}\'s preferences'; $string['userselectorautoselectunique'] = 'If only one user matches the search, select them automatically'; $string['userselectorpreserveselected'] = 'Keep selected users, even if they no longer match the search'; $string['userselectorsearchanywhere'] = 'Match the search text anywhere in the displayed fields'; @@ -2042,3 +2041,5 @@ $string['yourself'] = 'yourself'; $string['yourteacher'] = 'your {$a}'; $string['yourwordforx'] = 'Your word for \'{$a}\''; $string['zippingbackup'] = 'Zipping backup'; +// Deprecated since Moodle 2.9 +$string['userspreferences'] = 'User {$a}\'s preferences'; diff --git a/lib/myprofilelib.php b/lib/myprofilelib.php index bc80dc159ac..5f4a39594fd 100644 --- a/lib/myprofilelib.php +++ b/lib/myprofilelib.php @@ -100,9 +100,9 @@ function core_myprofile_navigation(core_user\output\myprofile\tree $tree, $user, } // Preference page. Only visible by administrators. - if (is_siteadmin()) { + if (!$iscurrentuser && is_siteadmin()) { $url = new moodle_url('/user/preferences.php', array('userid' => $user->id)); - $title = $iscurrentuser ? get_string('preferences') : get_string('userspreferences', 'moodle', fullname($user)); + $title = get_string('preferences', 'moodle'); $node = new core_user\output\myprofile\node('administration', 'preferences', $title, null, $url); $tree->add_node($node); }