Permalink
Browse files

Updated Authorize.net for Ethem

  • Loading branch information...
patrickslee
patrickslee committed Mar 13, 2006
1 parent eca0392 commit 96a7973eb9c5976368e96848245757f0fab85b24
Showing with 14 additions and 5 deletions.
  1. +5 −5 blocks/admin/block_admin.php
  2. +2 −0 lang/en_utf8/moodle.php
  3. +7 −0 user/view.php
@@ -71,9 +71,9 @@ function load_content_for_site() {
if ($CFG->enrol == 'authorize') {
require_once $CFG->dirroot.'/enrol/authorize/const.php';
- $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php">'.get_string('payments').'</a>';
+ $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php">'.get_string('payments').'</a> ';
if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH)) {
- $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'">(<b>'.$cnt.'</b> '.get_string('pending').')</a>';
+ $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'">'.get_string('paymentpending', 'moodle', $cnt).'</a>';
}
$this->content->items[] = $paymenturl;
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" height="16" width="16" alt="" />';
@@ -175,11 +175,11 @@ function load_content_for_course() {
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/files.gif" height="16" width="16" alt="" />';
}
- if ($CFG->enrol == 'authorize') {
+ if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
require_once $CFG->dirroot.'/enrol/authorize/const.php';
- $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a>';
+ $paymenturl = '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?course='.$course->id.'">'.get_string('payments').'</a> ';
if ($cnt = count_records('enrol_authorize', 'status', AN_STATUS_AUTH, 'courseid', $course->id)) {
- $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'&amp;course='.$course->id.'">(<b>'.$cnt.'</b> '.get_string('pending').')</a>';
+ $paymenturl .= '<a href="'.$CFG->wwwroot.'/enrol/authorize/index.php?status='.AN_STATUS_AUTH.'&amp;course='.$course->id.'">'.get_string('paymentpending', 'moodle', $cnt).'</a>';
}
$this->content->items[] = $paymenturl;
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" height="16" width="16" alt="" />';
View
@@ -981,6 +981,8 @@
$string['pathslasherror'] = 'Path can\'t end with a slash!!';
$string['paymentinstant'] = 'Use the button below to pay and be enrolled within minutes!';
$string['paymentrequired'] = 'This course requires a payment for entry.';
+$string['payments'] = 'Payments';
+$string['paymentpending'] = '(<small><b><u>$a</u></b> pending</small>)';
$string['paymentsorry'] = 'Thank you for your payment! Unfortunately your payment has not yet been fully processed, and you are not yet registered to enter the course \"$a->fullname\". Please try continuing to the course in a few seconds, but if you continue to have trouble then please alert the $a->teacher or the site administrator';
$string['paymentthanks'] = 'Thank you for your payment! You are now enrolled in your course:<br />\"$a\"';
$string['people'] = 'People';
View
@@ -349,6 +349,13 @@
echo "</form></td>";
}
}
+ if ($course->enrol == 'authorize' || (empty($course->enrol) && $CFG->enrol == 'authorize')) {
+ echo "<td nowrap=\"nowrap\"><form action=\"../enrol/authorize/index.php\" method=\"get\">";
+ echo "<input type=\"hidden\" name=\"id\" value=\"$course->id\" />";
+ echo "<input type=\"hidden\" name=\"user\" value=\"$user->id\" />";
+ echo "<input type=\"submit\" value=\"".get_string('payments')."\" />";
+ echo "</form></td>";
+ }
echo "<td></td>";
echo "</tr></table></div>\n";

0 comments on commit 96a7973

Please sign in to comment.