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

Add maharajsstrings() function to return a list of strings in mahara.js

parent 7ff1ba1c
......@@ -74,7 +74,7 @@ function submitForm(formid,url) {
var data = evalJSONRequest(result);
displayMessage({'message':data.message,'type':data.success});
});
d.addErrback(function() { displayMessage(get_string('badjsonresponse'),'error'); });
d.addErrback(function() { displayMessage(get_string('unknownerror'),'error'); });
displayMessage({'message':get_string('processingform'),'type':'info'});
return false;
}
......@@ -74,6 +74,12 @@ function &smarty($javascript = array(), $headers = array(), $strings = array())
}
else if ($value == 'mahara') {
$value = $jsroot . 'mahara.js';
$maharajsstrings = maharajsstrings();
foreach ($maharajsstrings as $string) {
if (!in_array($string, $strings)) {
$strings[] = $string;
}
}
}
else {
throw new Exception ($value . '.js: unknown');
......@@ -116,6 +122,13 @@ function &smarty($javascript = array(), $headers = array(), $strings = array())
return $smarty;
}
function maharajsstrings() {
return array('processingform',
'requiredfieldempty',
'unknownerror');
}
/**
* This function sets up and caches info about the current selected theme
* contains inheritance path (used for locating images) and template dirs
......
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