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 ShownoticeAction extends Action {
24 function handle($args) {
25 parent::handle($args);
26 $id = $this->arg('notice');
27 $notice = Notice::staticGet($id);
30 $this->no_such_notice();
33 if (!$notice->getProfile()) {
34 $this->no_such_notice();
37 # Looks like we're good; show the header
39 common_show_header($profile->nickname." status on ".$notice->created);
41 $this->show_notice($notice);
46 function no_such_notice() {
47 common_user_error('No such notice.');
50 function show_notice($notice) {
51 $profile = $notice->getProfile();
53 common_element_start('div', array('class' => 'notice greenBg'));
54 $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
56 common_element('img', array('src' => $avatar->url,
57 'class' => 'avatar profile',
58 'width' => AVATAR_PROFILE_SIZE,
59 'height' => AVATAR_PROFILE_SIZE,
61 ($profile->fullname) ? $profile->fullname :
64 common_element('a', array('href' => $profile->profileurl,
65 'class' => 'nickname',
67 ($profile->fullname) ? $profile->fullname :
70 # FIXME: URL, image, video, audio
71 common_element_start('span', array('class' => 'content'));
72 common_raw(common_render_content($notice->content, $notice));
73 common_element_end('span');
74 common_element('span', array('class' => 'date'),
75 common_date_string($notice->created));
76 common_element_end('div');