From 527d142c438360c91fb56f99e1ce27c2cd85d64f Mon Sep 17 00:00:00 2001 From: ethem Date: Thu, 18 May 2006 07:55:12 +0000 Subject: [PATCH] I have just found a cute function called print_checkbox. :) --- enrol/authorize/config.html | 25 +++++++++++-------------- enrol/authorize/locallib.php | 17 +++++++---------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/enrol/authorize/config.html b/enrol/authorize/config.html index ab7cb8fc4f..3c3e792b1b 100755 --- a/enrol/authorize/config.html +++ b/enrol/authorize/config.html @@ -21,9 +21,9 @@ if (isset($CFG->an_cutoff)) { $frm->an_cutoff_hour = intval($CFG->an_cutoff) / 60; $frm->an_cutoff_min = intval($CFG->an_cutoff) % 60; } - if (!isset($frm->an_cutoff_hour)) $frm->an_cutoff_hour = '0'; if (!isset($frm->an_cutoff_min)) $frm->an_cutoff_min = '5'; + if (!isset($frm->acceptccs)) { $frm->acceptccs = array_keys(get_list_of_creditcards()); $CFG->an_acceptccs = implode(',', $frm->acceptccs); @@ -90,25 +90,22 @@ if (!isset($frm->acceptccs)) { an_avs: - an_avs)) echo "checked=\"true\"" ?> /> + an_avs)) ?> an_test: - an_test)) echo "checked=\"true\"" ?> /> + an_test)) ?> an_acceptccs: $val) { - echo 'an_acceptccs, $key) !== false) { - echo ' checked="checked"'; - } - echo " /> $val
\n"; + $allccs = get_list_of_creditcards(true); + foreach ($allccs as $key => $val) { + print_checkbox('acceptccs[]', $key, stristr($CFG->an_acceptccs, $key) !== false, $val); echo "
\n"; } ?> @@ -124,13 +121,13 @@ if (!isset($frm->acceptccs)) { an_teachermanagepay: - an_teachermanagepay)) echo "checked=\"true\"" ?> /> + an_teachermanagepay)) ?> an_review: - an_review)) echo "checked=\"true\"" ?> /> + an_review)) ?> @@ -152,19 +149,19 @@ if (!isset($frm->acceptccs)) { enrol_mailstudents: - enrol_mailstudents)) echo "checked=\"true\"" ?> /> + enrol_mailstudents)) ?> enrol_mailteachers: - enrol_mailteachers)) echo "checked=\"true\"" ?> /> + enrol_mailteachers)) ?> enrol_mailadmins: - enrol_mailadmins)) echo "checked=\"true\"" ?> /> + enrol_mailadmins)) ?> diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index 72e25d2869..6565991136 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -188,7 +188,7 @@ function authorize_print_order_details($orderno) echo "
\n"; echo "\n"; - echo ""; + echo ""; $settled = settled($order); $status = authorize_get_status_action($order); @@ -280,8 +280,8 @@ function authorize_print_order_details($orderno) if (($amount > $upto) || empty($confirm)) { $a->upto = $upto; $strcanbecredit = get_string('canbecredit', 'enrol_authorize', $a); - $table->data[] = array("$authstrs->unenrolstudent", - ""); + $cbunenrol = print_checkbox('unenrol', 'y', !empty($unenrol), '', '', '', true); + $table->data[] = array("$authstrs->unenrolstudent", $cbunenrol); $table->data[] = array("$authstrs->howmuch", " @@ -373,10 +373,8 @@ function authorize_print_order_details($orderno) $a->transid = $suborder->transid; $a->amount = $suborder->amount; $strsubvoidyes = get_string('subvoidyes', 'enrol_authorize', $a); - - $table->data[] = array("$authstrs->unenrolstudent", - ""); - + $cbunenrol = print_checkbox('unenrol', 'y', !empty($unenrol), '', '', '', true); + $table->data[] = array("$authstrs->unenrolstudent", $cbunenrol); $table->data[] = array("$strs->confirm:", "$strsubvoidyes
@@ -415,9 +413,8 @@ function authorize_print_order_details($orderno) error(get_string('youcantdo', 'enrol_authorize', $a)); } if (empty($confirm)) { - $table->data[] = array("$authstrs->unenrolstudent", - ""); - + $cbunenrol = print_checkbox('unenrol', 'y', !empty($unenrol), '', '', '', true); + $table->data[] = array("$authstrs->unenrolstudent", $cbunenrol); $table->data[] = array("$strs->confirm:", " -- 2.39.5