From 7d50e687b950d207d497927105abe68f321d9be7 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 20 Aug 2009 08:40:32 +0000 Subject: [PATCH] MDL-19795 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno --- enrol/authorize/enrol.php | 12 ++++++------ enrol/authorize/locallib.php | 18 +++++++++--------- enrol/manual/enrol.html | 2 +- enrol/manual/enrol.php | 5 ++--- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 08491e7b38..b6eff1f84c 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -315,13 +315,13 @@ class enrolment_plugin_authorize load_all_capabilities(); - $OUTPUT->box_start('generalbox notice'); + echo $OUTPUT->box_start('generalbox notice'); echo '

'. get_string('paymentthanks', 'moodle', $course->fullname) .'

'; - echo '
'; - print_single_button("$CFG->wwwroot/enrol/authorize/index.php", array('order'=>$order->id), get_string('payments')); - print_single_button("$CFG->wwwroot/course/view.php", array('id'=>$course->id), $course->fullname); - echo '
'; - $OUTPUT->box_end(); + echo $OUTPUT->container_start('buttons'); + echo $OUTPUT->button(html_form::make_button("$CFG->wwwroot/enrol/authorize/index.php", array('order'=>$order->id), get_string('payments'))); + echo $OUTPUT->button(html_form::make_button("$CFG->wwwroot/course/view.php", array('id'=>$course->id), $course->fullname)); + echo $OUTPUT->container_end(); + echo $OUTPUT->box_end(); echo $OUTPUT->footer(); exit; // break; } diff --git a/enrol/authorize/locallib.php b/enrol/authorize/locallib.php index 14dae45f56..057dc2171a 100644 --- a/enrol/authorize/locallib.php +++ b/enrol/authorize/locallib.php @@ -274,7 +274,7 @@ function authorize_print_order($orderid) $navigation = build_navigation($navlinks); print_header("$course->shortname: $authstrs->paymentmanagement", $authstrs->orderdetails, $navigation, '', '', false, $buttons); - $table = new stdClass; + $table = new html_table(); $table->width = '100%'; $table->size = array('30%', '70%'); $table->align = array('right', 'left'); @@ -322,7 +322,7 @@ function authorize_print_order($orderid) } $table->data[] = array("$strs->confirm:", get_string('captureyes', 'enrol_authorize') . '
' . authorize_print_action_button($orderid, ORDER_CAPTURE, 0, true, false, $strs->no)); - print_table($table); + echo $OUTPUT->table($table); } elseif (ORDER_REFUND == $do && in_array(ORDER_REFUND, $statusandactions->actions)) { $refunded = 0.0; @@ -377,7 +377,7 @@ function authorize_print_order($orderid) get_string('canbecredit', 'enrol_authorize', $a) . '
'; $table->data[] = array("$strs->confirm:", authorize_print_action_button($orderid, ORDER_REFUND, 0, true, $authstrs->unenrolstudent, $strs->no, $extrahtml)); - print_table($table); + echo $OUTPUT->table($table); } elseif (ORDER_DELETE == $do && in_array(ORDER_DELETE, $statusandactions->actions)) { if ($confirm && confirm_sesskey()) { @@ -389,7 +389,7 @@ function authorize_print_order($orderid) } $table->data[] = array("$strs->confirm:", authorize_print_action_button($orderid, ORDER_DELETE, 0, true, $authstrs->unenrolstudent,$strs->no)); - print_table($table); + echo $OUTPUT->table($table); } elseif (ORDER_VOID == $do) { // special case: cancel original or refunded transaction? $suborderid = optional_param('suborder', 0, PARAM_INT); @@ -411,7 +411,7 @@ function authorize_print_order($orderid) } $table->data[] = array("$strs->confirm:", get_string('voidyes', 'enrol_authorize') . '
' . authorize_print_action_button($orderid, ORDER_VOID, 0, true, false, $strs->no)); - print_table($table); + echo $OUTPUT->table($table); } elseif (!empty($suborderid)) { // cancel refunded $sql = "SELECT r.*, e.courseid, e.paymentmethod @@ -452,15 +452,15 @@ function authorize_print_order($orderid) $a->amount = $suborder->amount; $table->data[] = array("$strs->confirm:", get_string('subvoidyes', 'enrol_authorize', $a) . '
' . authorize_print_action_button($orderid, ORDER_VOID, $suborderid, true, $authstrs->unenrolstudent, $strs->no)); - print_table($table); + echo $OUTPUT->table($table); } } } else { - print_table($table); + echo $OUTPUT->table($table); if ($settled) { // show refunds. - $t2 = new stdClass; + $t2 = new html_table(); $t2->size = array('45%', '15%', '20%', '10%', '10%'); $t2->align = array('right', 'right', 'right', 'right', 'right'); $t2->head = array($authstrs->settlementdate, $authstrs->transid, $strs->status, $strs->action, $authstrs->amount); @@ -504,7 +504,7 @@ function authorize_print_order($orderid) $t2->data[] = array('','',get_string('noreturns', 'enrol_authorize'),'',''); } echo "

" . get_string('returns', 'enrol_authorize') . "

\n"; - print_table($t2); + echo $OUTPUT->table($t2); } } diff --git a/enrol/manual/enrol.html b/enrol/manual/enrol.html index b1ff63de5f..d94dc14059 100644 --- a/enrol/manual/enrol.html +++ b/enrol/manual/enrol.html @@ -40,7 +40,7 @@ if (isguestuser()) { echo $OUTPUT->box_start('centerpara'); $loginurl = get_login_url(); - print_single_button($loginurl, null, get_string('login')); + echo $OUTPUT->button(html_form::make_button($loginurl, null, get_string('login'))); echo $OUTPUT->box_end(); } ?> diff --git a/enrol/manual/enrol.php b/enrol/manual/enrol.php index fcf320b8e0..862b8db3f1 100644 --- a/enrol/manual/enrol.php +++ b/enrol/manual/enrol.php @@ -48,7 +48,7 @@ var $errormsg; * @param course current course object */ function print_entry($course) { - global $CFG, $USER, $SESSION, $THEME; + global $CFG, $USER, $SESSION, $THEME, $OUTPUT; $strloginto = get_string('loginto', '', $course->shortname); $strcourses = get_string('courses'); @@ -71,8 +71,7 @@ function print_entry($course) { print_header($strloginto, $course->fullname, $navigation); echo '
'; - notice_yesno(get_string('enrolmentconfirmation'), "enrol.php?id=$course->id&confirm=1", - "enrol.php?id=$course->id&cancel=1"); + echo $OUTPUT->confirm(get_string('enrolmentconfirmation'), "enrol.php?id=$course->id&confirm=1", "enrol.php?id=$course->id&cancel=1"); echo $OUTPUT->footer(); exit; -- 2.39.5