diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-11-09 17:43:37 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-11-09 17:43:37 -0500 |
commit | 3be120571446880cb71a57845204b3213e6df67e (patch) | |
tree | 1699a4cb46af0e7b8a1edcd009f9554893668e85 /lib | |
parent | 22310d17a4886d5382832caee43da0bcf7914419 (diff) |
Add a new event: CanUserChangeField
Diffstat (limited to 'lib')
-rw-r--r-- | lib/accountsettingsaction.php | 35 |
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), |