From: Jakub Skoczen Date: Thu, 7 Apr 2011 08:28:39 +0000 (+0200) Subject: Assume external script for ^http and alias for ^/ X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=5b1b61b8ab6b7dc640e534278968991caece40fb;p=mkdru-moved-to-drupal.org.git Assume external script for ^http and alias for ^/ --- 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');