3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2010,2011, 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,2011 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/
48 class SettingsNav extends Menu
57 $actionName = $this->action->trimmed('action');
58 $user = common_current_user();
59 $nickname = $user->nickname;
60 $name = $user->getProfile()->getBestName();
62 $stub = new HomeStubNav($this->action);
63 $this->submenu(_m('MENU','Home'), $stub);
65 $this->action->elementStart('ul');
66 $this->action->elementStart('li');
67 // TRANS: Header in settings navigation panel.
68 $this->action->element('h3', null, _m('HEADER','Settings'));
69 $this->action->elementStart('ul', array('class' => 'nav'));
71 if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
72 $this->action->menuItem(common_local_url('profilesettings'),
73 // TRANS: Menu item in settings navigation panel.
75 // TRANS: Menu item title in settings navigation panel.
76 _('Change your profile settings'),
77 $actionName == 'profilesettings');
79 $this->action->menuItem(common_local_url('avatarsettings'),
80 // TRANS: Menu item in settings navigation panel.
82 // TRANS: Menu item title in settings navigation panel.
83 _('Upload an avatar'),
84 $actionName == 'avatarsettings');
86 $this->action->menuItem(common_local_url('passwordsettings'),
87 // TRANS: Menu item in settings navigation panel.
88 _m('MENU','Password'),
89 // TRANS: Menu item title in settings navigation panel.
90 _('Change your password'),
91 $actionName == 'passwordsettings');
93 $this->action->menuItem(common_local_url('emailsettings'),
94 // TRANS: Menu item in settings navigation panel.
96 // TRANS: Menu item title in settings navigation panel.
97 _('Change email handling'),
98 $actionName == 'emailsettings');
100 $this->action->menuItem(common_local_url('urlsettings'),
101 // TRANS: Menu item in settings navigation panel.
103 // TRANS: Menu item title in settings navigation panel.
105 $actionName == 'urlsettings');
107 Event::handle('EndAccountSettingsNav', array(&$this->action));
109 $haveImPlugin = false;
111 Event::handle('HaveImPlugin', array(&$haveImPlugin));
114 $this->action->menuItem(common_local_url('imsettings'),
115 // TRANS: Menu item in settings navigation panel.
117 // TRANS: Menu item title in settings navigation panel.
118 _('Updates by instant messenger (IM)'),
119 $actionName == 'imsettings');
122 if (common_config('sms', 'enabled')) {
123 $this->action->menuItem(common_local_url('smssettings'),
124 // TRANS: Menu item in settings navigation panel.
126 // TRANS: Menu item title in settings navigation panel.
128 $actionName == 'smssettings');
131 $this->action->menuItem(common_local_url('oauthconnectionssettings'),
132 // TRANS: Menu item in settings navigation panel.
133 _m('MENU','Connections'),
134 // TRANS: Menu item title in settings navigation panel.
135 _('Authorized connected applications'),
136 $actionName == 'oauthconnectionsettings');
138 if (common_config('oldschool', 'enabled')) {
139 $this->action->menuItem(common_local_url('oldschoolsettings'),
140 // TRANS: Menu item in settings navigation panel.
141 _m('MENU','Old school'),
142 // TRANS: Menu item title in settings navigation panel.
143 _('UI tweaks for old-school users'),
144 $actionName == 'oldschoolsettings');
147 Event::handle('EndConnectSettingsNav', array(&$this->action));
150 $this->action->elementEnd('ul');
151 $this->action->elementEnd('li');
152 $this->action->elementEnd('ul');