- if ($user) {
- if ($user->hasFave($this->notice)) {
- common_disfavor_form($this->notice);
- } else {
- common_favor_form($this->notice);
- }
- }
- }
-
- function show_author() {
- common_element_start('span', 'vcard author');
- $this->show_avatar();
- $this->show_nickname();
- common_element_end('span');
- }
-
- function show_avatar() {
- $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
- common_element_start('a', array('href' => $this->profile->profileurl));
- common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
- 'class' => 'avatar stream photo',
- 'width' => AVATAR_STREAM_SIZE,
- 'height' => AVATAR_STREAM_SIZE,
- 'alt' =>
- ($this->profile->fullname) ? $this->profile->fullname :
- $this->profile->nickname));
- common_element_end('a');
- }
-
- function show_nickname() {
- common_element('a', array('href' => $this->profile->profileurl,
- 'class' => 'nickname fn url'),
- $this->profile->nickname);
- }
-
- function show_content() {
- # FIXME: URL, image, video, audio
- common_element_start('p', array('class' => 'content entry-title'));
- if ($this->notice->rendered) {
- common_raw($this->notice->rendered);
- } else {
- # XXX: may be some uncooked notices in the DB,
- # we cook them right now. This should probably disappear in future
- # versions (>> 0.4.x)
- common_raw(common_render_content($this->notice->content, $this->notice));
- }
- common_element_end('p');
- }
-
- function show_start_time_section() {
- common_element_start('p', 'time');
- }
-
- function show_notice_link() {
- $noticeurl = common_local_url('shownotice', array('notice' => $this->notice->id));
- # XXX: we need to figure this out better. Is this right?
- if (strcmp($this->notice->uri, $noticeurl) != 0 && preg_match('/^http/', $this->notice->uri)) {
- $noticeurl = $this->notice->uri;
- }
- common_element_start('a', array('class' => 'permalink',
- 'rel' => 'bookmark',
- 'href' => $noticeurl));
- common_element('abbr', array('class' => 'published',
- 'title' => common_date_iso8601($this->notice->created)),
- common_date_string($this->notice->created));
- common_element_end('a');
- }
-
- function show_notice_source() {
- if ($this->notice->source) {
- common_element('span', null, _(' from '));
+ if ($user) {
+ if ($user->hasFave($this->notice)) {
+ common_disfavor_form($this->notice);
+ } else {
+ common_favor_form($this->notice);
+ }
+ }
+ }
+
+ /**
+ * show the author of a notice
+ *
+ * By default, this shows the avatar and (linked) nickname of the author.
+ *
+ * @return void
+ */
+
+ function showAuthor()
+ {
+ common_element_start('span', 'vcard author');
+ $this->showAvatar();
+ $this->showNickname();
+ common_element_end('span');
+ }
+
+ /**
+ * show the avatar of the notice's author
+ *
+ * This will use the default avatar if no avatar is assigned for the author.
+ * It makes a link to the author's profile.
+ *
+ * @return void
+ */
+
+ function showAvatar()
+ {
+ $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
+ common_element_start('a', array('href' => $this->profile->profileurl));
+ common_element('img', array('src' => ($avatar) ?
+ common_avatar_display_url($avatar) :
+ common_default_avatar(AVATAR_STREAM_SIZE),
+ 'class' => 'avatar stream photo',
+ 'width' => AVATAR_STREAM_SIZE,
+ 'height' => AVATAR_STREAM_SIZE,
+ 'alt' =>
+ ($this->profile->fullname) ?
+ $this->profile->fullname :
+ $this->profile->nickname));
+ common_element_end('a');
+ }
+
+ /**
+ * show the nickname of the author
+ *
+ * Links to the author's profile page
+ *
+ * @return void
+ */
+
+ function showNickname()
+ {
+ common_element('a', array('href' => $this->profile->profileurl,
+ 'class' => 'nickname fn url'),
+ $this->profile->nickname);
+ }
+
+ /**
+ * show the content of the notice
+ *
+ * Shows the content of the notice. This is pre-rendered for efficiency
+ * at save time. Some very old notices might not be pre-rendered, so
+ * they're rendered on the spot.
+ *
+ * @return void
+ */
+
+ function showContent()
+ {
+ // FIXME: URL, image, video, audio
+ common_element_start('p', array('class' => 'content entry-title'));
+ if ($this->notice->rendered) {
+ common_raw($this->notice->rendered);
+ } else {
+ // XXX: may be some uncooked notices in the DB,
+ // we cook them right now. This should probably disappear in future
+ // versions (>> 0.4.x)
+ common_raw(common_render_content($this->notice->content, $this->notice));
+ }
+ common_element_end('p');
+ }
+
+ /**
+ * show the "time" section of a notice
+ *
+ * This is the greyed-out section that appears beneath the content, including
+ * links to delete or reply to the notice. Probably should be called something
+ * else.
+ *
+ * @return void
+ */
+
+ function startTimeSection()
+ {
+ common_element_start('p', 'time');
+ }
+
+ /**
+ * show the link to the main page for the notice
+ *
+ * Displays a link to the page for a notice, with "relative" time. Tries to
+ * get remote notice URLs correct, but doesn't always succeed.
+ *
+ * @return void
+ */
+
+ function showNoticeLink()
+ {
+ $noticeurl = common_local_url('shownotice',
+ array('notice' => $this->notice->id));
+ // XXX: we need to figure this out better. Is this right?
+ if (strcmp($this->notice->uri, $noticeurl) != 0 &&
+ preg_match('/^http/', $this->notice->uri)) {
+ $noticeurl = $this->notice->uri;
+ }
+ common_element_start('a', array('class' => 'permalink',
+ 'rel' => 'bookmark',
+ 'href' => $noticeurl));
+ $dt = common_date_iso8601($this->notice->created);
+ common_element('abbr', array('class' => 'published',
+ 'title' => $dt),
+ common_date_string($this->notice->created));
+ common_element_end('a');
+ }
+
+ /**
+ * Show the source of the notice
+ *
+ * Either the name (and link) of the API client that posted the notice,
+ * or one of other other channels.
+ *
+ * @return void
+ */
+
+ function showNoticeSource()
+ {
+ if ($this->notice->source) {
+ common_element('span', null, _(' from '));