Events to hook for NoticeListElement <li> generation

This commit is contained in:
Evan Prodromou 2010-12-30 16:57:05 -08:00
parent 5d7f5212f0
commit 66f6b2a342
2 changed files with 22 additions and 6 deletions

View File

@ -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 <li> of a notice list element
- $nli: The notice list item being shown
EndOpenNoticeListItemElement: After the opening <li> of a notice list element
- $nli: The notice list item being shown
StartCloseNoticeListItemElement: Before the closing </li> of a notice list element
- $nli: The notice list item being shown
EndCloseNoticeListItemElement: After the closing </li> of a notice list element
- $nli: The notice list item being shown

View File

@ -263,11 +263,12 @@ class NoticeListItem extends Widget
function showStart()
{
// XXX: RDFa
// TODO: add notice_type class e.g., notice_video, notice_image
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()
{
if (Event::handle('StartCloseNoticeListItemElement', array($this))) {
$this->out->elementEnd('li');
Event::handle('EndCloseNoticeListItemElement', array($this));
}
}
}