From 830c58b7e344aacbd0a4a2b451bec96bf94350fe Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 25 Sep 2008 03:11:33 +0000 Subject: [PATCH] MDL-16672 Output a standard set of config variables into JavaScript on every page. --- lib/weblib.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/weblib.php b/lib/weblib.php index 33083fbd52..97d31df383 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2358,6 +2358,8 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta .= "\n".require_js('',1); + $meta .= standard_js_config(); + /// Set up some navigation variables if (is_newnav($navigation)){ @@ -2731,6 +2733,22 @@ function print_js_config($settings = array(), $prefix='', $return = false) { } } +/** + * This function generates the code that defines the standard moodle_cfg object. + * This object has a number of fields that are values that various pieces of + * JavaScript code need access too. For example $CFG->wwwroot and $CFG->pixpath. + * + * @return string a