"MDL-14129, fix print_error"

This commit is contained in:
dongsheng
2008-06-15 11:40:25 +00:00
parent 3dce78e125
commit 1aef51b8e3
3 changed files with 4 additions and 4 deletions
+1
View 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)';
+1
View 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';
+2 -4
View 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 "'.$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);
}
}
}