Open Journal Systems  3.3.0
GatewayPlugin.inc.php
1 <?php
2 
16 import('lib.pkp.classes.plugins.Plugin');
17 
18 abstract class GatewayPlugin extends Plugin {
19 
25  abstract function fetch($args, $request);
26 
31  function getCanEnable() {
32  return true;
33  }
34 
39  function getCanDisable() {
40  return true;
41  }
42 
47  function getEnabled() {
48  return $this->getSetting($this->getCurrentContextId(), 'enabled');
49  }
50 
55  function setEnabled($enabled) {
56  $this->updateSetting($this->getCurrentContextId(), 'enabled', $enabled, 'bool');
57  }
58 
63  function getCurrentContextId() {
64  $context = Application::get()->getRequest()->getContext();
65  return is_null($context) ? 0 : $context->getId();
66  }
67 
74  function getPolicies($request) {
75  return array();
76  }
77 
78 }
GatewayPlugin\setEnabled
setEnabled($enabled)
Definition: GatewayPlugin.inc.php:55
Plugin\updateSetting
updateSetting($contextId, $name, $value, $type=null)
Definition: Plugin.inc.php:495
GatewayPlugin\fetch
fetch($args, $request)
GatewayPlugin\getEnabled
getEnabled()
Definition: GatewayPlugin.inc.php:47
GatewayPlugin\getCanDisable
getCanDisable()
Definition: GatewayPlugin.inc.php:39
Plugin\getSetting
getSetting($contextId, $name)
Definition: Plugin.inc.php:473
GatewayPlugin\getCanEnable
getCanEnable()
Definition: GatewayPlugin.inc.php:31
GatewayPlugin\getCurrentContextId
getCurrentContextId()
Definition: GatewayPlugin.inc.php:63
Plugin
Abstract class for plugins.
Definition: Plugin.inc.php:51
Plugin\$request
$request
Definition: Plugin.inc.php:68
GatewayPlugin\getPolicies
getPolicies($request)
Definition: GatewayPlugin.inc.php:74
PKPApplication\get
static get()
Definition: PKPApplication.inc.php:235
GatewayPlugin
Abstract class for gateway plugins.
Definition: GatewayPlugin.inc.php:18