diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-17 10:14:08 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-17 10:14:08 -0800 |
commit | 5a6cbb248f8cdcb171ea5540e6a6c2eb10506a82 (patch) | |
tree | c72830bef3388b1ceb19cc6ef688177122961435 /lib | |
parent | 46e9aa13aa87955b441bc63b7cf2f58622b131b0 (diff) | |
parent | 3cb6b1670bd7e3860fdca217e4075f51378fe5e0 (diff) |
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/noticelist.php | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/noticelist.php b/lib/noticelist.php index c05b99024..837cb90fa 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -492,30 +492,34 @@ class NoticeListItem extends Widget break; default: - $name = null; + $name = $source_name; $url = null; - $ns = Notice_source::staticGet($this->notice->source); - - if ($ns) { - $name = $ns->name; - $url = $ns->url; - } else { - $app = Oauth_application::staticGet('name', $this->notice->source); - if ($app) { - $name = $app->name; - $url = $app->source_url; + if (Event::handle('StartNoticeSourceLink', array($this->notice, &$name, &$url, &$title))) { + $ns = Notice_source::staticGet($this->notice->source); + + if ($ns) { + $name = $ns->name; + $url = $ns->url; + } else { + $app = Oauth_application::staticGet('name', $this->notice->source); + if ($app) { + $name = $app->name; + $url = $app->source_url; + } } } + Event::handle('EndNoticeSourceLink', array($this->notice, &$name, &$url, &$title)); if (!empty($name) && !empty($url)) { $this->out->elementStart('span', 'device'); $this->out->element('a', array('href' => $url, - 'rel' => 'external'), + 'rel' => 'external', + 'title' => $title), $name); $this->out->elementEnd('span'); } else { - $this->out->element('span', 'device', $source_name); + $this->out->element('span', 'device', $name); } break; } |