Diffs from Dec2002 Release diff -c -w -d -r1.1 -r1.3 *** TWiki.pm 2002/03/03 20:27:32 1.1 --- TWiki.pm 2002/03/03 23:57:14 1.3 *************** *** 75,80 **** --- 75,85 ---- $superAdminGroup $doSuperAdminGroup $cgiQuery @publicWebList $formatVersion $OS + + $hideAllEditLinks + $putSpacesBackIntoWikiWords + $applyRemoveExcessPathComponentsPatch + $overrideUrlPrefix ); # TWiki::Store config: *************** *** 188,193 **** --- 193,205 ---- # is "bin/script/Webname/SomeTopic" or "bin/script/Webname/" $webName = $1 || "" if( ! $webName ); $topicName = $2 || "" if( ! $topicName ); + # Hack by AndyPryke@AndyPryke.com (ANP) to remove "/twiki/bin/view.pl/" component. + if ($applyRemoveExcessPathComponentsPatch) { + $webName =~ /(.*)[\/](.*)/; + $webName = $2; + } + # end by AndyPryke + } elsif( $thePathInfo =~ /\/(.*)/ ) { # is "bin/script/Webname" or "bin/script/" $webName = $1 || "" if( ! $webName ); *************** *** 645,650 **** --- 657,663 ---- sub getViewUrl { my( $theWeb, $theTopic ) = @_; + # PTh 20 Jun 2000: renamed sub viewUrl to getViewUrl, added $theWeb my $web = $webName; # current web if( $theWeb ) { *************** *** 652,657 **** --- 665,673 ---- } $theTopic =~ s/\s*//gos; # Illedal URL, remove space + if ($overrideUrlPrefix){ + return "$overrideUrlPrefix/$theTopic"; + } # PTh 24 May 2000: added $urlHost, needed for some environments # see also Codev.PageRedirectionNotWorking return "$urlHost$scriptUrlPath/view$scriptSuffix/$web/$theTopic"; *************** *** 1317,1322 **** --- 1333,1347 ---- } # ========================= + sub handlePureSpacedTopic + { + my( $theTopic ) = @_; + my $pureSpacedTopic = $theTopic; + $pureSpacedTopic =~ s/([a-z]+)([A-Z0-9]+)/$1 $2/go; # "%20*" is " *" + return $pureSpacedTopic; + } + + # ========================= sub handleInternalTags { # modify arguments directly, e.g. call by reference *************** *** 1335,1340 **** --- 1360,1366 ---- $_[0] =~ s/%BASETOPIC%/$topicName/go; $_[0] =~ s/%INCLUDINGTOPIC%/$includingTopicName/go; $_[0] =~ s/%SPACEDTOPIC%/&handleSpacedTopic($_[1])/geo; + $_[0] =~ s/%PURESPACEDTOPIC%/&handlePureSpacedTopic($_[1])/geo; $_[0] =~ s/%WEB%/$_[2]/go; $_[0] =~ s/%BASEWEB%/$webName/go; $_[0] =~ s/%INCLUDINGWEB%/$includingWebName/go; *************** *** 1458,1464 **** $pWeb = $1; $pTopic = $2; } ! $text = "$pWeb.$pTopic$sep$text"; $sep = $usesep; if( $dontRecurse || ! $name ) { last; --- 1484,1493 ---- $pWeb = $1; $pTopic = $2; } ! # AndyPryke@AndyPryke.com (ANP) - fix for public web - doesn't render non-wiki words correctly without this ! # $text = "[[$pWeb.$pTopic]]$sep$text"; ! $text = "[[$pTopic]]$sep$text"; ! # End by AndyP $sep = $usesep; if( $dontRecurse || ! $name ) { last; *************** *** 1747,1752 **** --- 1776,1787 ---- # Add before WikiWord inside text to prevent double links $theLinkText =~ s/([\s\(])([A-Z]+[a-z]+[A-Z])/$1$2/go; + # AndyPryke@AndyPryke.com (ANP) - reinsert spaces in WikiWords + if ($putSpacesBackIntoWikiWords) { + $theLinkText =~ s/([a-z])([A-Z])/$1 $2/go; + } + # end by AndyPryke + my $exist = &TWiki::Store::topicExists( $theWeb, $theTopic ); if( ( $doPluralToSingular ) && ( $theTopic =~ /s$/ ) && ! ( $exist ) ) { # page is a non-existing plural *************** *** 1763,1768 **** --- 1798,1814 ---- my $text = $thePreamble; if( $exist) { + if ($overrideUrlPrefix){ + $text .= "$theLinkText<\/a>"; + return $text; + } else { + $text .= "$theTopic\">$theLinkText<\/a>"; + return $text; + } + } else { if( $theAnchor ) { my $anchor = makeAnchorName( $theAnchor ); $text .= "$theLinkText<\/a>"; return $text; } ! } elsif( $doLink ) { $text .= "" . "$theLinkText" . "?"; --- 1819,1832 ---- . "$theWeb/$theTopic\">$theLinkText<\/a>"; return $text; } ! } } elsif( $doLink ) { + #Added by AndyPryke@AndyPryke.com (ANP) to allow hiding of "edit" links for publish/view-only website. + if ($hideAllEditLinks) { + $text .= "$theLinkText"; + return $text; + } + # else carry on as normal... $text .= "" . "$theLinkText" . "?";