]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Event hook for notice search pages
authorBrion Vibber <brion@pobox.com>
Tue, 15 Mar 2011 22:33:37 +0000 (15:33 -0700)
committerBrion Vibber <brion@pobox.com>
Tue, 15 Mar 2011 22:33:37 +0000 (15:33 -0700)
actions/noticesearch.php

index 4f4c7a05ba35fdd510cf4c9d69f465595b101926..1f43af800d2194ccdbfbba1b3541b21c4c86ef12 100644 (file)
@@ -138,11 +138,14 @@ class NoticesearchAction extends SearchAction
             $this->elementEnd('div');
             return;
         }
-        $terms = preg_split('/[\s,]+/', $q);
-        $nl = new SearchNoticeList($notice, $this, $terms);
-        $cnt = $nl->show();
-        $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE,
-                          $page, 'noticesearch', array('q' => $q));
+        if (Event::handle('StartNoticeSearchShowResults', array($this, $q, $notice))) {
+            $terms = preg_split('/[\s,]+/', $q);
+            $nl = new SearchNoticeList($notice, $this, $terms);
+            $cnt = $nl->show();
+            $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE,
+                              $page, 'noticesearch', array('q' => $q));
+            Event::handle('EndNoticeSearchShowResults', array($this, $q, $notice));
+        }
     }
 
     function showScripts()