]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Throw in a quick event hook to override the profile list type on showstream (should...
authorBrion Vibber <brion@pobox.com>
Fri, 1 Oct 2010 18:05:15 +0000 (11:05 -0700)
committerBrion Vibber <brion@pobox.com>
Fri, 1 Oct 2010 18:05:15 +0000 (11:05 -0700)
Replace with a NoticeList to have output include avatar and username -- but CSS still hides them in default theme.

Event::addHandler('ShowStreamNoticeList', 'awesome');
function awesome($notice, $action, &$pnl)
{
    $pnl = new NoticeList($notice, $action);
    return false;
}

actions/showstream.php

index 2476f19faba05fe2664ea6229e8fe454aefc7a63..e9f117afc45d7e355bed1941ef2bb3152db80c8b 100644 (file)
@@ -222,7 +222,10 @@ class ShowstreamAction extends ProfileAction
           ? $this->user->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1)
             : $this->user->getTaggedNotices($this->tag, ($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1, 0, 0, null);
 
-        $pnl = new ProfileNoticeList($notice, $this);
+        $pnl = null;
+        if (Event::handle('ShowStreamNoticeList', array($notice, $this, &$pnl))) {
+            $pnl = new ProfileNoticeList($notice, $this);
+        }
         $cnt = $pnl->show();
         if (0 == $cnt) {
             $this->showEmptyListMessage();