sorry, LinkUnknownWikiWord() was wrong.
you have to add that in stdlib.php LinkURL()
index.php:
$ext_target = '_new';
stdlib.php:
/**
* Generates an HtmlElement object to store data for a link.
* @param string $url URL that the link will point to.
* @param string $linktext Text to be displayed as link.
* @return HtmlElement HtmlElement object that contains data to construct
an html link.
*/
function LinkURL($url, $linktext = '') {
// FIXME: Is this needed (or sufficient?)
if(! IsSafeURL($url)) {
$link = HTML::strong(HTML::u(array('class' => 'baduri'),
_("BAD URL -- remove all of <, >,
\"")));
}
else {
if (!$linktext)
$linktext = preg_replace("/mailto:/A", "", $url);
$link = HTML::a(array('href' => $url),
IconForLink($url), $linktext);
}
$link->setAttr('class', $linktext ? 'namedurl' : 'rawurl');
if (!empty($GLOBALS['ext_target']))
$link->setAttr('target', $GLOBALS['ext_target']);
return $link;
}
aphid schrieb:
> On Tuesday, October 1, 2002, at 12:39 AM, Reini Urban wrote:
>> aphid schrieb:
>>
>>> hey, you commented on my wiki that you'd add something for extlinks
>>> so it would be possible to make them pop up in new windows..
>>> i was wondering if this had gone in and where i should look for it
>>> when it does? i did a multi-file search to try to hunt down where it
>>> renders the a href tags for links and couldn't find it.
>>
>>
>> sorry, currently I'm very busy.
>>
>> I know I did it on my private wiki, so it's not online yet.
>> you need <a target"_new" href=""> in LinkUnknownWikiWord()
>>
>> I added:
>> if ($request->getArg('frame'))
>> $link->setAttr('target', '_top');
>>
>> Similarly you can do that for yours,
>> or override this function in your theme.
>>
>> $link->setAttr('target', '_new');
>>
>
> I've tried this in theme.php and if it did anything, I'm not sure what.
> What I'm trying to do is have links that go away from the wiki (which I
> believe are called NamedWiki) to open in "_new".. maybe my calling them
> external links confused the situation.
>
> Cheers
> A
>
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
|