diff options
author | Zach Copley <zach@status.net> | 2010-05-06 20:25:20 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-05-18 15:16:13 -0700 |
commit | 3708341857a8ae26c2936df53fede09aa17b09f8 (patch) | |
tree | 649f17fddaa92c16a27e4b6d61ff20f6abc68685 | |
parent | 6187266205a55db0298e02df7d6996a735d42eba (diff) |
Allow OStatusPlugin to set the source attribution title
-rw-r--r-- | lib/noticelist.php | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php index d22010335..81da9edc0 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -489,40 +489,37 @@ class NoticeListItem extends Widget $this->out->text(_('from')); $this->out->text(' '); - // if $ns->name and $ns->url are populated we have - // configured a source attr somewhere - 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; + $name = $source_name; + $url = $ns->url; + $title = null; - if (Event::handle('StartNoticeSourceLink', array($this->notice, &$name, &$url, &$title))) { - $name = $source_name; - $url = $ns->url; - } - Event::handle('EndNoticeSourceLink', array($this->notice, &$name, &$url, &$title)); + if (Event::handle('StartNoticeSourceLink', array($this->notice, &$name, &$url, &$title))) { + $name = $source_name; + $url = $ns->url; + } + Event::handle('EndNoticeSourceLink', array($this->notice, &$name, &$url, &$title)); - if (!empty($name) && !empty($url)) { - $this->out->elementStart('span', 'device'); + // if $ns->name and $ns->url are populated we have + // configured a source attr somewhere + if (!empty($name) && !empty($url)) { - $attrs = array( - 'href' => $url, - 'rel' => 'external' - ); + $this->out->elementStart('span', 'device'); - if (isset($title)) { - $attrs['title'] = $title; - } + $attrs = array( + 'href' => $url, + 'rel' => 'external' + ); - $this->out->element('a', $attrs, $name); - $this->out->elementEnd('span'); - } else { - $this->out->element('span', 'device', $name); + if (!empty($title)) { + $attrs['title'] = $title; } + + $this->out->element('a', $attrs, $name); + $this->out->elementEnd('span'); + } else { + $this->out->element('span', 'device', $name); } + $this->out->elementEnd('span'); } } |