From 876548ee4ad9acfd5f67bb297d52fbca303f0899 Mon Sep 17 00:00:00 2001 From: jordifontseca Date: Thu, 4 Sep 2014 18:32:20 +0200 Subject: [PATCH] Parse course fullname with format_string() so that filters are applied (such as multilingual filter). --- apply.php | 2 +- lib.php | 4 ++-- manage.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apply.php b/apply.php index 0781f38..7a0a315 100644 --- a/apply.php +++ b/apply.php @@ -61,7 +61,7 @@ echo ''; foreach ( $enrols as $enrol ) { $picture = get_user_picture($enrol->userid); echo ''; - echo '' . $enrol->course . ''; + echo '' . format_string($enrol->course) . ''; echo '' . $OUTPUT->render($picture) . ''; echo ''.$enrol->firstname . ' ' . $enrol->lastname.''; echo '' . $enrol->email . ''; diff --git a/lib.php b/lib.php index d503b1d..26dd06e 100644 --- a/lib.php +++ b/lib.php @@ -203,7 +203,7 @@ function sendCancelMail($info){ global $CFG; $apply_setting = $DB->get_records_sql("select name,value from ".$CFG->prefix."config_plugins where plugin='enrol_apply'"); - $replace = array('firstname'=>$info->firstname,'content'=>$info->coursename); + $replace = array('firstname'=>$info->firstname,'content'=>format_string($info->coursename)); $body = $apply_setting['cancelmailcontent']->value; $body = updateMailContent($body,$replace); $contact = get_admin(); @@ -215,7 +215,7 @@ function sendConfirmMail($info){ global $CFG; $apply_setting = $DB->get_records_sql("select name,value from ".$CFG->prefix."config_plugins where plugin='enrol_apply'"); - $replace = array('firstname'=>$info->firstname,'content'=>$info->coursename); + $replace = array('firstname'=>$info->firstname,'content'=>format_string($info->coursename)); $body = $apply_setting['confirmmailcontent']->value; $body = updateMailContent($body,$replace); $contact = get_admin(); diff --git a/manage.php b/manage.php index e27ae78..467fca5 100644 --- a/manage.php +++ b/manage.php @@ -50,7 +50,7 @@ echo '' . get_string ( 'applydate', 'enrol_apply' echo ''; foreach ( $enrols as $enrol ) { echo ''; - echo '' . $enrol->course . ''; + echo '' . format_string($enrol->course) . ''; echo '' . $enrol->firstname . ' ' . $enrol->lastname . ''; echo '' . $enrol->email . ''; echo '' . date ( "Y-m-d", $enrol->timecreated ) . '';