]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fix print_error"
authordongsheng <dongsheng>
Sun, 15 Jun 2008 11:40:25 +0000 (11:40 +0000)
committerdongsheng <dongsheng>
Sun, 15 Jun 2008 11:40:25 +0000 (11:40 +0000)
lang/en_utf8/error.php
lang/en_utf8/hotpot.php
mod/hotpot/template/default.php

index a38bc3318187a3a355250633f4316e0081d1a7d2..090ccf7f80a43e5cc1fc89553ee24449280ff475 100644 (file)
@@ -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)';
index 33c394b94d9b4386552eec77b298ed4593664f56..7189a17908a52257bdb4769f88ac8d18f9ffc593 100644 (file)
@@ -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';
index 307199c0fd6e5f19f6fbaec10b562cfaae99c7d0..04c5af88f883e44fc033715d0549005f41c5bbd6 100644 (file)
@@ -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 &quot;'.$filepath.'&quot;';
-            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: &quot;'.$method.'&quot;';
-                print_error($msg, '', $this->parent->course_homeurl);
+                print_error('cannotfindmethod', 'hotpot', $this->parent->course_homeurl, $method);
             }
         }
     }