X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.module;h=7ad747997993d714c69667b7cd55560f8ca8d56a;hb=68ef3ece64f3b54acc531fd81bdc53934cbca6e8;hp=ae66e655408fd6e53083497a6ec6c4e0b365e136;hpb=4e9ac8e770beab451e7ef72548997dda718f7ee1;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.module b/mkdru.module index ae66e65..7ad7479 100644 --- a/mkdru.module +++ b/mkdru.module @@ -20,15 +20,15 @@ function mkdru_node_info() { function mkdru_ting_search_tab($keys) { error_log("TING SEARCH TAB invoked"); $path = drupal_get_path('module', 'mkdru'); - // Include client library. - // D6 seems not to be able to handle external scripts - // assume one if path starts with http: - // assume alias if path starts with / + // D6 is not to be able to handle external scripts and always + // prepends '/' (so we cannot keep pz2.js on remote host) + // we will try to be even smarter :) $pz2_js_path = variable_get('pz2_js_path', 'pazpar2/js'); - if (preg_match('/^http:/', $pz2_js_path) - || preg_match('/^\//', $pz2_js_path)) { + if (preg_match('/^\//', $pz2_js_path)) { + $pz2_js_path = trim($pz2_js_path, '/'); drupal_add_js($pz2_js_path.'/pz2.js', 'module', 'footer', - TRUE, TRUE, FALSE); + TRUE, TRUE, FALSE); + error_log("Pz2.js added as alias script '".$pz2_js_path); } else { drupal_add_js($path.'/'.$pz2_js_path.'/pz2.js', 'module', 'footer'); }