- /**
- * show a single message in the list format
- *
- * XXX: This needs to be extracted out into a MessageList similar
- * to NoticeList.
- *
- * @param Message $message the message to show
- *
- * @return void
- */
-
- function showMessage($message)
- {
- $this->elementStart('li', array('class' => 'hentry notice',
- 'id' => 'message-' . $message->id));
-
- $profile = $this->getMessageProfile($message);
-
- $this->elementStart('div', 'entry-title');
- $this->elementStart('span', 'vcard author');
- $this->elementStart('a', array('href' => $profile->profileurl,
- 'class' => 'url'));
- $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
- $this->element('img', array('src' => ($avatar) ?
- $avatar->displayUrl() :
- Avatar::defaultImage(AVATAR_STREAM_SIZE),
- 'class' => 'photo avatar',
- 'width' => AVATAR_STREAM_SIZE,
- 'height' => AVATAR_STREAM_SIZE,
- 'alt' =>
- ($profile->fullname) ? $profile->fullname :
- $profile->nickname));
- $this->element('span', array('class' => 'nickname fn'),
- $profile->nickname);
- $this->elementEnd('a');
- $this->elementEnd('span');
-
- // FIXME: URL, image, video, audio
- $this->elementStart('p', array('class' => 'entry-content'));
- $this->raw($message->rendered);
- $this->elementEnd('p');
- $this->elementEnd('div');
-
- $messageurl = common_local_url('showmessage',
- array('message' => $message->id));
-
- // XXX: we need to figure this out better. Is this right?
- if (strcmp($message->uri, $messageurl) != 0 &&
- preg_match('/^http/', $message->uri)) {
- $messageurl = $message->uri;
- }
-
- $this->elementStart('div', 'entry-content');
- $this->elementStart('a', array('rel' => 'bookmark',
- 'class' => 'timestamp',
- 'href' => $messageurl));
- $dt = common_date_iso8601($message->created);
- $this->element('abbr', array('class' => 'published',
- 'title' => $dt),
- common_date_string($message->created));
- $this->elementEnd('a');
-
- if ($message->source) {
- $this->elementStart('span', 'source');
- // FIXME: bad i18n. Device should be a parameter (from %s).
- $this->text(_('from'));
- $this->element('span', 'device', $this->showSource($message->source));
- $this->elementEnd('span');
- }
- $this->elementEnd('div');
-
- $this->elementEnd('li');
- }
-