]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
New eventsi: Start/EndShowNoticeOptions and Start/EndShowFaveForm
authorZach Copley <zach@status.net>
Wed, 29 Sep 2010 00:09:34 +0000 (17:09 -0700)
committerZach Copley <zach@status.net>
Wed, 29 Sep 2010 23:35:12 +0000 (16:35 -0700)
EVENTS.txt
lib/noticelist.php

index cad93a7121bf04c053fec2cea6df5ad9b1972018..d722bc4ac7803b25ccfa86303c131b65895ba207 100644 (file)
@@ -258,10 +258,22 @@ EndShowExportData: just after showing the <div> with export data (feeds)
 - $action: action object being shown
 
 StartShowNoticeItem: just before showing the notice item
-- $action: action object being shown
+- $item: The NoticeListItem object being shown
 
 EndShowNoticeItem: just after showing the notice item
-- $action: action object being shown
+- $item: the NoticeListItem object being shown
+
+StartShowNoticeOptions: just before showing notice options like fave, repeat, etc.
+- $item: the NoticeListItem object being shown
+
+EndShowNoticeOptions: just after showing notice options like fave, repeat, etc.
+- $item: the NoticeListItem object being shown
+
+StartShowFaveForm: just before showing the fave form
+- $item: the NoticeListItem object being shown
+
+EndShowFaveForm: just after showing the fave form
+- $item: the NoticeListItem object being shown
 
 StartShowPageNotice: just before showing the page notice (instructions or error)
 - $action: action object being shown
index 529d6a3f90752c4a82457c4dc49f1563b23127c2..cc460005ad240fd85ce841800a454fcb8759b61c 100644 (file)
@@ -236,14 +236,17 @@ class NoticeListItem extends Widget
 
     function showNoticeOptions()
     {
-        $user = common_current_user();
-        if ($user) {
-            $this->out->elementStart('div', 'notice-options');
-            $this->showFaveForm();
-            $this->showReplyLink();
-            $this->showRepeatForm();
-            $this->showDeleteLink();
-            $this->out->elementEnd('div');
+        if (Event::handle('StartShowNoticeOptions', array($this))) {
+            $user = common_current_user();
+            if ($user) {
+                $this->out->elementStart('div', 'notice-options');
+                $this->showFaveForm();
+                $this->showReplyLink();
+                $this->showRepeatForm();
+                $this->showDeleteLink();
+                $this->out->elementEnd('div');
+            }
+            Event::handle('EndShowNoticeOptions', array($this));
         }
     }
 
@@ -270,15 +273,18 @@ class NoticeListItem extends Widget
 
     function showFaveForm()
     {
-        $user = common_current_user();
-        if ($user) {
-            if ($user->hasFave($this->notice)) {
-                $disfavor = new DisfavorForm($this->out, $this->notice);
-                $disfavor->show();
-            } else {
-                $favor = new FavorForm($this->out, $this->notice);
-                $favor->show();
+        if (Event::handle('StartShowFaveForm', array($this))) {
+            $user = common_current_user();
+            if ($user) {
+                if ($user->hasFave($this->notice)) {
+                    $disfavor = new DisfavorForm($this->out, $this->notice);
+                    $disfavor->show();
+                } else {
+                    $favor = new FavorForm($this->out, $this->notice);
+                    $favor->show();
+                }
             }
+            Event::handle('EndShowFaveForm', array($this));
         }
     }