From e738c328d1e32193a947e9af9b097b16f66ad27a Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 6 Aug 2009 06:58:42 +0000 Subject: [PATCH] MDL-19795 Migrated calls to print_checkbox() --- enrol/authorize/config_form.php | 29 +++++++++++++++-------------- enrol/authorize/locallib.php | 15 +++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/enrol/authorize/config_form.php b/enrol/authorize/config_form.php index 99fadf94a5..b6dbab78fb 100755 --- a/enrol/authorize/config_form.php +++ b/enrol/authorize/config_form.php @@ -96,7 +96,7 @@ if (!isset($frm->acceptechecktypes)) { delete_current: - delete_current)) ?>
+ checkbox(html_select_option::make_checkbox('1', !empty($frm->delete_current)), 'delete_current');?>


@@ -108,7 +108,7 @@ if (!isset($frm->acceptechecktypes)) { an_cutoff: - an_cutoff_hour,$frm->an_cutoff_min); $hourselector = moodle_select::make_time_selector('hours', 'an_cutoff_hour', $curtime); $minselector = moodle_select::make_time_selector('minutes', 'an_cutoff_min', $curtime); @@ -119,20 +119,20 @@ if (!isset($frm->acceptechecktypes)) { an_avs: - an_avs)) ?>
+ checkbox(html_select_option::make_checkbox('1', !empty($frm->an_avs)), 'an_avs'); ?>
an_authcode: - an_authcode)) ?> + checkbox(html_select_option::make_checkbox('1', !empty($frm->an_authcode)), 'an_authcode'); ?>
an_test: - an_test)) ?>
+ checkbox(html_select_option::make_checkbox('1', !empty($frm->an_test)), 'an_test'); ?>
@@ -143,25 +143,26 @@ if (!isset($frm->acceptechecktypes)) { $allpaymentmethods = get_list_of_payment_methods(true); foreach ($allpaymentmethods as $key) { if ($key == AN_METHOD_CC) { - print_checkbox('acceptmethods[]', AN_METHOD_CC, in_array(AN_METHOD_CC, $paymentmethodsenabled), get_string('method'.AN_METHOD_CC,'enrol_authorize')); + echo $OUTPUT->checkbox(html_select_option::make_checkbox(AN_METHOD_CC, in_array(AN_METHOD_CC, $paymentmethodsenabled), get_string('method'.AN_METHOD_CC,'enrol_authorize')), 'acceptmethods[]'); echo(""); } elseif ($key == AN_METHOD_ECHECK) { - print_checkbox('acceptmethods[]', AN_METHOD_ECHECK, in_array(AN_METHOD_ECHECK, $paymentmethodsenabled), get_string('method'.AN_METHOD_ECHECK,'enrol_authorize')); + $checkbox = html_select_option::make_checkbox(AN_METHOD_ECHECK, in_array(AN_METHOD_ECHECK, $paymentmethodsenabled), get_string('method'.AN_METHOD_ECHECK,'enrol_authorize')); + echo $OUTPUT->checkbox($checkbox, 'acceptmethods[]'); echo(""); @@ -176,7 +177,7 @@ if (!isset($frm->acceptechecktypes)) { an_review: - an_review)) ?> + checkbox(html_select_option::make_checkbox('1', !empty($frm->an_review)), 'an_review'); ?>
@@ -199,7 +200,7 @@ if (!isset($frm->acceptechecktypes)) { an_emailexpiredteacher: - an_emailexpiredteacher)) ?>
+ checkbox(html_select_option::make_checkbox('1', !empty($frm->an_emailexpiredteacher)), 'an_emailexpiredteacher'); ?>
@@ -214,19 +215,19 @@ if (!isset($frm->acceptechecktypes)) { enrol_mailstudents: - enrol_mailstudents)) ?>
+ checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailstudents)), 'enrol_mailstudents'); ?>
enrol_mailteachers: - enrol_mailteachers)) ?>
+ checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailteachers)), 'enrol_mailteachers'); ?>
enrol_mailadmins: - enrol_mailadmins)) ?>
+ checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailadmins)), 'enrol_mailadmins'); ?>
diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index 4cc0b9160c..95ba7bbf9c 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -13,10 +13,9 @@ define('ORDER_VOID', 'void'); * authorize_print_orders * */ -function authorize_print_orders($courseid, $userid) -{ +function authorize_print_orders($courseid, $userid) { global $course; - global $CFG, $USER, $SITE, $DB; + global $CFG, $USER, $SITE, $DB, $OUTPUT, $PAGE; global $strs, $authstrs; require_once($CFG->libdir.'/tablelib.php'); @@ -69,10 +68,10 @@ function authorize_print_orders($courseid, $userid) $popupmenu .= popup_form($baseurl.'&course='.$courseid.'&status=',$statusmenu,'statusmenu',$status,'','','',true); if ($canmanagepayments) { $popupmenu .= '
'; - $popupmenu .= print_checkbox('showonlymy', '1', $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize'), '', - "var locationtogo = '{$CFG->wwwroot}/enrol/authorize/index.php?status=$status'; - locationtogo += '&user=' + (this.checked ? '$USER->id' : '0'); - top.location.href = locationtogo;", true); + $checkbox = html_select_option::make_checkbox(1, $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize')); + $PAGE->requires->js('enrol/authorize/authorize.js'); + $checkbox->add_action('click', 'authorize_jump_to_mypayments', array('userid' => $USER->id, 'status' => $status)); + $popupmenu .= $OUTPUT->checkbox($checkbox, 'showonlymy'); } $navlinks = array(); @@ -666,7 +665,7 @@ function authorize_print_action_button($orderid, $do, $suborderid=0, $confirm=fa $ret .= ''; } if (!empty($unenrol)) { - $ret .= print_checkbox('unenrol', '1', false, $unenrol, '', '', true) . '
'; + $ret .= $OUTPUT->checkbox(html_select_option::make_checkbox(1, false, $unenrol), 'unenrol') . '
'; } $ret .= $extrahtml; $ret .= '' . -- 2.39.5