diff options
Diffstat (limited to 'lib/exe/js.php')
-rw-r--r-- | lib/exe/js.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/exe/js.php b/lib/exe/js.php index 545ba7b23..793104e81 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -72,8 +72,10 @@ function js_out(){ // add possible plugin scripts and userscript $files = array_merge($files,js_pluginscripts()); - if(isset($config_cascade['userscript']['default'])){ - $files[] = $config_cascade['userscript']['default']; + if(!empty($config_cascade['userscript']['default'])) { + foreach($config_cascade['userscript']['default'] as $userscript) { + $files[] = $userscript; + } } $cache_files = array_merge($files, getConfigFiles('main')); @@ -154,6 +156,8 @@ function js_out(){ * Load the given file, handle include calls and print it * * @author Andreas Gohr <andi@splitbrain.org> + * + * @param string $file filename path to file */ function js_load($file){ if(!@file_exists($file)) return; @@ -189,6 +193,8 @@ function js_load($file){ * Returns a list of possible Plugin Scripts (no existance check here) * * @author Andreas Gohr <andi@splitbrain.org> + * + * @return array */ function js_pluginscripts(){ $list = array(); @@ -206,6 +212,8 @@ function js_pluginscripts(){ * - Nothing is returned for plugins without an entry for $lang['js'] * * @author Gabriel Birke <birke@d-scribe.de> + * + * @return array */ function js_pluginstrings() { global $conf; @@ -231,6 +239,8 @@ function js_pluginstrings() { * * - $lang['js'] must be an array. * - Nothing is returned for template without an entry for $lang['js'] + * + * @return array */ function js_templatestrings() { global $conf; @@ -252,6 +262,9 @@ function js_templatestrings() { * as newline * * @author Andreas Gohr <andi@splitbrain.org> + * + * @param string $string + * @return string */ function js_escape($string){ return str_replace('\\\\n','\\n',addslashes($string)); @@ -261,6 +274,8 @@ function js_escape($string){ * Adds the given JavaScript code to the window.onload() event * * @author Andreas Gohr <andi@splitbrain.org> + * + * @param string $func */ function js_runonstart($func){ echo "jQuery(function(){ $func; });".NL; @@ -275,6 +290,9 @@ function js_runonstart($func){ * @author Nick Galbreath <nickg@modp.com> * @author Andreas Gohr <andi@splitbrain.org> * @link http://code.google.com/p/jsstrip/ + * + * @param string $s + * @return string */ function js_compress($s){ $s = ltrim($s); // strip all initial whitespace |