3 * Laconica - a distributed open-source microblogging tool
4 * Copyright (C) 2008, Controlez-Vous, Inc.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 if (!defined('LACONICA')) { exit(1); }
22 class PersonalAction extends Action
25 function is_readonly()
30 function handle($args)
32 parent::handle($args);
33 common_set_returnto($this->self_url());
40 $action = $this->trimmed('action');
41 $nickname = $this->trimmed('nickname');
44 $user = User::staticGet('nickname', $nickname);
45 $user_profile = $user->getProfile();
47 $user_profile = false;
50 common_element_start('ul', array('id' => 'nav_views'));
52 common_menu_item(common_local_url('all', array('nickname' =>
55 sprintf(_('%s and friends'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
57 common_menu_item(common_local_url('replies', array('nickname' =>
60 sprintf(_('Replies to %s'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)),
61 $action == 'replies');
62 common_menu_item(common_local_url('showstream', array('nickname' =>
65 ($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname,
66 $action == 'showstream');
67 common_menu_item(common_local_url('showfavorites', array('nickname' =>
70 sprintf(_('%s\'s favorite notices'), ($user_profile) ? $user_profile->getBestName() : _('User')),
71 $action == 'showfavorites');
73 $cur = common_current_user();
75 if ($cur && $cur->id == $user->id) {
77 common_menu_item(common_local_url('inbox', array('nickname' =>
80 _('Your incoming messages'),
82 common_menu_item(common_local_url('outbox', array('nickname' =>
85 _('Your sent messages'),
89 common_element_end('ul');
92 function source_link($source)
94 $source_name = _($source);
101 common_element('span', 'noticesource', $source_name);
104 $ns = Notice_source::staticGet($source);
106 common_element('a', array('href' => $ns->url),
109 common_element('span', 'noticesource', $source_name);