Jump to content

Topic on Project:Support desk/Flow

Is it possible to link to local directory like \\server\dir... instead of http://.... ?

8
80.237.251.92 (talkcontribs)

We need this to link from wiki text to local files in our compnies intranet.

Many thanks in advance

201.55.240.5 (talkcontribs)

Hi there,

I also have the same problem... if someone could help me, I will be very happy

Thanks

Subfader (talkcontribs)

It's a browser thing. IE works fine, Firefox blocked this for security reasons.

Crismagnabosco (talkcontribs)

And what is the tag to use with local path?

thanks

Subfader (talkcontribs)
Bawolff (talkcontribs)
Schalice (talkcontribs)

I use this extension. not sure where I got it:



<?php
// Link MediaWiki extension.
// Creates a link to a network location.
 
// Copyright (C) 2007, Aretai Systems.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
# Usage
# with this extension it is possible to define 
# new tags of the form 
# <link target="blank">network location</link>
# The behaviour of a window is configurable. Options are not obligatory: "SELF", "TOP", "PARENT", "BLANK" (default).
# the function registered by the extension gets the text between the 
# tags as input and renders a link.
# You can just copy the network location and paste it between <link></link>. 

$wgHooks['ParserFirstCallInit'][] = "hookNetworkLink";
 
function hookNetworkLink( &$parser ) {
    $parser->setHook( "link", "renderNetworkLink" );
    return true;
}
 
# The callback function for converting the input text to HTML output
function renderNetworkLink( $loc='', $argv=array() ) {
    global $wgOut, $wgTitle, $wgParser;
 
    $loc = htmlspecialchars($loc);
    switch( strtoupper( $argv['TARGET'] ) ) {
    case "SELF":
       $out = "<a href=\"{$loc}\" target=\"_self\">$loc</a>";
       break;
    case "TOP":
       $out = "<a href=\"{$loc}\" target=\"_top\">$loc</a>";
       break;
    case "PARENT":
       $out = "<a href=\"{$loc}\" target=\"_parent\">$loc</a>";
       break;
    default:
       $out = "<a href=\"{$loc}\" target=\"_blank\">$loc</a>";
    }
 
    return $out;
 
}
Subfader (talkcontribs)

^^Doesn't work. Also it's a browser prblem not a website problem.