00001 <?php
00002
00016 import('plugins.Plugin');
00017
00018 class PaymethodPlugin extends Plugin {
00022 function PaymethodPlugin() {
00023 }
00024
00033 function register($category, $path) {
00034 $success = parent::register($category, $path);
00035 if ($success) {
00036 HookRegistry::register('Template::Manager::Payment::displayPaymentSettingsForm', array(&$this, '_smartyDisplayPaymentSettingsForm'));
00037 }
00038 return $success;
00039 }
00040
00047 function getName() {
00048 return 'PaymethodPlugin';
00049 }
00050
00054 function getDescription() {
00055 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.';
00056 }
00057
00061 function getTemplatePath() {
00062 return parent::getTemplatePath() . 'templates' . DIRECTORY_SEPARATOR ;
00063 }
00064
00065 function displayPaymentForm($queuedPaymentId, $key, &$queuedPayment) {
00066 die('ABSTRACT METHOD');
00067 }
00068
00069 function isConfigured() {
00070 return false;
00071 }
00072
00078 function _smartyDisplayPaymentSettingsForm($hookName, $args) {
00079 $params =& $args[0];
00080 $smarty =& $args[1];
00081 $output =& $args[2];
00082
00083 if (isset($params['plugin']) && $params['plugin'] == $this->getName()) {
00084 $output .= $this->displayPaymentSettingsForm($params, $smarty);
00085 }
00086 return false;
00087 }
00088
00089 function displayPaymentSettingsForm(&$params, &$smarty) {
00090 return $smarty->fetch($this->getTemplatePath() . 'settingsForm.tpl');
00091 }
00092
00093 function getSettingsFormFieldNames() {
00094 return array();
00095 }
00096
00101 function handle($args) {
00102
00103 Request::redirect(null, null, 'index');
00104 }
00105 }
00106
00107 ?>