summaryrefslogtreecommitdiff
path: root/lib/accountsettingsaction.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/accountsettingsaction.php')
-rw-r--r--lib/accountsettingsaction.php35
1 files changed, 20 insertions, 15 deletions
diff --git a/lib/accountsettingsaction.php b/lib/accountsettingsaction.php
index a004a3ed9..9865e1748 100644
--- a/lib/accountsettingsaction.php
+++ b/lib/accountsettingsaction.php
@@ -102,26 +102,31 @@ class AccountSettingsNav extends Widget
$this->action->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
+ $user = common_current_user();
- $menu =
- array('profilesettings' =>
+ $menu = array();
+ $menu['profilesettings'] =
array(_('Profile'),
- _('Change your profile settings')),
- 'avatarsettings' =>
- array(_('Avatar'),
- _('Upload an avatar')),
- 'passwordsettings' =>
- array(_('Password'),
- _('Change your password')),
- 'emailsettings' =>
+ _('Change your profile settings'));
+ if(Event::handle('CanUserChangeField', array($user->nickname, 'avatar'))){
+ $menu['avatarsettings'] =
+ array(_('Avatar'),
+ _('Upload an avatar'));
+ }
+ if(Event::handle('CanUserChangeField', array($user->nickname, 'password'))){
+ $menu['passwordsettings'] =
+ array(_('Password'),
+ _('Change your password'));
+ }
+ $menu['emailsettings'] =
array(_('Email'),
- _('Change email handling')),
- 'userdesignsettings' =>
+ _('Change email handling'));
+ $menu['userdesignsettings'] =
array(_('Design'),
- _('Design your profile')),
- 'othersettings' =>
+ _('Design your profile'));
+ $menu['othersettings'] =
array(_('Other'),
- _('Other options')));
+ _('Other options'));
foreach ($menu as $menuaction => $menudesc) {
$this->action->menuItem(common_local_url($menuaction),