Custom list item for join events

This commit is contained in:
Evan Prodromou
2011-08-23 11:49:27 -04:00
parent 5c3bc19968
commit eed5192405
2 changed files with 115 additions and 1 deletions

View File

@@ -63,6 +63,9 @@ class ActivityPlugin extends Plugin
switch ($cls)
{
case 'JoinListItem':
include_once $dir . '/'.strtolower($cls).'.php';
return false;
default:
return true;
}
@@ -274,13 +277,35 @@ class ActivityPlugin extends Plugin
'object_type' => ActivityObject::GROUP));
return true;
}
function onStartShowNoticeItem($nli)
{
$notice = $nli->notice;
$adapter = null;
switch ($notice->verb) {
case ActivityVerb::JOIN:
$adapter = new JoinListItem($nli);
break;
}
if (!empty($adapter)) {
$adapter->showNotice();
$adapter->showNoticeAttachments();
$adapter->showNoticeInfo();
$adapter->showNoticeOptions();
return false;
}
return true;
}
function onEndNoticeAsActivity($notice, &$activity)
{
return true;
}
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'Activity',