{
function definition()
{
- global $course;
global $CFG, $USER;
$paymentmethodsenabled = get_list_of_payment_methods();
}
$mform =& $this->_form;
+ $course = $this->_customdata['course'];
$mform->addElement('header', '', ' ' . get_string('paymentrequired'), '');
- if ($othermethodstr = other_method($paymentmethod)) {
+ if ($othermethodstr = $this->other_method_available($paymentmethod)) {
$mform->addElement('static', '', '<div align="right">' . $othermethodstr . ' </div>', '');
}
return (empty($errors) ? true : $errors);
}
-}
-
-function other_method($currentmethod)
-{
- global $course;
+ function other_method_available($currentmethod)
+ {
+ $course = $this->_customdata['course'];
- if ($currentmethod == AN_METHOD_CC) {
- $otheravailable = in_array(AN_METHOD_ECHECK, get_list_of_payment_methods());
- $url = 'enrol.php?id='.$course->id.'&paymentmethod='.AN_METHOD_ECHECK;
- $stringtofetch = 'usingecheckmethod';
- }
- else {
- $otheravailable = in_array(AN_METHOD_CC, get_list_of_payment_methods());
- $url = 'enrol.php?id='.$course->id.'&paymentmethod='.AN_METHOD_CC;
- $stringtofetch = 'usingccmethod';
- }
- if ($otheravailable) {
- $a = new stdClass;
- $a->url = $url;
- return get_string($stringtofetch, "enrol_authorize", $a);
- }
- else {
- return '';
+ if ($currentmethod == AN_METHOD_CC) {
+ $otheravailable = in_array(AN_METHOD_ECHECK, get_list_of_payment_methods());
+ $url = 'enrol.php?id='.$course->id.'&paymentmethod='.AN_METHOD_ECHECK;
+ $stringtofetch = 'usingecheckmethod';
+ }
+ else {
+ $otheravailable = in_array(AN_METHOD_CC, get_list_of_payment_methods());
+ $url = 'enrol.php?id='.$course->id.'&paymentmethod='.AN_METHOD_CC;
+ $stringtofetch = 'usingccmethod';
+ }
+ if ($otheravailable) {
+ $a = new stdClass;
+ $a->url = $url;
+ return get_string($stringtofetch, "enrol_authorize", $a);
+ }
+ else {
+ return '';
+ }
}
+
}
+
function ABAVal($aba)
{
if (ereg("^[0-9]{9}$", $aba)) {