From d3d9913be062c974e3ae721c0cbf5c5ad2cbfce8 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Fri, 25 Sep 2009 12:47:14 +0000 Subject: Added hook for notice item. After
  • and Before
  • . Allows authors to include aside data to their notice items --- lib/noticelist.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/noticelist.php') diff --git a/lib/noticelist.php b/lib/noticelist.php index d4cd3ff6e..c2ff7c26b 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -178,9 +178,12 @@ class NoticeListItem extends Widget function show() { $this->showStart(); - $this->showNotice(); - $this->showNoticeInfo(); - $this->showNoticeOptions(); + if (Event::handle('StartShowNoticeItem', array($this))) { + $this->showNotice(); + $this->showNoticeInfo(); + $this->showNoticeOptions(); + Event::handle('EndShowNoticeItem', array($this)); + } $this->showEnd(); } -- cgit v1.2.3-54-g00ecf From ee236e68df8a8b7ee7917fd60ef36b57c0bd64db Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 27 Sep 2009 21:05:29 -0400 Subject: show delete button when user has deleteOthersNotice right --- lib/noticelist.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/noticelist.php') diff --git a/lib/noticelist.php b/lib/noticelist.php index c2ff7c26b..6c296f82a 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -472,7 +472,10 @@ class NoticeListItem extends Widget function showDeleteLink() { $user = common_current_user(); - if ($user && $this->notice->profile_id == $user->id) { + + if (!empty($user) && + ($this->notice->profile_id == $user->id || $user->hasRight(Right::deleteOthersNotice))) { + $deleteurl = common_local_url('deletenotice', array('notice' => $this->notice->id)); $this->out->element('a', array('href' => $deleteurl, -- cgit v1.2.3-54-g00ecf