From dbae9ea11b86eb7abd4f39d23ed3bc3f061f2a17 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 8 Mar 2012 06:58:45 -0600 Subject: [PATCH] new event for notice option items --- EVENTS.txt | 5 +++++ lib/noticelistitem.php | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index 8358bed0b7..5fb775c765 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1425,3 +1425,8 @@ EndUpgrade: when ending a site upgrade; good place to do your own upgrades HaveIMPlugin: is there an IM plugin loaded? - &$haveIMPlugin: set me to true if you're loaded! +StartShowNoticeOptionItems: Before showing first controls in a notice list item; inside the div +- $nli: NoticeListItem being shown + +EndShowNoticeOptionItems: After showing last controls in a notice list item; inside the div +- $nli: NoticeListItem being shown diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index ef7fc0d1e6..d045f00342 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -144,10 +144,13 @@ class NoticeListItem extends Widget $user = common_current_user(); if ($user) { $this->out->elementStart('div', 'notice-options'); - $this->showFaveForm(); - $this->showReplyLink(); - $this->showRepeatForm(); - $this->showDeleteLink(); + if (Event::handle('StartShowNoticeOptionItems', array($this))) { + $this->showFaveForm(); + $this->showReplyLink(); + $this->showRepeatForm(); + $this->showDeleteLink(); + Event::handle('EndShowNoticeOptionItems', array($this)); + } $this->out->elementEnd('div'); } Event::handle('EndShowNoticeOptions', array($this)); -- 2.39.5