forked from GNUsocial/gnu-social
Rewriting code for notice representation
Getting rid of NoticeListItemAdapter, putting more into ActivityHandlerPlugin and relying on plugins to handle rendering code of the content. This gives us a lot more structure and consistency in notice structure and allows activity plugins to stop rendering certain kinds of notices more easily. There should also be a property for an ActivityHandlerPlugin class to avoid rendering notices in the ordinary stream, so we don't have to overload stuff.
This commit is contained in:
@@ -239,39 +239,6 @@ class BookmarkPlugin extends MicroAppPlugin
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output our CSS class for bookmark notice list elements
|
||||
*
|
||||
* @param NoticeListItem $nli The item being shown
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onStartOpenNoticeListItemElement($nli)
|
||||
{
|
||||
if (!$this->isMyNotice($nli->notice)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$nb = Bookmark::getByNotice($nli->notice);
|
||||
|
||||
if (empty($nb)) {
|
||||
$this->log(LOG_INFO, "Notice {$nli->notice->id} has bookmark class but no matching Bookmark record.");
|
||||
return true;
|
||||
}
|
||||
|
||||
$id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id;
|
||||
$class = 'h-entry notice bookmark';
|
||||
if ($nli->notice->scope != 0 && $nli->notice->scope != 1) {
|
||||
$class .= ' limited-scope';
|
||||
}
|
||||
$nli->out->elementStart('li', array('class' => $class,
|
||||
'id' => 'notice-' . $id));
|
||||
|
||||
Event::handle('EndOpenNoticeListItemElement', array($nli));
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify the default menu to link to our custom action
|
||||
*
|
||||
|
Reference in New Issue
Block a user