. */ if (!defined('GNUSOCIAL')) { exit(1); } /** * @package Activity * @maintainer Mikael Nordfeldth */ abstract class ActivityVerbHandlerModule extends ActivityHandlerModule { public function onActivityVerbTitle(ManagedAction $action, $verb, Notice $target, Profile $scoped, &$title) { if (!$this->isMyVerb($verb)) { return true; } $title = $this->getActionTitle($action, $verb, $target, $scoped); return false; } abstract protected function getActionTitle(ManagedAction $action, $verb, Notice $target, Profile $scoped); public function onActivityVerbShowContent(ManagedAction $action, $verb, Notice $target, Profile $scoped) { if (!$this->isMyVerb($verb)) { return true; } return $this->showActionContent($action, $verb, $target, $scoped); } protected function showActionContent(ManagedAction $action, $verb, Notice $target, Profile $scoped) { if (!GNUsocial::isAjax()) { $nl = new NoticeListItem($target, $action, array('options'=>false, 'attachments'=>false, 'item_tag'=>'div', 'id_prefix'=>'fave')); $nl->show(); } $form = $this->getActivityForm($action, $verb, $target, $scoped); $form->show(); return false; } public function onActivityVerbDoPreparation(ManagedAction $action, $verb, Notice $target, Profile $scoped) { if (!$this->isMyVerb($verb)) { return true; } return $this->doActionPreparation($action, $verb, $target, $scoped); } abstract protected function doActionPreparation(ManagedAction $action, $verb, Notice $target, Profile $scoped); public function onActivityVerbDoPost(ManagedAction $action, $verb, Notice $target, Profile $scoped) { if (!$this->isMyVerb($verb)) { return true; } return $this->doActionPost($action, $verb, $target, $scoped); } abstract protected function doActionPost(ManagedAction $action, $verb, Notice $target, Profile $scoped); abstract protected function getActivityForm(ManagedAction $action, $verb, Notice $target, Profile $scoped); }