From: Peter T. <pt...@nt...> - 2005-02-14 01:32:21
|
Author: pthoeny Date: 2005-02-13 17:29:57 -0800 (Sun, 13 Feb 2005) New Revision: 3622 Modified: twiki/trunk/lib/TWiki.pm Log: ScriptNameVariable: SCRIPTNAME variable Modified: twiki/trunk/lib/TWiki.pm =================================================================== --- twiki/trunk/lib/TWiki.pm 2005-02-13 11:56:28 UTC (rev 3621) +++ twiki/trunk/lib/TWiki.pm 2005-02-14 01:29:57 UTC (rev 3622) @@ -2808,6 +2808,22 @@ =pod +---++ sub handleScriptName ( ) + +Not yet documented. + +=cut + +sub handleScriptName +{ + my $value = $ENV{'SCRIPT_URL'} || ""; # e.g. '/cgi-bin/view.cgi/TWiki/WebHome' + $value =~ s|^$dispScriptUrlPath/?||; # cut URL path to get 'view.cgi/TWiki/WebHome' + $value =~ s|/.*||; # cut extended path to get 'view.cgi' + return $value; +} + +=pod + ---++ sub handleEnvVariable ( $theVar ) Not yet documented. @@ -2954,6 +2970,7 @@ $_[0] =~ s/%WIKIHOMEURL%/$wikiHomeUrl/g; $_[0] =~ s/%SCRIPTURL%/$urlHost$dispScriptUrlPath/g; $_[0] =~ s/%SCRIPTURLPATH%/$dispScriptUrlPath/g; + $_[0] =~ s/%SCRIPTNAME%/&handleScriptName()/ge; $_[0] =~ s/%SCRIPTSUFFIX%/$scriptSuffix/g; $_[0] =~ s/%PUBURL%/$urlHost$pubUrlPath/g; $_[0] =~ s/%PUBURLPATH%/$pubUrlPath/g; |