1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- abstract class ActivityVerbHandlerPlugin extends ActivityHandlerPlugin
- {
- 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);
- }
|