Basically I want to link to an xls file on a local harddrive from a drupal driven intranet site. I searched and searched, and posted and posted, but I have had no luck in getting it to work. Basically my problem is that the menu item gets appended onto the end of the drupal base address rather than just linking to file:///V:/myfolder/myfile.xls

I reckon that the following function in includes/menu.inc is the culprit, and am considering editing it to make it work. Unfortunately my PHP knowledge is non-existant. Can anybody help me out?

Here's the function

/**
* Sets the path of the active menu item.
*/
function menu_set_active_item($path = NULL) {
static $stored_mid;

if (!isset($stored_mid) || isset($path)) {
$menu = menu_get_menu();
if (!isset($path)) {
$path = $_GET['q'];
}
else {
$_GET['q'] = $path;
}

while ($path && !isset($menu['path index'][$path])) {
$path = substr($path, 0, strrpos($path, '/'));
}
$stored_mid = isset($menu['path index'][$path]) ? $menu['path index'][$path] : 0;

// Search for default local tasks to activate instead of this item.
$continue = TRUE;
while ($continue) {
$continue = FALSE;
if (isset($menu['items'][$stored_mid]['children'])) {
foreach ($menu['items'][$stored_mid]['children'] as $cid) {
if ($menu['items'][$cid]['type'] & MENU_LINKS_TO_PARENT) {
$stored_mid = $cid;
$continue = TRUE;
}
}
}
}

// Reset the cached $menu in menu_get_item().
menu_get_item(NULL, NULL, TRUE);
}

return $stored_mid;
}

Any help would be appreciated.

Thanks

Brian

Comments

cog.rusty’s picture

I wouldn't try to modify that. Many things will stop working in Drupal.

Maybe you can try to type those links in a block as text surrounded by <a href> tags, and try to make it look like a menu. Menus are a kind of blocks anyway.

Drupal will have nothing to do with this, all depends on the people who will click these links in their browsers, and on their network access setup.

-----

Edit: I just noticed that the link in your question is converted to http:// instead of file:// in the browser's status bar. But that may be because of a filter installed here.

wings’s picture

I managed to fix the problem by using adding a new variable to the variables table. Full details are found here:

http://drupal.org/node/97524

Brian