]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add Start/EndFavorNoticeForm and Start/EndDisFavorNoticeForm hooks
authorZach Copley <zach@status.net>
Wed, 29 Sep 2010 21:07:46 +0000 (14:07 -0700)
committerZach Copley <zach@status.net>
Wed, 29 Sep 2010 21:07:46 +0000 (14:07 -0700)
EVENTS.txt
lib/disfavorform.php
lib/favorform.php

index e0dc7514d6006725c8938cfdb7db43939ab3166d..bb84cc4d6a3615a11d53817b690fb62b795b3374 100644 (file)
@@ -774,6 +774,22 @@ EndDisfavorNotice: After saving a notice as a favorite
 - $profile: profile of the person faving (can be remote!)
 - $notice: notice being faved
 
+StartFavorNoticeForm: starting the data in the form for favoring a notice
+- $FavorForm: the favor form being shown
+- $notice: notice being favored
+
+EndFavorNoticeForm: Ending the data in the form for favoring a notice
+- $FavorForm: the favor form being shown
+- $notice: notice being favored
+
+StartDisFavorNoticeForm: starting the data in the form for disfavoring a notice
+- $DisfavorForm: the disfavor form being shown
+- $notice: notice being difavored
+
+EndDisFavorNoticeForm: Ending the data in the form for disfavoring a notice
+- $DisfavorForm: the disfavor form being shown
+- $notice: notice being disfavored
+
 StartFindMentions: start finding mentions in a block of text
 - $sender: sender profile
 - $text: plain text version of the notice
index 5b135b38ad5be62c395c7e709c4b02eb3aa94e2f..6023766d7bf5ce7da8a0751a1ac00e9806295288 100644 (file)
@@ -123,9 +123,13 @@ class DisfavorForm extends Form
 
     function formData()
     {
-        $this->out->hidden('notice-n'.$this->notice->id,
-                           $this->notice->id,
-                           'notice');
+        if (Event::handle('StartDisFavorNoticeForm', array($this, $this->notice))) {
+            $this->out->hidden('notice-n'.$this->notice->id,
+                               $this->notice->id,
+                               'notice');
+            Event::handle('EndDisFavorNoticeForm', array($this, $this->notice));
+        }
+
     }
 
     /**
index 625df7c8b5695b98a0792afe95f7454362eb9fd6..4e2891ffd591bb09ce24f3e39f8714e48724ad46 100644 (file)
@@ -123,9 +123,12 @@ class FavorForm extends Form
 
     function formData()
     {
-        $this->out->hidden('notice-n'.$this->notice->id,
-                           $this->notice->id,
-                           'notice');
+        if (Event::handle('StartFavorNoticeForm', array($this, $this->notice))) {
+            $this->out->hidden('notice-n'.$this->notice->id,
+                               $this->notice->id,
+                               'notice');
+            Event::handle('EndFavorNoticeForm', array($this, $this->notice));
+        }
     }
 
     /**