"MDL-14129, fix print_error"
This commit is contained in:
@@ -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)';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user