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

Function to get a list of quoted js strings

parent 1b0f768d
......@@ -148,6 +148,11 @@ function &smarty($javascript = array(), $headers = array(), $strings = array())
return $smarty;
}
/**
* Returns the lists of strings used in the .js files
* @return array
*/
function jsstrings() {
return array(
'mahara' => array(
......@@ -167,6 +172,20 @@ function jsstrings() {
);
}
/**
* Takes an array of string identifiers and returns an array of the
* corresponding strings, quoted for use in inline javascript here
* docs.
*/
function quotestrings($stringids, $section = 'mahara') {
$getstring = array();
foreach ($stringids as $string) {
$getstring[$string] = "'" . get_string($string, $section) . "'";
}
return $getstring;
}
/**
* 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