forked from GNUsocial/gnu-social
show addressees in notice lists
This commit is contained in:
parent
5135043b84
commit
83dfe5ed3e
@ -205,20 +205,87 @@ class NoticeListItem extends Widget
|
|||||||
|
|
||||||
function showAuthor()
|
function showAuthor()
|
||||||
{
|
{
|
||||||
$this->out->elementStart('div', 'vcard author');
|
$this->out->elementStart('div', 'author');
|
||||||
|
|
||||||
|
$this->out->elementStart('span', 'vcard author');
|
||||||
|
|
||||||
$attrs = array('href' => $this->profile->profileurl,
|
$attrs = array('href' => $this->profile->profileurl,
|
||||||
'class' => 'url',
|
'class' => 'url',
|
||||||
'title' => $this->profile->nickname);
|
'title' => $this->profile->nickname);
|
||||||
|
|
||||||
$this->out->elementStart('a', $attrs);
|
$this->out->elementStart('a', $attrs);
|
||||||
$this->showAvatar();
|
$this->showAvatar();
|
||||||
$this->out->elementEnd('a');
|
$this->out->text(' ');
|
||||||
$this->out->element('a', array('href' => $this->profile->profileurl,
|
$this->out->element('span',array('class' => 'nickname fn'),
|
||||||
'class' => 'url nickname fn',
|
|
||||||
'title' => $this->profile->nickname),
|
|
||||||
$this->profile->getBestName());
|
$this->profile->getBestName());
|
||||||
|
$this->out->elementEnd('a');
|
||||||
|
|
||||||
|
$this->out->elementEnd('span');
|
||||||
|
|
||||||
|
$this->showAddressees();
|
||||||
|
|
||||||
$this->out->elementEnd('div');
|
$this->out->elementEnd('div');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showAddressees()
|
||||||
|
{
|
||||||
|
$this->out->elementStart('span', 'addressees');
|
||||||
|
|
||||||
|
$cnt = $this->showGroupAddressees(true);
|
||||||
|
$cnt = $this->showProfileAddressees($cnt == 0);
|
||||||
|
|
||||||
|
$this->out->elementEnd('span', 'addressees');
|
||||||
|
}
|
||||||
|
|
||||||
|
function showGroupAddressees($first)
|
||||||
|
{
|
||||||
|
$groups = $this->getGroups();
|
||||||
|
|
||||||
|
foreach ($groups as $group) {
|
||||||
|
if (!$first) {
|
||||||
|
$this->out->text(', ');
|
||||||
|
} else {
|
||||||
|
$this->out->text(' ▶ ');
|
||||||
|
$first = false;
|
||||||
|
}
|
||||||
|
$this->out->element('a', array('href' => $group->homeUrl(),
|
||||||
|
'title' => $group->nickname,
|
||||||
|
'class' => 'addressee group'),
|
||||||
|
$group->getBestName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return count($groups);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getGroups()
|
||||||
|
{
|
||||||
|
return $this->notice->getGroups();
|
||||||
|
}
|
||||||
|
|
||||||
|
function showProfileAddressees($first)
|
||||||
|
{
|
||||||
|
$replies = $this->getReplyProfiles();
|
||||||
|
|
||||||
|
foreach ($replies as $reply) {
|
||||||
|
if (!$first) {
|
||||||
|
$this->out->text(', ');
|
||||||
|
} else {
|
||||||
|
$first = false;
|
||||||
|
}
|
||||||
|
$this->out->element('a', array('href' => $reply->profileurl,
|
||||||
|
'title' => $reply->nickname,
|
||||||
|
'class' => 'addressee account'),
|
||||||
|
$reply->getBestName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return count($replies);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getReplyProfiles()
|
||||||
|
{
|
||||||
|
return $this->notice->getReplyProfiles();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* show the avatar of the notice's author
|
* show the avatar of the notice's author
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user