From: Mikael Nordfeldth Date: Sun, 26 Oct 2014 20:41:04 +0000 (+0100) Subject: Adding event StartShowNoticeItemNotice with corresponding End X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9f8761f709d29329e608368abc16d673c123bdc0;p=quix0rs-gnu-social.git Adding event StartShowNoticeItemNotice with corresponding End Runs just before outputting the "top" part of a NoticeListItem to HTML so plugins can jump in and do their thing. --- diff --git a/EVENTS.txt b/EVENTS.txt index 255869afda..e70dae6930 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -257,6 +257,22 @@ StartShowNoticeItem: just before showing the notice item EndShowNoticeItem: just after showing the notice item - $item: the NoticeListItem object being shown +StartShowNoticeItemNotice: just before outputting the "top" notice part of a NoticeListItem to HTML +- $item: The NoticeListItem object being shown + +EndShowNoticeItemNotice: just after outputting the "top" notice part of a NoticeListItem to HTML +- $item: The NoticeListItem object being shown + +StartShowNoticeContent: just before outputting the content part of a Notice +- $stored: The Notice object +- $out: HTMLOutputter for writing to +- $scoped: optional Profile object for permission scoping + +EndShowNoticeContent: just after outputting the content part of a Notice, plugins must call this manually +- $stored: The Notice object +- $out: HTMLOutputter for writing to +- $scoped: optional Profile object for permission scoping + StartShowNoticeInfo: just before showing notice info - $item: The NoticeListItem object being shown diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index 57207339a9..5ba4a5d683 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -113,10 +113,13 @@ class NoticeListItem extends Widget function showNotice() { - $this->showNoticeTitle(); - $this->showAuthor(); - $this->showAddressees(); - $this->showContent(); + if (Event::handle('StartShowNoticeItemNotice', array($this))) { + $this->showNoticeTitle(); + $this->showAuthor(); + $this->showAddressees(); + $this->showContent(); + Event::handle('EndShowNoticeItemNotice', array($this-)); + } } function showNoticeTitle()