* $db_url = 'mysql://username:password@localhost/databasename';
* $db_url = 'mysqli://username:password@localhost/databasename';
* $db_url = 'pgsql://username:password@localhost/databasename';
*/
$db_url = 'mysql://username:password@localhost/databasename';
$db_prefix = 'prev_';
$jscript_path = "../../../../hosted/js/oat/"; // I put this js package
$jsother = true;
$jsother_app = "../../../../hosted/js/drupal_oat.js";
$jscript_default_features = 'var featureList = ["dialog","window","mswin","rectwin","roundwin","panelbar"]';
I found that since I was using OAT, that the whole system would be easier to work with if I could just use the JavaScript that served the components I was trying to use.
I found that by including Drupal javascript and another package, that the two would stop each other from working.
Since, OAT, and similar packages are more fully developed than the Drupal JS, programming would be more productive with the choice given,
In conjunction with the above changes, there should be some place in which the changes can be activated.
The setting variables have to be added to the boostrap include.
/**
* Loads the configuration and sets the base URL correctly.
*/
function conf_init() {
global $db_url, $db_prefix, $base_url, $base_path, $base_root, $conf, $installed_profile, $jscript_path, $jsother, $jsother_app, $jscript_default_features;
$conf = array();
include_once './'. conf_path() .'/settings.php';
if (isset($base_url)) {
// Parse fixed base URL from settings.php.
$parts = parse_url($base_url);
if (!isset($parts['path'])) {
$parts['path'] = '';
}
$base_path = $parts['path'] . '/';
// Build $base_root (everything until first slash after "scheme://").
$base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
}
else {
// Create base URL
$base_root = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$base_url = $base_root .= '://'. $_SERVER['HTTP_HOST'];
if ($dir = trim(dirname($_SERVER['PHP_SELF']), '\,/')) {
$base_path = "/$dir";
$base_url .= $base_path;
$base_path .= '/';
}
else {
$base_path = '/';
}
}
}
The routine drupal_add_js should reflect that use of these variables:
function drupal_add_js($data = NULL, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE) {
if (!is_null($data)) {
global $jscript_path;
global $jsother_app;
global $jscript_default_features;
global $jsother;
if ( $jsother ) {
_drupal_add_js($jscript_default_features, 'core', 'inline', FALSE, $cache);
_drupal_add_js($jscript_path . 'loader.js', 'core', 'header', FALSE, $cache); // Note: this is still OAT specific, but a loader.js could be constructed for other packages.
_drupal_add_js($jsother_app, 'core', 'header', FALSE, $cache);
} else {
_drupal_add_js('misc/jquery.js', 'core', 'header', FALSE, $cache);
_drupal_add_js('misc/drupal.js', 'core', 'header', FALSE, $cache);
}
}
return _drupal_add_js($data, $type, $scope, $defer, $cache);
}
A final note is that some modules are more dependent on existing Drupal JS and would require revision.
Comments
Comment #1
pasquallehttp://api.drupal.org/api/function/hook_library/7
http://drupal.org/project/libraries