00001 <?php
00002
00015
00016
00017 class GatewayPlugin extends Plugin {
00018 function GatewayPlugin() {
00019 parent::Plugin();
00020 }
00021
00027 function getName() {
00028
00029 return 'GatewayPlugin';
00030 }
00031
00037 function getDisplayName() {
00038
00039
00040 return 'Abstract Gateway Plugin';
00041 }
00042
00046 function getDescription() {
00047 return 'This is the GatewayPlugin base class. Its functions can be overridden by subclasses to provide import/export functionality for various formats.';
00048 }
00049
00053 function smartyPluginUrl($params, &$smarty) {
00054 $path = array($this->getCategory(), $this->getName());
00055 if (is_array($params['path'])) {
00056 $params['path'] = array_merge($path, $params['path']);
00057 } elseif (!empty($params['path'])) {
00058 $params['path'] = array_merge($path, array($params['path']));
00059 } else {
00060 $params['path'] = $path;
00061 }
00062 return $smarty->smartyUrl($params, $smarty);
00063 }
00064
00068 function getManagementVerbs() {
00069 $verbs = array();
00070 if ($this->getEnabled()) {
00071 $verbs[] = array(
00072 'disable',
00073 __('manager.plugins.disable')
00074 );
00075 } else {
00076 $verbs[] = array(
00077 'enable',
00078 __('manager.plugins.enable')
00079 );
00080 }
00081 return $verbs;
00082 }
00083
00087 function getEnabled() {
00088 $conference =& Request::getConference();
00089 if (!$conference) return false;
00090 return $this->getSetting($conference->getId(), 0, 'enabled');
00091 }
00092
00096 function setEnabled($enabled) {
00097 $conference =& Request::getConference();
00098 if ($conference) {
00099 $this->updateSetting(
00100 $conference->getId(),
00101 0,
00102 'enabled',
00103 $enabled?true:false
00104 );
00105 return true;
00106 }
00107 return false;
00108 }
00109
00113 function manage($verb, $args) {
00114 $templateManager =& TemplateManager::getManager();
00115 $templateManager->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
00116 switch ($verb) {
00117 case 'enable': $this->setEnabled(true); break;
00118 case 'disable': $this->setEnabled(false); break;
00119 }
00120 return false;
00121 }
00122
00126 function fetch($args) {
00127
00128 return false;
00129 }
00130 }
00131 ?>