From de6bd5c129f07a8c19aaf1094b2e4d9856d47a33 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 29 Sep 2010 14:07:46 -0700 Subject: [PATCH] Add Start/EndFavorNoticeForm and Start/EndDisFavorNoticeForm hooks --- EVENTS.txt | 16 ++++++++++++++++ lib/disfavorform.php | 10 +++++++--- lib/favorform.php | 9 ++++++--- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index e0dc7514d6..bb84cc4d6a 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -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 diff --git a/lib/disfavorform.php b/lib/disfavorform.php index 5b135b38ad..6023766d7b 100644 --- a/lib/disfavorform.php +++ b/lib/disfavorform.php @@ -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)); + } + } /** diff --git a/lib/favorform.php b/lib/favorform.php index 625df7c8b5..4e2891ffd5 100644 --- a/lib/favorform.php +++ b/lib/favorform.php @@ -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)); + } } /** -- 2.39.5