From 1aef51b8e35b657d81d2efdffc2f9e4e88d152b3 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Sun, 15 Jun 2008 11:40:25 +0000 Subject: [PATCH] "MDL-14129, fix print_error" --- lang/en_utf8/error.php | 1 + lang/en_utf8/hotpot.php | 1 + mod/hotpot/template/default.php | 6 ++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index a38bc33181..090ccf7f80 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -90,6 +90,7 @@ $string['cannotoverridebaserole'] = 'Can not override base role capabilities'; $string['cannotopencsv'] = 'Cannot open csv file'; $string['cannotopenforwrit'] = 'Cannot open for writing: $a'; $string['cannotopenfile'] = 'Cannot open file ($a)'; +$string['cannotopentemplate'] = 'Cannot open template file ($a)'; $string['cannotreadtmpfile'] = 'Error reading temporary file'; $string['cannotreaduploadfile'] = 'Could not read uploaded file'; $string['cannotreadfile'] = 'Can not read file ($a)'; diff --git a/lang/en_utf8/hotpot.php b/lang/en_utf8/hotpot.php index 33c394b94d..7189a17908 100644 --- a/lang/en_utf8/hotpot.php +++ b/lang/en_utf8/hotpot.php @@ -14,6 +14,7 @@ $string['average'] = 'Average'; $string['cannotaddquestionrecord'] = 'Could not add question record'; $string['cannotaddresprecord'] = 'Could not add response record'; $string['cannotaddstrrecord'] = 'Could not add string record'; +$string['cannotfindmethod'] = 'Template block expand method not found: ($a)'; $stirng['cannotinsertattempt'] = 'Could not insert attempt record: $a'; $string['cannotupdateattempt'] = 'Could not update attempt record: $a'; $string['checks'] = 'Checks'; diff --git a/mod/hotpot/template/default.php b/mod/hotpot/template/default.php index 307199c0fd..04c5af88f8 100644 --- a/mod/hotpot/template/default.php +++ b/mod/hotpot/template/default.php @@ -5,8 +5,7 @@ class hotpot_xml_template_default { $filepath = $this->parent->template_dirpath.DIRECTORY_SEPARATOR.$filename; // try and open the template file if (!file_exists($filepath) || !is_readable($filepath)) { - $msg = 'Could not open the '.$this->parent->template_dir.' template file "'.$filepath.'"'; - print_error($msg, '', $this->parent->course_homeurl); + print_error('cannotopentemplate', '', $this->parent->course_homeurl, $filepath); } // read in the template and close the file $this->$tag = file_get_contents($filepath); @@ -39,8 +38,7 @@ class hotpot_xml_template_default { $this->$tag = str_replace($blocks[0][$ii], $replace, $this->$tag); } } else { - $msg = 'Template block expand method not found: "'.$method.'"'; - print_error($msg, '', $this->parent->course_homeurl); + print_error('cannotfindmethod', 'hotpot', $this->parent->course_homeurl, $method); } } } -- 2.39.5