From: Evan Prodromou Date: Fri, 31 Dec 2010 00:57:05 +0000 (-0800) Subject: Events to hook for NoticeListElement
  • generation X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=66f6b2a3427212de020694cde1385eeb44f1ccd6;p=quix0rs-gnu-social.git Events to hook for NoticeListElement
  • generation --- diff --git a/EVENTS.txt b/EVENTS.txt index f7cc7df67c..6719ba737a 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1045,3 +1045,15 @@ StartProfileSettingsActions: when we're showing account-management action list EndProfileSettingsActions: when we're showing account-management action list - $action: Action being shown (use for output) + +StartOpenNoticeListItemElement: Before the opening
  • of a notice list element +- $nli: The notice list item being shown + +EndOpenNoticeListItemElement: After the opening
  • of a notice list element +- $nli: The notice list item being shown + +StartCloseNoticeListItemElement: Before the closing
  • of a notice list element +- $nli: The notice list item being shown + +EndCloseNoticeListItemElement: After the closing of a notice list element +- $nli: The notice list item being shown diff --git a/lib/noticelist.php b/lib/noticelist.php index c6f964662f..7b2fbb1e7c 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -263,11 +263,12 @@ class NoticeListItem extends Widget function showStart() { - // XXX: RDFa - // TODO: add notice_type class e.g., notice_video, notice_image - $id = (empty($this->repeat)) ? $this->notice->id : $this->repeat->id; - $this->out->elementStart('li', array('class' => 'hentry notice', - 'id' => 'notice-' . $id)); + if (Event::handle('StartOpenNoticeListItemElement', array($this))) { + $id = (empty($this->repeat)) ? $this->notice->id : $this->repeat->id; + $this->out->elementStart('li', array('class' => 'hentry notice', + 'id' => 'notice-' . $id)); + Event::handle('EndOpenNoticeListItemElement', array($this)); + } } /** @@ -706,6 +707,9 @@ class NoticeListItem extends Widget function showEnd() { - $this->out->elementEnd('li'); + if (Event::handle('StartCloseNoticeListItemElement', array($this))) { + $this->out->elementEnd('li'); + Event::handle('EndCloseNoticeListItemElement', array($this)); + } } }