--- webfm/js/webfm.js.orig 2008-12-03 12:49:39.000000000 +0100
+++ webfm/js/webfm.js 2008-12-03 12:49:43.000000000 +0100
@@ -2046,7 +2046,7 @@
}
Webfm.menuPasteHref = function(obj) {
- var fileHref = Webfm.generateFileHref(obj, '');
+ var fileHref = Webfm.generateFileHref(obj, getBasePath().replace(/\/$/,''));
var myField = Webfm.lastarea;
//IE support
--- webfm/webfm.module.orig 2008-12-03 12:49:18.000000000 +0100
+++ webfm/webfm.module 2008-12-03 12:49:21.000000000 +0100
@@ -629,7 +629,7 @@
* Implementation of hook_nodeapi().
*/
function webfm_nodeapi(&$node, $op, $teaser) {
- global $user;
+ global $user, $base_url, $base_path;
switch ($op) {
case 'load':
if((variable_get("wfm_attach_$node->type", 1) == 1) &&
@@ -687,7 +687,7 @@
if(is_null($inline_js)) {
$clean_url = variable_get('clean_url', 0);
$clean = (($clean_url == 0) || ($clean_url == '0')) ? FALSE : TRUE;
- $inline_js = webfm_inline_js($base_url, $clean, $user->uid);
+ $inline_js = webfm_inline_js($base_url, $base_path, $clean, $user->uid);
}
break;
@@ -724,7 +724,7 @@
* Implementation of hook_form_alter().
*/
function webfm_form_alter(&$form, &$form_state, $form_id) {
- global $base_url;
+ global $base_url, $base_path;
global $user;
if(($user->uid == 1) || user_access('administer webfm') || user_access('access webfm'))
@@ -758,7 +758,7 @@
if(is_null($inline_js)) {
$clean_url = variable_get('clean_url', 0);
$clean = (($clean_url == 0) || ($clean_url == '0')) ? FALSE : TRUE;
- $inline_js = webfm_inline_js($base_url, $clean, $user->uid);
+ $inline_js = webfm_inline_js($base_url, $base_path, $clean, $user->uid);
}
// Attachments fieldset
@@ -1879,7 +1879,7 @@
* Main file manager function
*/
function webfm_main () {
- global $base_url;
+ global $base_url, $base_path;
global $user;
$modulepath = drupal_get_path('module', 'webfm');
@@ -1893,7 +1893,7 @@
global $user;
$clean_url = variable_get('clean_url', 0);
$clean = (($clean_url == 0) || ($clean_url == '0')) ? FALSE : TRUE;
- $inline_js = webfm_inline_js($base_url, $clean, $user->uid);
+ $inline_js = webfm_inline_js($base_url, $base_path, $clean, $user->uid);
}
$debug_link = (drupal_to_js(variable_get('webfm_debug',''))) ? t('[debug]') : '';
@@ -1979,10 +1979,10 @@
/**
* Inline javascript
- * Function to pass base_url, icon directory, debug and cleanurl flags
+ * Function to pass base_url, base_path, icon directory, debug and cleanurl flags
*/
-function webfm_inline_js($base_url, $clean_url, $uid) {
- $js = '' ;
+function webfm_inline_js($base_url, $base_path, $clean_url, $uid) {
+ $js = '' ;
drupal_set_html_head($js);
return $js;
}