4 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6 <xsl:import href="utils.xsl"/>
8 <xsl:output method="html" encoding="iso-8859-1"/>
10 <!-- uri must end with '/' -->
11 <xsl:param name="uri" select="''"/>
12 <xsl:param name="keys" select="''"/>
13 <xsl:param name="getterURL" select="''"/>
14 <xsl:param name="interfaceURL" select="''"/>
15 <xsl:param name="target" select="''"/>
17 <xsl:template name="chop">
18 <xsl:param name="uri" select="''"/>
19 <xsl:param name="prefix" select="''"/>
20 <xsl:variable name="newprefix" select="substring-before($uri,'/')"/>
22 <xsl:when test="$newprefix = ''"><xsl:value-of select="$prefix"/></xsl:when>
24 <xsl:call-template name="chop">
25 <xsl:with-param name="uri" select="substring-after($uri,'/')"/>
26 <xsl:with-param name="prefix" select="concat($prefix,$newprefix,'/')"/>
32 <xsl:variable name="uridotdot">
33 <xsl:call-template name="chop">
34 <xsl:with-param name="uri" select="substring($uri,1,string-length($uri)-1)"/>
38 <xsl:template name="makeDir">
39 <xsl:param name="uri" select="''"/>
40 <xsl:param name="basename" select="''"/>
41 <xsl:param name="icon" select="''"/>
42 <xsl:param name="alt" select="''"/>
45 <img border="0" src="{concat($interfaceURL,'/icons/',$icon)}" alt="[{$alt}]"/>
48 <xsl:variable name="quoteduri">
49 <xsl:call-template name="jsquote">
50 <xsl:with-param name="s" select="$uri"/>
55 "top.{$target}uri='{$quoteduri}';
56 refresh{$target}Header('{$interfaceURL}/html/library/header.html');
57 var search='?keys={$keys}' +
58 '&xmluri=' + escape('{$getterURL}ls?format=xml'+'&baseuri={$quoteduri}')+
59 '&param.uri={$quoteduri}' +
60 '&param.keys={$keys}' +
61 '&param.getterURL={$getterURL}' +
62 '&param.target={$target}' +
63 '&param.interfaceURL={$interfaceURL}';
64 var pathname = this.pathname;
65 if (pathname.charAt(0) != '/')
66 pathname = '/' + pathname;
68 this.protocol + '//' + this.host + pathname + search + this.hash;"
69 onMouseOver="window.status='{$quoteduri}'; return true"
71 ><xsl:value-of select="$basename"/></a>
76 <xsl:template match="/">
79 <title>Index of <xsl:value-of select="$uri"/></title>
80 <xsl:copy-of select="document(concat($interfaceURL,'/javascript/control.js_xml'))" />
81 <xsl:copy-of select="document(concat($interfaceURL,'/javascript/utils.js_xml'))" />
83 <body bgcolor="#ffffff" text="#000000">
85 <xsl:if test="$uridotdot != ''">
86 <xsl:call-template name="makeDir">
87 <xsl:with-param name="uri" select="$uridotdot"/>
88 <xsl:with-param name="basename" select="'Parent Directory'"/>
89 <xsl:with-param name="icon" select="'back.gif'"/>
90 <xsl:with-param name="alt" select="'Parent Directory'"/>
93 <xsl:apply-templates select="*"/>
95 <hr noshade="yes" align="left" width="80%"/>
100 <xsl:template match="section">
101 <xsl:variable name="diruri">
102 <xsl:value-of select="."/>
104 <xsl:call-template name="makeDir">
105 <xsl:with-param name="uri" select="concat($uri,$diruri,'/')"/>
106 <xsl:with-param name="basename" select="$diruri"/>
107 <xsl:with-param name="icon" select="'folder.gif'"/>
108 <xsl:with-param name="alt" select="$uri"/>
112 <xsl:template match="object">
113 <xsl:variable name="name" select="@name"/>
114 <xsl:variable name="ann" select="ann/@value"/>
115 <xsl:variable name="types" select="types/@value"/>
116 <xsl:variable name="body" select="body/@value"/>
117 <xsl:variable name="icon">
119 <xsl:when test="$ann = 'YES'">text.gif</xsl:when>
120 <xsl:otherwise>generic.red.gif</xsl:otherwise>
125 <img border="0" src="{concat($interfaceURL,'/icons/',$icon)}" alt="[{@name}]"/>
128 <xsl:variable name="quoteduri">
129 <xsl:call-template name="jsquote">
130 <xsl:with-param name="s" select="$uri"/>
133 <xsl:variable name="quotedname">
134 <xsl:call-template name="jsquote">
135 <xsl:with-param name="s" select="$name"/>
138 <xsl:variable name="quotedbodyname">
139 <xsl:call-template name="jsquote">
140 <xsl:with-param name="s" select="concat($name,'.body')"/>
143 <a href="" target="{$target}"
144 onClick="this.href=makeURL('{$target}','{concat($quoteduri,$quotedname)}','{$ann}','{$types}')"
145 onMouseOver="window.status='{concat($quoteduri,$quotedname)}'; return true"
146 ><xsl:value-of select="$name"/></a>
147 <xsl:if test="not($body='NO')">
148 <xsl:text> </xsl:text>
149 <a href="" target="{$target}"
150 onClick="this.href=makeURL('{$target}','{concat($quoteduri,$quotedbodyname)}','{$ann}','{$types}')"
151 onMouseOver="window.status='{concat($quoteduri,$quotedname)}'; return true"