From 9af50406930c54cb5be378f1801892665158e009 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 7 Jan 2011 18:56:18 -0500 Subject: [PATCH] combine account and connect menus --- plugins/NewMenu/NewMenuPlugin.php | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/plugins/NewMenu/NewMenuPlugin.php b/plugins/NewMenu/NewMenuPlugin.php index c5af61f632..19049f463e 100644 --- a/plugins/NewMenu/NewMenuPlugin.php +++ b/plugins/NewMenu/NewMenuPlugin.php @@ -284,6 +284,76 @@ class NewMenuPlugin extends Plugin return true; } + function onStartAccountSettingsNav(&$action) + { + $this->_settingsMenu($action); + return false; + } + + function onStartConnectSettingsNav(&$action) + { + $this->_settingsMenu($action); + return false; + } + + private function _settingsMenu(&$action) + { + $actionName = $action->trimmed('action'); + + $action->menuItem(common_local_url('profilesettings'), + _('Profile'), + _('Change your profile settings'), + $actionName == 'profilesettings'); + + $action->menuItem(common_local_url('avatarsettings'), + _('Avatar'), + _('Upload an avatar'), + $actionName == 'avatarsettings'); + + $action->menuItem(common_local_url('passwordsettings'), + _('Password'), + _('Change your password'), + $actionName == 'passwordsettings'); + + $action->menuItem(common_local_url('emailsettings'), + _('Email'), + _('Change email handling'), + $actionName == 'emailsettings'); + + $action->menuItem(common_local_url('userdesignsettings'), + _('Design'), + _('Design your profile'), + $actionName == 'userdesignsettings'); + + $action->menuItem(common_local_url('othersettings'), + _('Other'), + _('Other options'), + $actionName == 'othersettings'); + + Event::handle('EndAccountSettingsNav', array(&$action)); + + if (common_config('xmpp', 'enabled')) { + $action->menuItem(common_local_url('imsettings'), + _m('IM'), + _('Updates by instant messenger (IM)'), + $actionName == 'imsettings'); + } + + if (common_config('sms', 'enabled')) { + $action->menuItem(common_local_url('smssettings'), + _m('SMS'), + _('Updates by SMS'), + $actionName == 'smssettings'); + } + + $action->menuItem(common_local_url('oauthconnectionssettings'), + _('Connections'), + _('Authorized connected applications'), + $actionName == 'oauthconnectionsettings'); + + Event::handle('EndConnectSettingsNav', array(&$action)); + } + /** * Return version information for this plugin * -- 2.39.5