Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

print_simple_box(_start/_end) and preg_replace() fixes

  • Loading branch information...
commit a7be540125ecc4414246dc1d584eded01c9f4fa0 1 parent 4262a2f
ethem authored
Showing with 8 additions and 7 deletions.
  1. +7 −6 enrol/authorize/enrol.php
  2. +1 −1  enrol/authorize/enrol_form.php
13 enrol/authorize/enrol.php
View
@@ -29,7 +29,8 @@ class enrolment_plugin_authorize
*/
public function print_entry($course)
{
- global $CFG, $USER, $form;
+ global $CFG, $USER, $OUTPUT;
+ global $form;
$zerocost = zero_cost($course);
if ($zerocost) {
@@ -96,9 +97,9 @@ public function print_entry($course)
}
}
- print_box_start();
+ $OUTPUT->box_start();
$frmenrol->display();
- print_box_end();
+ $OUTPUT->box_end();
}
if ($course->password) {
@@ -149,7 +150,7 @@ public function check_entry($form, $course)
*/
private function cc_submit($form, $course)
{
- global $CFG, $USER, $SESSION, $DB;
+ global $CFG, $USER, $SESSION, $OUTPUT, $DB;
prevent_double_paid($course);
@@ -314,13 +315,13 @@ private function cc_submit($form, $course)
load_all_capabilities();
- print_box_start('generalbox', 'notice');
+ $OUTPUT->box_start('generalbox notice');
echo '<p>'. get_string('paymentthanks', 'moodle', $course->fullname) .'</p>';
echo '<div class="buttons">';
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 '</div>';
- print_box_end();
+ $OUTPUT->box_end();
print_footer($course);
exit; // break;
}
2  enrol/authorize/enrol_form.php
View
@@ -272,7 +272,7 @@ private function validate_cc($Num, $Name = "n/a", $Exp = "")
$GoodCard = true;
// Get rid of any non-digits
- $Num = preg_replace("/[^0-9]~", "", $Num);
+ $Num = preg_replace("/[^0-9]~/", "", $Num);
// Perform card-specific checks, if applicable
switch ($Name)
Please sign in to comment.
Something went wrong with that request. Please try again.