3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2010, StatusNet, Inc.
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * @author Evan Prodromou <evan@status.net>
26 * @copyright 2010 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET')) {
32 // This check helps protect against security problems;
33 // your code file can't be executed directly from the web.
38 * A widget for showing the settings group local nav menu
42 * @author Evan Prodromou <evan@status.net>
43 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
44 * @link http://status.net/
49 class SettingsNav extends Widget
56 * @param Action $action current action, used for output
58 function __construct($action=null)
60 parent::__construct($action);
61 $this->action = $action;
72 $actionName = $this->action->trimmed('action');
73 $this->action->elementStart('ul', array('class' => 'nav'));
75 if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
76 $this->action->menuItem(common_local_url('profilesettings'),
78 _('Change your profile settings'),
79 $actionName == 'profilesettings');
81 $this->action->menuItem(common_local_url('avatarsettings'),
83 _('Upload an avatar'),
84 $actionName == 'avatarsettings');
86 $this->action->menuItem(common_local_url('passwordsettings'),
88 _('Change your password'),
89 $actionName == 'passwordsettings');
91 $this->action->menuItem(common_local_url('emailsettings'),
93 _('Change email handling'),
94 $actionName == 'emailsettings');
96 $this->action->menuItem(common_local_url('userdesignsettings'),
98 _('Design your profile'),
99 $actionName == 'userdesignsettings');
101 $this->action->menuItem(common_local_url('urlsettings'),
104 $actionName == 'urlsettings');
106 Event::handle('EndAccountSettingsNav', array(&$this->action));
108 if (common_config('xmpp', 'enabled')) {
109 $this->action->menuItem(common_local_url('imsettings'),
111 _('Updates by instant messenger (IM)'),
112 $actionName == 'imsettings');
115 if (common_config('sms', 'enabled')) {
116 $this->action->menuItem(common_local_url('smssettings'),
119 $actionName == 'smssettings');
122 $this->action->menuItem(common_local_url('oauthconnectionssettings'),
124 _('Authorized connected applications'),
125 $actionName == 'oauthconnectionsettings');
127 Event::handle('EndConnectSettingsNav', array(&$this->action));
130 $this->action->elementEnd('ul');