|
|
 |
 |
 |
manilaSuite.staticRendering.drawNavigatorWithFiltering
Userland made a design decision that statically rendered sites would never need upper or mixed case urls. This is not true in our experience, and we had to support the users choice of case for his urls.
This patch restores that ability by honouring the lowercasefilename directive (which in userland static Manila websites is always true).
The Manila Managing Editor can use the "ManilaFixer Plugin" to change this preference in his site.
Amended Script
| on drawNavigatorWithFiltering (pta=nil) |
| |
«Draw the navigator links. The current page should be disabled. |
| |
local (adrNewsSite = parentOf (pta^.adrSiteRootTable^)) |
| |
local (adrManilaSite = parentOf (adrNewsSite^)) |
| |
local (adrNavigator = @adrManilaSite^.["#navigator"]) |
| |
local (lowerUri = string.lower (pta^.uri)) |
| |
local (flEditor = manilaSuite.editors.editorialTest (pta)) |
| |
local (itemFormat, separatorFormat) |
| |
local (flJavaScriptUsed = false) |
| |
local (defaultFilename = manilaSuite.staticRendering.getDefaultFilename ()) |
| |
local (staticSuffix = manilaSuite.staticRendering.getSuffix ()) |
| |
local (staticDefaultFile = string.lower (defaultFilename + staticSuffix)) |
| |
local (dynamicUrl = adrManilaSite^.["#ftpSite"].url) |
| |
local (staticUrl = pta^.ftpSite^.url) |
| |
local (dynamicUri, staticUri) |
| |
local (dynamicServer, staticServer) |
| |
bundle //get the dynamic and static uris |
| |
bundle //get the format for items and separators |
| |
on addLink (url, linetext, adrItem) //add a link, enabling or disabling as needed |
| |
local (lowerUrl = string.lower (url)) |
| |
bundle //if it's a dynamic-only link, link to the dynamic page |
| |
«if lowerUrl contains "/discuss/" or lowerUrl contains "/stories/" |
| |
local (originalUrl = url) |
| |
bundle //translate url for static rendering |
| |
«url = string.replace (url, dynamicUrl, staticUrl, false) |
| |
«if (url == originalUrl) and (url beginsWith "http://") |
| |
url = string.replace (url, dynamicUri, staticUri, false) |
| |
local (convertedUrl = url) //PBS 10/22/01: make sure static links are disabled properly |
| |
if string.lower (convertedUrl) endsWith string.lower (staticSuffix) |
| |
convertedUrl = string.lower (manilaSuite.staticRendering.convertUrl (convertedUrl)) |
| |
if (string.lower (url) == convertedUrl) |
| |
if url != originalUrl or (not (url beginsWith "http://")) //did the URL get filtered? It's local, add .html suffix. |
| |
«url = string.lower (url) |
| |
if html.getPref("lowercasefilenames", pta) //01/02/26, 20:36:00 by DAB |
| |
url = manilaSuite.staticRendering.convertUrl (url) |
| |
local (strippedPageName = string.lower (url)) |
| |
local (strippedUri = lowerUri) |
| |
if strippedPageName beginsWith "http://" |
| |
if strippedUri == strippedPageName |
| |
if strippedPageName endsWith "/" + staticDefaultFile |
| |
if defined (pta^.pathArgs) and pta^.pathArgs != "" |
| |
if strippedUri endsWith "/" + staticDefaultFile |
| |
if strippedUri contains "/" and not (strippedPageName contains "/") |
| |
«Add the link, enabled or disabled. |
| |
if strippedUri == strippedPageName // was: if pta^.uri == pagename: PBS 5/21/99 |
| |
bundle //compile the xml text if it's been modified |
| |
for i = 1 to sizeOf (adrNavigator^.structure [1]) //loop through the links table |
| |
bundle //remove the last separator |
| |
htmlText = manilaSuite.unTaint (htmlText) //there should be curly brace macros here |
| |
bundle //strip in the rollover JavaScript |
Relative to Frontier version 9.7b10
|