Allow OStatusPlugin to set the source attribution title
This commit is contained in:
parent
ce177400f8
commit
ee8c9d1422
|
@ -497,14 +497,8 @@ class NoticeListItem extends Widget
|
||||||
$this->out->text(_('from'));
|
$this->out->text(_('from'));
|
||||||
$this->out->text(' ');
|
$this->out->text(' ');
|
||||||
|
|
||||||
// if $ns->name and $ns->url are populated we have
|
$name = $source_name;
|
||||||
// configured a source attr somewhere
|
$url = $ns->url;
|
||||||
if (empty($ns->name) && empty($ns->url)) {
|
|
||||||
// otherwise it's from normal channel such as web or api
|
|
||||||
$this->out->element('span', 'device', $source_name);
|
|
||||||
} else {
|
|
||||||
$name = null;
|
|
||||||
$url = null;
|
|
||||||
$title = null;
|
$title = null;
|
||||||
|
|
||||||
if (Event::handle('StartNoticeSourceLink', array($this->notice, &$name, &$url, &$title))) {
|
if (Event::handle('StartNoticeSourceLink', array($this->notice, &$name, &$url, &$title))) {
|
||||||
|
@ -513,7 +507,10 @@ class NoticeListItem extends Widget
|
||||||
}
|
}
|
||||||
Event::handle('EndNoticeSourceLink', array($this->notice, &$name, &$url, &$title));
|
Event::handle('EndNoticeSourceLink', array($this->notice, &$name, &$url, &$title));
|
||||||
|
|
||||||
|
// if $ns->name and $ns->url are populated we have
|
||||||
|
// configured a source attr somewhere
|
||||||
if (!empty($name) && !empty($url)) {
|
if (!empty($name) && !empty($url)) {
|
||||||
|
|
||||||
$this->out->elementStart('span', 'device');
|
$this->out->elementStart('span', 'device');
|
||||||
|
|
||||||
$attrs = array(
|
$attrs = array(
|
||||||
|
@ -521,7 +518,7 @@ class NoticeListItem extends Widget
|
||||||
'rel' => 'external'
|
'rel' => 'external'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($title)) {
|
if (!empty($title)) {
|
||||||
$attrs['title'] = $title;
|
$attrs['title'] = $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -530,7 +527,7 @@ class NoticeListItem extends Widget
|
||||||
} else {
|
} else {
|
||||||
$this->out->element('span', 'device', $name);
|
$this->out->element('span', 'device', $name);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$this->out->elementEnd('span');
|
$this->out->elementEnd('span');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user