From 5b1b61b8ab6b7dc640e534278968991caece40fb Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Thu, 7 Apr 2011 10:28:39 +0200 Subject: [PATCH] Assume external script for ^http and alias for ^/ --- mkdru.module | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mkdru.module b/mkdru.module index b559518..b1bde08 100644 --- a/mkdru.module +++ b/mkdru.module @@ -21,8 +21,16 @@ function mkdru_ting_search_tab($keys) { error_log("TING SEARCH TAB invoked"); $path = drupal_get_path('module', 'mkdru'); // Include client library. - drupal_add_js(variable_get('pz2_js_path', 'pazpar2/js') - . '/pz2.js', 'module', 'footer'); + // D6 seems not to be able to handle external scripts + // assume one if path starts with http: + // assume alias if path starts with / + if (preg_match('/^http:/') || preg_match('/^\//') { + drupal_add_js(variable_get('pz2_js_path', 'pazpar2/js') + . '/pz2.js', 'module', 'footer', TRUE, TRUE, FALSE); + } else { + drupal_add_js($path.'/'.variable_get('pz2_js_path', 'pazpar2/js') + . '/pz2.js', 'module', 'footer'); + } drupal_add_js($path . '/jquery.ba-bbq.js', 'module', 'footer'); drupal_add_js($path . '/recipe.js', 'module', 'footer'); drupal_add_js($path . '/mkdru.theme.js', 'module', 'footer'); -- 1.7.10.4