]> git.mjollnir.org Git - moodle.git/commitdiff
Better handling of forms and configs.
authorethem <ethem>
Sat, 2 Sep 2006 12:37:01 +0000 (12:37 +0000)
committerethem <ethem>
Sat, 2 Sep 2006 12:37:01 +0000 (12:37 +0000)
enrol/authorize/config.html
enrol/authorize/enrol.html

index 978de40ea141181f02d9ab489066d13dc7f8a3a5..f7befc65d8cbdcfc45bc8c71782a79fff71c35f8 100755 (executable)
@@ -133,10 +133,10 @@ if (!isset($frm->acceptccs)) {
 <tr valign="top">
     <td align="right">an_acceptmethods:</td>
     <td><?php print_string("adminacceptmethods", "enrol_authorize") ?><br /><?php
-    $allpaymentmethods = get_list_of_payment_methods(true);
     $paymentmethodsenabled = get_list_of_payment_methods();
+    $allpaymentmethods = get_list_of_payment_methods(true);
     foreach ($allpaymentmethods as $key) {
-        print_checkbox('acceptmethods[]', $key, in_array($key, $paymentmethodsenabled), get_string('method'.strtolower($key),'enrol_authorize')); echo "<br />\n";
+        print_checkbox('acceptmethods[]', $key, in_array($key, $paymentmethodsenabled), get_string('method'.$key,'enrol_authorize')); echo "<br />\n";
     }
     ?><br /></td>
 </tr>
@@ -144,9 +144,10 @@ if (!isset($frm->acceptccs)) {
 <tr valign="top">
     <td align="right">an_acceptccs:</td>
     <td><?php print_string("adminacceptccs", "enrol_authorize") ?><br /><?php
+    $acceptedccs = array_keys(get_list_of_creditcards());
     $allccs = get_list_of_creditcards(true);
     foreach ($allccs as $key => $val) {
-        print_checkbox('acceptccs[]', $key, stristr($CFG->an_acceptccs, $key) !== false, $val); echo "<br />\n";
+        print_checkbox('acceptccs[]', $key, in_array($key, $acceptedccs), $val); echo "<br />\n";
     }
     ?><br /></td>
 </tr>
index ecc01beef16ae9f1ffe557b0f4ad9bbe616e42ce..71886dd862f3d9da49f2cb000c7358bd3bc88fec 100755 (executable)
@@ -32,7 +32,7 @@ function print_cc_form($classreference)
     global $CFG, $USER;
 
     $formvars = array(
-        'password', 'ccaddress', 'cccity', 'ccstate', 'cccountry', 'cczip',
+        'ccaddress', 'cccity', 'ccstate', 'cccountry', 'cczip',
         'ccfirstname', 'cclastname', 'cc', 'ccexpiremm', 'ccexpireyyyy', 'cctype', 'cvv'
     );
     foreach ($formvars as $var) {
@@ -147,7 +147,7 @@ function print_echeck_form($classreference)
         global $form, $course;
         global $CFG, $USER;
 
-        $formvars = array('password', 'abacode', 'accnum', 'acctype', 'bankname', 'firstname', 'lastname');
+        $formvars = array('abacode', 'accnum', 'acctype', 'bankname', 'firstname', 'lastname');
         foreach ($formvars as $var) {
             if (!isset($form->$var)) {
                 $form->$var = '';