Commit dc596519 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Changed message types for consistency

parent 168e849a
......@@ -701,8 +701,8 @@ class Form {
$result .= 'd.addCallback(function (result) {';
$result .= 'var data = evalJSONRequest(result);';
$result .= "var errtype = 'global'\n";
$result .= "if (!data.error) { errtype = 'infomsg'; }\n";
$result .= "if (data.error == 'local') { errtype = 'errmsg'; }\n";
$result .= "if (!data.error) { errtype = 'info'; }\n";
$result .= "if (data.error == 'local') { errtype = 'error'; }\n";
$result .= "if (errtype == 'global') { global_error_handler(data); }\n";
$result .= 'else {' . $this->name . "_message(data.message,errtype);\n";
if (!empty($this->successcallback)) {
......@@ -710,9 +710,9 @@ class Form {
}
$result .= "}});\n";
$result .= 'd.addErrback(function() {';
$result .= $this->name . "_message('" . get_string('unknownerror') . "','errmsg');";
$result .= $this->name . "_message('" . get_string('unknownerror') . "','error');";
$result .= "});\n";
$result .= $this->name . "_message('" . get_string('processingform') . "','infomsg');\n";
$result .= $this->name . "_message('" . get_string('processingform') . "','info');\n";
$result .= "return false;\n";
$result .= '}';
return $result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment