forked from GNUsocial/gnu-social
Events for showing the 'tail' of a threaded notice
This commit is contained in:
parent
8aacc4b84a
commit
4d0f42aea2
22
EVENTS.txt
22
EVENTS.txt
@ -1162,4 +1162,24 @@ StartShowGroupProfileBlock: When showing the profile block for a group
|
|||||||
|
|
||||||
EndShowGroupProfileBlock: After showing showing the profile block for a group
|
EndShowGroupProfileBlock: After showing showing the profile block for a group
|
||||||
- $out: XMLOutputter to append custom output
|
- $out: XMLOutputter to append custom output
|
||||||
- $group: the group being shown
|
- $group: the group being shown
|
||||||
|
|
||||||
|
StartShowThreadedNoticeTail: when showing the replies etc. to a notice
|
||||||
|
- $nli: parent noticelistitem
|
||||||
|
- $notice: parent notice
|
||||||
|
- &$children: list of children
|
||||||
|
|
||||||
|
EndShowThreadedNoticeTail: when showing the replies etc. to a notice
|
||||||
|
- $nli: parent noticelistitem
|
||||||
|
- $notice: parent notice
|
||||||
|
- $children: list of children
|
||||||
|
|
||||||
|
StartShowThreadedNoticeSub: when showing a reply to a notice
|
||||||
|
- $nli: parent noticelistitem
|
||||||
|
- $parent: parent notice
|
||||||
|
- $child: child notice
|
||||||
|
|
||||||
|
EndShowThreadedNoticeSub: when showing a reply to a notice
|
||||||
|
- $nli: parent noticelistitem
|
||||||
|
- $parent: parent notice
|
||||||
|
- $child: child notice
|
||||||
|
@ -185,33 +185,40 @@ class ThreadedNoticeListItem extends NoticeListItem
|
|||||||
$notices[] = clone($notice); // *grumble* inefficient as hell
|
$notices[] = clone($notice); // *grumble* inefficient as hell
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out->elementStart('ul', 'notices threaded-replies xoxo');
|
if (Event::handle('StartShowThreadedNoticeTail', array($this, $this->notice, &$notices))) {
|
||||||
|
$this->out->elementStart('ul', 'notices threaded-replies xoxo');
|
||||||
|
|
||||||
$item = new ThreadedNoticeListFavesItem($this->notice, $this->out);
|
$item = new ThreadedNoticeListFavesItem($this->notice, $this->out);
|
||||||
$hasFaves = $item->show();
|
$hasFaves = $item->show();
|
||||||
|
|
||||||
$item = new ThreadedNoticeListRepeatsItem($this->notice, $this->out);
|
$item = new ThreadedNoticeListRepeatsItem($this->notice, $this->out);
|
||||||
$hasRepeats = $item->show();
|
$hasRepeats = $item->show();
|
||||||
|
|
||||||
if ($notices) {
|
if ($notices) {
|
||||||
if ($moreCutoff) {
|
if ($moreCutoff) {
|
||||||
$item = new ThreadedNoticeListMoreItem($moreCutoff, $this->out);
|
$item = new ThreadedNoticeListMoreItem($moreCutoff, $this->out);
|
||||||
$item->show();
|
$item->show();
|
||||||
|
}
|
||||||
|
foreach (array_reverse($notices) as $notice) {
|
||||||
|
if (Event::handle('StartShowThreadedNoticeSub', array($this, $this->notice, $notice))) {
|
||||||
|
$item = new ThreadedNoticeListSubItem($notice, $this->out);
|
||||||
|
$item->show();
|
||||||
|
Event::handle('StartShowThreadedNoticeSub', array($this, $this->notice, $notice));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (array_reverse($notices) as $notice) {
|
|
||||||
$item = new ThreadedNoticeListSubItem($notice, $this->out);
|
if ($notices || $hasFaves || $hasRepeats) {
|
||||||
$item->show();
|
// @fixme do a proper can-post check that's consistent
|
||||||
|
// with the JS side
|
||||||
|
if (common_current_user()) {
|
||||||
|
$item = new ThreadedNoticeListReplyItem($this->notice, $this->out);
|
||||||
|
$item->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$this->out->elementEnd('ul');
|
||||||
|
Event::handle('EndShowThreadedNoticeTail', array($this, $this->notice, $notices));
|
||||||
}
|
}
|
||||||
if ($notices || $hasFaves || $hasRepeats) {
|
|
||||||
// @fixme do a proper can-post check that's consistent
|
|
||||||
// with the JS side
|
|
||||||
if (common_current_user()) {
|
|
||||||
$item = new ThreadedNoticeListReplyItem($this->notice, $this->out);
|
|
||||||
$item->show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->out->elementEnd('ul');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::showEnd();
|
parent::showEnd();
|
||||||
|
Loading…
Reference in New Issue
Block a user