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 section w/ home link
63 $this->action->elementStart('ul');
64 // TRANS: Header in settings navigation panel.
65 $this->action->element('h3', null, _m('HEADER','Home'));
66 $this->action->elementStart('ul', 'nav');
67 $this->out->menuItem(common_local_url('all', array('nickname' =>
69 // TRANS: Menu item in settings navigation panel.
71 // TRANS: Menu item title in settings navigation panel.
72 // TRANS: %s is a username.
73 sprintf(_('%s and friends'), $name),
74 $this->action == 'all', 'nav_timeline_personal');
76 $this->action->elementEnd('ul');
77 $this->action->elementEnd('ul');
79 $this->action->elementStart('ul');
80 // TRANS: Header in settings navigation panel.
81 $this->action->element('h3', null, _m('HEADER','Settings'));
82 $this->action->elementStart('ul', array('class' => 'nav'));
84 if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
85 $this->action->menuItem(common_local_url('profilesettings'),
86 // TRANS: Menu item in settings navigation panel.
88 // TRANS: Menu item title in settings navigation panel.
89 _('Change your profile settings'),
90 $actionName == 'profilesettings');
92 $this->action->menuItem(common_local_url('avatarsettings'),
93 // TRANS: Menu item in settings navigation panel.
95 // TRANS: Menu item title in settings navigation panel.
96 _('Upload an avatar'),
97 $actionName == 'avatarsettings');
99 $this->action->menuItem(common_local_url('passwordsettings'),
100 // TRANS: Menu item in settings navigation panel.
101 _m('MENU','Password'),
102 // TRANS: Menu item title in settings navigation panel.
103 _('Change your password'),
104 $actionName == 'passwordsettings');
106 $this->action->menuItem(common_local_url('emailsettings'),
107 // TRANS: Menu item in settings navigation panel.
109 // TRANS: Menu item title in settings navigation panel.
110 _('Change email handling'),
111 $actionName == 'emailsettings');
113 $this->action->menuItem(common_local_url('userdesignsettings'),
114 // TRANS: Menu item in settings navigation panel.
116 // TRANS: Menu item title in settings navigation panel.
117 _('Design your profile'),
118 $actionName == 'userdesignsettings');
120 $this->action->menuItem(common_local_url('urlsettings'),
121 // TRANS: Menu item in settings navigation panel.
123 // TRANS: Menu item title in settings navigation panel.
125 $actionName == 'urlsettings');
127 Event::handle('EndAccountSettingsNav', array(&$this->action));
129 if (common_config('xmpp', 'enabled')) {
130 $this->action->menuItem(common_local_url('imsettings'),
131 // TRANS: Menu item in settings navigation panel.
133 // TRANS: Menu item title in settings navigation panel.
134 _('Updates by instant messenger (IM)'),
135 $actionName == 'imsettings');
138 if (common_config('sms', 'enabled')) {
139 $this->action->menuItem(common_local_url('smssettings'),
140 // TRANS: Menu item in settings navigation panel.
142 // TRANS: Menu item title in settings navigation panel.
144 $actionName == 'smssettings');
147 $this->action->menuItem(common_local_url('oauthconnectionssettings'),
148 // TRANS: Menu item in settings navigation panel.
149 _m('MENU','Connections'),
150 // TRANS: Menu item title in settings navigation panel.
151 _('Authorized connected applications'),
152 $actionName == 'oauthconnectionsettings');
154 Event::handle('EndConnectSettingsNav', array(&$this->action));
157 $this->action->elementEnd('ul');
158 $this->action->elementEnd('ul');