summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-12-17 23:43:43 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-12-17 23:43:43 +0000
commit83bde0f54754ba68351f00ce512333f78a999f4f (patch)
tree90608c593b9348e571be4ff7b0cee3b04b6fcd24 /includes
parentcf790b5a096a154cee6f22688b4c9d2dbc14d76f (diff)
downloadbrdo-83bde0f54754ba68351f00ce512333f78a999f4f.tar.gz
brdo-83bde0f54754ba68351f00ce512333f78a999f4f.tar.bz2
#193804 by starbow, Rob Loach, Wim Leers: add often used basePath setting by defualt to JS settings, also providing an elegant bugfix to #201248
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index c2b1d5914..00f497d4e 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1934,14 +1934,20 @@ function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer
if (isset($data)) {
- // Add jquery.js and drupal.js the first time a Javascript file is added.
+ // Add jquery.js and drupal.js, as well as the basePath setting, the
+ // first time a Javascript file is added.
if (empty($javascript)) {
$javascript['header'] = array(
'core' => array(
'misc/jquery.js' => array('cache' => TRUE, 'defer' => FALSE, 'preprocess' => TRUE),
'misc/drupal.js' => array('cache' => TRUE, 'defer' => FALSE, 'preprocess' => TRUE),
),
- 'module' => array(), 'theme' => array(), 'setting' => array(), 'inline' => array(),
+ 'module' => array(),
+ 'theme' => array(),
+ 'setting' => array(
+ array('basePath' => base_path()),
+ ),
+ 'inline' => array(),
);
}