From: Sarven Capadisli Date: Fri, 25 Sep 2009 12:47:14 +0000 (+0000) Subject: Added hook for notice item. After
  • and Before
  • . Allows X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d3d9913be062c974e3ae721c0cbf5c5ad2cbfce8;p=quix0rs-gnu-social.git Added hook for notice item. After
  • and Before
  • . Allows authors to include aside data to their notice items --- diff --git a/EVENTS.txt b/EVENTS.txt index fa25aabcd6..74923dcc0a 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -194,6 +194,12 @@ StartShowExportData: just before showing the
    with export data (feeds) EndShowExportData: just after showing the
    with export data (feeds) - $action: action object being shown +StartShowNoticeItem: just before showing the notice item +- $action: action object being shown + +EndShowNoticeItem: just after showing the notice item +- $action: action object being shown + StartShowPageNotice: just before showing the page notice (instructions or error) - $action: action object being shown diff --git a/lib/noticelist.php b/lib/noticelist.php index d4cd3ff6e5..c2ff7c26b3 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(); }