Mailbox markup for Inbox/Outbox direct notices
Please enter the commit message for your changes.
This commit is contained in:
parent
f76b565c16
commit
9376003871
|
@ -111,9 +111,10 @@ class MailboxAction extends PersonalAction
|
||||||
$message = $this->getMessages();
|
$message = $this->getMessages();
|
||||||
|
|
||||||
if ($message) {
|
if ($message) {
|
||||||
|
|
||||||
$cnt = 0;
|
$cnt = 0;
|
||||||
$this->elementStart('ul', array('id' => 'messages'));
|
$this->elementStart('div', array('id' =>'notices_primary'));
|
||||||
|
$this->element('h2', null, _('Notices'));
|
||||||
|
$this->elementStart('ul', 'notices');
|
||||||
|
|
||||||
while ($message->fetch() && $cnt <= MESSAGES_PER_PAGE) {
|
while ($message->fetch() && $cnt <= MESSAGES_PER_PAGE) {
|
||||||
$cnt++;
|
$cnt++;
|
||||||
|
@ -130,7 +131,7 @@ class MailboxAction extends PersonalAction
|
||||||
$this->pagination($this->page > 1, $cnt > MESSAGES_PER_PAGE,
|
$this->pagination($this->page > 1, $cnt > MESSAGES_PER_PAGE,
|
||||||
$this->page, $this->trimmed('action'),
|
$this->page, $this->trimmed('action'),
|
||||||
array('nickname' => $this->user->nickname));
|
array('nickname' => $this->user->nickname));
|
||||||
|
$this->elementEnd('div');
|
||||||
$message->free();
|
$message->free();
|
||||||
unset($message);
|
unset($message);
|
||||||
}
|
}
|
||||||
|
@ -169,30 +170,35 @@ class MailboxAction extends PersonalAction
|
||||||
|
|
||||||
function showMessage($message)
|
function showMessage($message)
|
||||||
{
|
{
|
||||||
$this->elementStart('li', array('class' => 'message_single',
|
$this->elementStart('li', array('class' => 'hentry notice',
|
||||||
'id' => 'message-' . $message->id));
|
'id' => 'message-' . $message->id));
|
||||||
|
|
||||||
$profile = $this->getMessageProfile($message);
|
$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);
|
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
|
||||||
$this->elementStart('a', array('href' => $profile->profileurl));
|
|
||||||
$this->element('img', array('src' => ($avatar) ?
|
$this->element('img', array('src' => ($avatar) ?
|
||||||
common_avatar_display_url($avatar) :
|
common_avatar_display_url($avatar) :
|
||||||
common_default_avatar(AVATAR_STREAM_SIZE),
|
common_default_avatar(AVATAR_STREAM_SIZE),
|
||||||
'class' => 'avatar stream',
|
'class' => 'photo avatar',
|
||||||
'width' => AVATAR_STREAM_SIZE,
|
'width' => AVATAR_STREAM_SIZE,
|
||||||
'height' => AVATAR_STREAM_SIZE,
|
'height' => AVATAR_STREAM_SIZE,
|
||||||
'alt' =>
|
'alt' =>
|
||||||
($profile->fullname) ? $profile->fullname :
|
($profile->fullname) ? $profile->fullname :
|
||||||
$profile->nickname));
|
$profile->nickname));
|
||||||
$this->elementEnd('a');
|
$this->element('span', array('class' => 'nickname fn'),
|
||||||
$this->element('a', array('href' => $profile->profileurl,
|
|
||||||
'class' => 'nickname'),
|
|
||||||
$profile->nickname);
|
$profile->nickname);
|
||||||
|
$this->elementEnd('a');
|
||||||
|
$this->elementEnd('span');
|
||||||
|
|
||||||
// FIXME: URL, image, video, audio
|
// FIXME: URL, image, video, audio
|
||||||
$this->elementStart('p', array('class' => 'content'));
|
$this->elementStart('p', array('class' => 'entry-content'));
|
||||||
$this->raw($message->rendered);
|
$this->raw($message->rendered);
|
||||||
$this->elementEnd('p');
|
$this->elementEnd('p');
|
||||||
|
$this->elementEnd('div');
|
||||||
|
|
||||||
$messageurl = common_local_url('showmessage',
|
$messageurl = common_local_url('showmessage',
|
||||||
array('message' => $message->id));
|
array('message' => $message->id));
|
||||||
|
@ -202,17 +208,30 @@ class MailboxAction extends PersonalAction
|
||||||
preg_match('/^http/', $message->uri)) {
|
preg_match('/^http/', $message->uri)) {
|
||||||
$messageurl = $message->uri;
|
$messageurl = $message->uri;
|
||||||
}
|
}
|
||||||
$this->elementStart('p', 'time');
|
|
||||||
$this->element('a', array('class' => 'permalink',
|
|
||||||
'href' => $messageurl,
|
|
||||||
'title' => common_exact_date($message->created)),
|
|
||||||
common_date_string($message->created));
|
|
||||||
if ($message->source) {
|
|
||||||
$this->text(_(' from '));
|
|
||||||
$this->showSource($message->source);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->elementEnd('p');
|
$this->elementStart('div', 'entry-content');
|
||||||
|
$this->elementStart('dl', 'timestamp');
|
||||||
|
$this->element('dt', null, _('Published'));
|
||||||
|
$this->elementStart('dd', null);
|
||||||
|
$dt = common_date_iso8601($message->created);
|
||||||
|
$this->elementStart('a', array('rel' => 'bookmark',
|
||||||
|
'href' => $messageurl));
|
||||||
|
$this->element('abbr', array('class' => 'published',
|
||||||
|
'title' => $dt),
|
||||||
|
common_date_string($message->created));
|
||||||
|
$this->elementEnd('a');
|
||||||
|
$this->elementEnd('dd');
|
||||||
|
$this->elementEnd('dl');
|
||||||
|
|
||||||
|
if ($message->source) {
|
||||||
|
$this->elementStart('dl', 'device');
|
||||||
|
$this->elementStart('dt');
|
||||||
|
$this->text(_('From'));
|
||||||
|
$this->elementEnd('dt');
|
||||||
|
$this->showSource($message->source);
|
||||||
|
$this->elementEnd('dl');
|
||||||
|
}
|
||||||
|
$this->elementEnd('div');
|
||||||
|
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
}
|
}
|
||||||
|
@ -255,15 +274,18 @@ class MailboxAction extends PersonalAction
|
||||||
case 'mail':
|
case 'mail':
|
||||||
case 'omb':
|
case 'omb':
|
||||||
case 'api':
|
case 'api':
|
||||||
$this->element('span', 'noticesource', $source_name);
|
$this->element('dd', null, $source_name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$ns = Notice_source::staticGet($source);
|
$ns = Notice_source::staticGet($source);
|
||||||
if ($ns) {
|
if ($ns) {
|
||||||
$this->element('a', array('href' => $ns->url),
|
$this->elementStart('dd', null);
|
||||||
|
$this->element('a', array('href' => $ns->url,
|
||||||
|
'rel' => 'external'),
|
||||||
$ns->name);
|
$ns->name);
|
||||||
|
$this->elementEnd('dd');
|
||||||
} else {
|
} else {
|
||||||
$this->element('span', 'noticesource', $source_name);
|
$this->element('dd', null, $source_name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -379,7 +379,7 @@ class NoticeListItem extends Widget
|
||||||
case 'mail':
|
case 'mail':
|
||||||
case 'omb':
|
case 'omb':
|
||||||
case 'api':
|
case 'api':
|
||||||
$this->out->element('dd', 'noticesource', $source_name);
|
$this->out->element('dd', null, $source_name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$ns = Notice_source::staticGet($this->notice->source);
|
$ns = Notice_source::staticGet($this->notice->source);
|
||||||
|
@ -390,7 +390,7 @@ class NoticeListItem extends Widget
|
||||||
$ns->name);
|
$ns->name);
|
||||||
$this->out->elementEnd('dd');
|
$this->out->elementEnd('dd');
|
||||||
} else {
|
} else {
|
||||||
$this->out->element('dd', 'noticesource', $source_name);
|
$this->out->element('dd', null, $source_name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user