From b2b176cf95b13be266f12f2d2029c98b0b6ece70 Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 10 Jul 2004 12:10:22 +0000 Subject: [PATCH] Print Costs better on the course info --- enrol/paypal/enrol.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/enrol/paypal/enrol.php b/enrol/paypal/enrol.php index 4263b25f30..d1981dd91d 100644 --- a/enrol/paypal/enrol.php +++ b/enrol/paypal/enrol.php @@ -62,6 +62,8 @@ function check_entry($form, $course) { function get_access_icons($course) { global $CFG; + $str = ''; + if ( (float) $course->cost < 0) { $cost = (float) $CFG->enrol_cost; } else { @@ -70,18 +72,22 @@ function get_access_icons($course) { if (abs($cost) < 0.01) { $str = parent::get_access_icons($course); + } else { $strrequirespayment = get_string("requirespayment"); - - if (! file_exists("$CFG->dirroot/pix/m/$CFG->enrol_paypalcurrency.gif")) { - $icon = "$CFG->pixpath/m/USD.gif"; - } else { - $icon = "$CFG->pixpath/m/$CFG->enrol_paypalcurrency.gif"; + $strcost = get_string("cost"); + + switch ($CFG->enrol_paypalcurrency) { + case 'EUR': $currency = '€'; break; + case 'CAD': $currency = '$'; break; + case 'GBP': $currency = '£'; break; + case 'JPY': $currency = '¥'; break; + default: $currency = '$'; break; } - $str .= "wwwroot/course/view.php?id=$course->id\">"; - $str .= "\"$strrequirespayment\""; + $str .= "

$strcost: wwwroot/course/view.php?id=$course->id\">"; + $str .= "$currency $cost

"; } -- 2.39.5