]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19795 Migrated calls to print_checkbox()
authornicolasconnault <nicolasconnault>
Thu, 6 Aug 2009 06:58:42 +0000 (06:58 +0000)
committernicolasconnault <nicolasconnault>
Thu, 6 Aug 2009 06:58:42 +0000 (06:58 +0000)
enrol/authorize/config_form.php
enrol/authorize/locallib.php

index 99fadf94a5ecd34b9122783107668680cac6d72d..b6dbab78fb01d4c863ec3205a0d7e143c12cd4c3 100755 (executable)
@@ -96,7 +96,7 @@ if (!isset($frm->acceptechecktypes)) {
 
 <tr valign="top">
     <td align="right">delete_current:</td>
-    <td><?php print_checkbox('delete_current', '1', !empty($frm->delete_current)) ?> <br />
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->delete_current)), 'delete_current');?> <br />
         <?php print_string("deletecheck", "moodle", get_string('oldpassword')) ?><br /><hr /></td>
 </tr>
 
@@ -108,7 +108,7 @@ if (!isset($frm->acceptechecktypes)) {
 
 <tr valign="top">
     <td align="right">an_cutoff:</td>
-    <td><?php 
+    <td><?php
         $curtime = make_timestamp(2000,1,1,$frm->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)) {
 
 <tr valign="top">
     <td align="right">an_avs:</td>
-    <td><?php print_checkbox('an_avs', '1', !empty($frm->an_avs)) ?><br />
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_avs)), 'an_avs'); ?><br />
         <?php print_string("adminavs", "enrol_authorize") ?></td>
 </tr>
 
 <tr valign="top">
     <td align="right">an_authcode:</td>
-    <td><?php print_checkbox('an_authcode', '1', !empty($frm->an_authcode)) ?>
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_authcode)), 'an_authcode');  ?>
         <?php helpbutton('authcode', 'authcode', 'enrol/authorize'); ?><br />
         <?php print_string("adminauthcode", "enrol_authorize") ?></td>
 </tr>
 
 <tr valign="top">
     <td align="right">an_test:</td>
-    <td><?php print_checkbox('an_test', '1', !empty($frm->an_test)) ?><br />
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_test)), 'an_test');  ?><br />
         <?php print_string("antestmode", "enrol_authorize") ?></td>
 </tr>
 
@@ -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("<ul>"); // blockquote breaks <span> and <br> tags
             $acceptedccs = array_keys(get_list_of_creditcards());
             $allccs = get_list_of_creditcards(true);
             foreach ($allccs as $key => $val) {
                 echo "<li>";
-                print_checkbox('acceptccs[]', $key, in_array($key, $acceptedccs), $val);
+                echo $OUTPUT->checkbox(html_select_option::make_checkbox($key, in_array($key, $acceptedccs), $val), 'acceptccs[]');
                 echo "</li>";
             }
             echo("</ul>");
         }
         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("<ul>"); // blockquote breaks <span> and <br> tags
             $echecktypesenabled = get_list_of_bank_account_types();
             $allechecktypes = get_list_of_bank_account_types(true);
             foreach ($allechecktypes as $key) {
                 echo "<li>";
-                print_checkbox('acceptechecktypes[]', $key, in_array($key, $echecktypesenabled), get_string('echeck'.strtolower($key),'enrol_authorize'));
+                echo $OUTPUT->checkbox(html_select_option::make_checkbox($key, in_array($key, $echecktypesenabled), get_string('echeck'.strtolower($key),'enrol_authorize')), 'acceptechecktypes[]');
                 echo "</li>";
             }
             echo("</ul>");
@@ -176,7 +177,7 @@ if (!isset($frm->acceptechecktypes)) {
 
 <tr valign="top">
     <td align="right">an_review:</td>
-    <td><?php print_checkbox('an_review', '1', !empty($frm->an_review)) ?>
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_review)), 'an_review'); ?>
         <?php helpbutton('review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol/authorize'); ?><br />
         <?php print_string("adminreview", "enrol_authorize") ?></td>
 </tr>
@@ -199,7 +200,7 @@ if (!isset($frm->acceptechecktypes)) {
 
 <tr valign="top">
     <td align="right">an_emailexpiredteacher:</td>
-    <td><?php print_checkbox('an_emailexpiredteacher', '1', !empty($frm->an_emailexpiredteacher)) ?><br />
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_emailexpiredteacher)), 'an_emailexpiredteacher');  ?><br />
         <?php print_string("adminemailexpiredteacher", "enrol_authorize") ?></td>
 </tr>
 
@@ -214,19 +215,19 @@ if (!isset($frm->acceptechecktypes)) {
 
 <tr valign="top">
     <td align="right">enrol_mailstudents:</td>
-    <td><?php print_checkbox('enrol_mailstudents', '1', !empty($frm->enrol_mailstudents)) ?><br />
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailstudents)), 'enrol_mailstudents'); ?><br />
         <?php print_string("mailstudents") ?></td>
 </tr>
 
 <tr valign="top">
     <td align="right">enrol_mailteachers:</td>
-    <td><?php print_checkbox('enrol_mailteachers', '1', !empty($frm->enrol_mailteachers)) ?><br />
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailteachers)), 'enrol_mailteachers');  ?><br />
         <?php print_string("mailteachers") ?></td>
 </tr>
 
 <tr valign="top">
     <td align="right">enrol_mailadmins:</td>
-    <td><?php print_checkbox('enrol_mailadmins', '1', !empty($frm->enrol_mailadmins)) ?><br />
+    <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->enrol_mailadmins)), 'enrol_mailadmins');  ?><br />
         <?php print_string("mailadmins") ?></td>
 </tr>
 
index 4cc0b9160c4e0c8708c202a6816c785bd45498d0..95ba7bbf9c6e7f1b4329f3f2a65be42b76ffb0b4 100644 (file)
@@ -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.'&amp;course='.$courseid.'&amp;status=',$statusmenu,'statusmenu',$status,'','','',true);
     if ($canmanagepayments) {
         $popupmenu .= '<br />';
-        $popupmenu .= print_checkbox('showonlymy', '1', $userid == $USER->id, get_string('mypaymentsonly', 'enrol_authorize'), '',
-        "var locationtogo = '{$CFG->wwwroot}/enrol/authorize/index.php?status=$status';
-                                  locationtogo += '&amp;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 .= '<input type="hidden" name="confirm" value="1" />';
     }
     if (!empty($unenrol)) {
-        $ret .= print_checkbox('unenrol', '1', false, $unenrol, '', '', true) . '<br />';
+        $ret .= $OUTPUT->checkbox(html_select_option::make_checkbox(1, false, $unenrol), 'unenrol') . '<br />';
     }
     $ret .= $extrahtml;
     $ret .= '<input type="submit" value="'.$authstrs->$do.'" />' .