From 83bde0f54754ba68351f00ce512333f78a999f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Mon, 17 Dec 2007 23:43:43 +0000 Subject: #193804 by starbow, Rob Loach, Wim Leers: add often used basePath setting by defualt to JS settings, also providing an elegant bugfix to #201248 --- includes/common.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'includes') 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(), ); } -- cgit v1.2.3