add titles to group links in notices

This commit is contained in:
Evan Prodromou 2009-03-30 10:26:36 -04:00
parent 3af6680716
commit d5ac986b80

View File

@ -643,10 +643,14 @@ function common_group_link($sender_id, $nickname)
$sender = Profile::staticGet($sender_id); $sender = Profile::staticGet($sender_id);
$group = User_group::staticGet('nickname', common_canonical_nickname($nickname)); $group = User_group::staticGet('nickname', common_canonical_nickname($nickname));
if ($group && $sender->isMember($group)) { if ($group && $sender->isMember($group)) {
$attrs = array('href' => $group->permalink(),
'class' => 'url');
if (!empty($group->fullname)) {
$attrs['title'] = $group->fullname . ' (' . $group->nickname . ')';
}
$xs = new XMLStringer(); $xs = new XMLStringer();
$xs->elementStart('span', 'vcard'); $xs->elementStart('span', 'vcard');
$xs->elementStart('a', array('href' => $group->permalink(), $xs->elementStart('a', $attrs);
'class' => 'url'));
$xs->element('span', 'fn nickname', $nickname); $xs->element('span', 'fn nickname', $nickname);
$xs->elementEnd('a'); $xs->elementEnd('a');
$xs->elementEnd('span'); $xs->elementEnd('span');