00001 <?php
00002
00016 import('plugins.Plugin');
00017
00018 class PaymethodPlugin extends Plugin {
00022 function PaymethodPlugin() {
00023 parent::Plugin();
00024 }
00025
00034 function register($category, $path) {
00035 $success = parent::register($category, $path);
00036 if ($success) {
00037 HookRegistry::register('Template::Manager::Payment::displayPaymentSettingsForm', array(&$this, '_smartyDisplayPaymentSettingsForm'));
00038 }
00039 return $success;
00040 }
00041
00048 function getName() {
00049 return 'PaymethodPlugin';
00050 }
00051
00055 function getDescription() {
00056 return 'This is the base payment method plugin class. It contains no concrete implementation. Its functions must be overridden by subclasses to provide actual functionality.';
00057 }
00058
00062 function getTemplatePath() {
00063 return parent::getTemplatePath() . 'templates' . DIRECTORY_SEPARATOR ;
00064 }
00065
00066 function displayPaymentForm($queuedPaymentId, $key, &$queuedPayment) {
00067 die('ABSTRACT METHOD');
00068 }
00069
00070 function isConfigured() {
00071 return false;
00072 }
00073
00079 function _smartyDisplayPaymentSettingsForm($hookName, $args) {
00080 $params =& $args[0];
00081 $smarty =& $args[1];
00082 $output =& $args[2];
00083
00084 if (isset($params['plugin']) && $params['plugin'] == $this->getName()) {
00085 $output .= $this->displayPaymentSettingsForm($params, $smarty);
00086 }
00087 return false;
00088 }
00089
00090 function displayPaymentSettingsForm(&$params, &$smarty) {
00091 return $smarty->fetch($this->getTemplatePath() . 'settingsForm.tpl');
00092 }
00093
00094 function getSettingsFormFieldNames() {
00095 return array();
00096 }
00097
00102 function handle($args) {
00103
00104 Request::redirect(null, null, 'index');
00105 }
00106 }
00107
00108 ?>