source: greenstone3/trunk/web/interfaces/gs2/transform/style.xsl@ 17020

Last change on this file since 17020 was 17020, checked in by max, 16 years ago

Delete the HTML skeleton because it has been copied to other XSL files.

  • Property svn:keywords set to Author Date Id Revision
File size: 14.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <!-- some global parameters - these are set by whoever is invoking the transformation -->
10 <xsl:param name="interface_name"/>
11 <xsl:param name="library_name"/>
12
13 <!-- any global style stuff should go in here -->
14 <xsl:template name="globalStyle">
15 <link rel="stylesheet" href="interfaces/gs2/style/classic.css" type="text/css"/>
16 <link rel="stylesheet" href="interfaces/gs2/style/classic2.css" type="text/css"/>
17 </xsl:template>
18
19 <xsl:template name="greenstonePageBanner">
20 <div id="banner">
21 <div class="collectimage">
22 <img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:attribute>
23 </img>
24 </div>
25 </div>
26 <div class="bannerextra"></div>
27 <div id="content">
28 <xsl:call-template name="dividerBar">
29 <xsl:with-param name="text" select="'select a collection'"/>
30 </xsl:call-template>
31 </div>
32 </xsl:template>
33
34 <xsl:template name="genericPageBanner">
35 <xsl:param name='text'/>
36 <xsl:variable name="lang" select="/page/@lang"/>
37 <center>
38 <table width="100%">
39 <tr><td align="left"></td>
40 <td align="right">
41 <table>
42 <tr><td class="gsbutton">
43 <a class="gsbutton" href="{$library_name}?a=p&amp;sa=home">
44 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
45 </a>
46 </td></tr></table>
47 </td>
48 </tr>
49 </table>
50 </center>
51 <xsl:call-template name="dividerBar"><xsl:with-param name='text' select="$text"/></xsl:call-template>
52 </xsl:template>
53
54 <xsl:template name="standardPageBanner">
55 <xsl:param name="collName"/>
56 <xsl:param name="pageType"/>
57 <xsl:param name="clTop"/>
58 <xsl:variable name="this-element" select="/page/pageResponse/collection"/>
59 <div id="bannar">
60 <div class="pageinfo">
61 <xsl:call-template name="top-buttons">
62 <xsl:with-param name="collName" select="$collName"/>
63 <xsl:with-param name="pageType" select="$pageType"/>
64 </xsl:call-template>
65 <xsl:if test="not(/page/pageRequest/@action='d')">
66 <xsl:variable name="text">
67 <xsl:choose>
68 <xsl:when test="$pageType='browse'">
69 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier[@name=$clTop]/displayItem[@name='name']"/>
70 </xsl:when>
71 <xsl:otherwise>
72 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, concat($pageType, '_t'))"/>
73 </xsl:otherwise>
74 </xsl:choose>
75 </xsl:variable>
76 <xsl:if test="$text != '__t_'">
77 <p class="bannertitle"><xsl:value-of select="$text"/></p>
78 </xsl:if>
79 </xsl:if>
80 </div>
81
82 <div class="collectimage">
83 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
84 <xsl:choose>
85 <xsl:when test="$this-element/displayItem[@name='icon']">
86 <img border="0">
87 <xsl:attribute name="src">
88 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
89 </xsl:attribute>
90 <xsl:attribute name="alt">
91 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
92 </xsl:attribute>
93 <xsl:attribute name="title">
94 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
95 </xsl:attribute>
96 </img>
97 </xsl:when>
98 <xsl:otherwise>
99 <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
100 </xsl:otherwise>
101 </xsl:choose>
102 </a>
103 </div>
104 </div>
105 <div class="bannerextra"></div>
106 </xsl:template>
107
108 <xsl:template name="top-buttons">
109 <xsl:param name="collName"/>
110 <xsl:param name="pageType"/>
111 <p class="bannerlinks">
112 <a class="navlink" href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
113 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
114 </a>
115 <!-- <xsl:choose>
116 <xsl:when test="$pageType='help'">
117 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
118 </xsl:when>
119 <xsl:otherwise>
120 <a class="navlink" href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
121 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
122 </a>
123 </xsl:otherwise>
124 </xsl:choose> -->
125 <xsl:choose>
126 <xsl:when test="$pageType='pref'">
127 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
128 </xsl:when>
129 <xsl:otherwise>
130 <a class="navlink" href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
131 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
132 </a>
133 </xsl:otherwise>
134 </xsl:choose>
135 </p>
136 </xsl:template>
137
138 <xsl:template name="navigationBar">
139 <xsl:param name="collName"/>
140 <xsl:param name="clTop"/>
141 <xsl:variable name="this-element" select="/page/pageResponse/collection"/>
142 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
143 <xsl:variable name="classifiers" select="$this-element/serviceList/service[@name='ClassifierBrowse']/classifierList[1]"/>
144
145 <!-- display order, for Arabic etc. languages, display right to left -->
146 <xsl:variable name="dir"><xsl:call-template name="direction"/></xsl:variable>
147 <xsl:variable name="sort_order"><xsl:choose><xsl:when test="$dir='rtl'">descending</xsl:when><xsl:otherwise>ascending</xsl:otherwise></xsl:choose></xsl:variable>
148
149 <div class="navbar">
150 <p class="navbar">
151 <xsl:choose>
152 <xsl:when test="not($dir='rtl')">
153 <xsl:if test="$this-element/serviceList/service[@type='query']">
154 <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
155 </xsl:if>
156 </xsl:when>
157 <xsl:otherwise>
158 <xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
159 <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
160 </xsl:if>
161 </xsl:otherwise>
162 </xsl:choose>
163
164 <xsl:for-each select="$classifiers/classifier">
165 <xsl:sort order="{$sort_order}" select="position()" />
166 <xsl:apply-templates select="." mode="navbar">
167 <xsl:with-param name="collName" select="$collName"/>
168 <xsl:with-param name="clTop" select="$clTop"/>
169 </xsl:apply-templates>
170 </xsl:for-each>
171
172 <xsl:choose>
173 <xsl:when test="$dir='rtl'">
174 <xsl:if test="$this-element/serviceList/service[@type='query']">
175 <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
176 </xsl:if>
177 </xsl:when>
178 <xsl:otherwise>
179 <xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
180 <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
181 </xsl:if>
182 </xsl:otherwise>
183 </xsl:choose>
184 </p>
185 </div>
186 </xsl:template>
187
188 <xsl:template name="navbar-search">
189 <xsl:param name="collName"/>
190 <xsl:choose>
191 <xsl:when test="/page/pageRequest/@action='q'">
192 <span class="narspace">search</span>
193 </xsl:when>
194 <xsl:otherwise>
195 <xsl:variable name="service">
196 <xsl:choose>
197 <xsl:when test="not(/page/pageRequest/paramList/param[@name='ct'])">TextQuery</xsl:when>
198 <xsl:when test="/page/pageRequest/paramList/param[@name='ct']/@value='0'">TextQuery</xsl:when>
199 <xsl:when test="/page/pageRequest/paramList/param[@name='qt']/@value='1'"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfm']/@value='1'">AdvancedFieldQuery</xsl:when><xsl:otherwise>FieldQuery</xsl:otherwise></xsl:choose></xsl:when>
200 <xsl:otherwise>TextQuery</xsl:otherwise>
201 </xsl:choose>
202 </xsl:variable>
203 <a class="navlink" href="{$library_name}?a=q&amp;rt=d&amp;s={$service}&amp;c={$collName}"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name=$service]/displayItem[@name='description']"/></xsl:attribute>search</a>
204 </xsl:otherwise>
205 </xsl:choose>
206 </xsl:template>
207
208 <xsl:template name="navbar-phind">
209 <xsl:param name="collName"/>
210 <xsl:choose>
211 <xsl:when test="/page/pageRequest/paramList/param[@name='s']/@value='PhindApplet'">
212 <span class="narspace">phrases</span>
213 </xsl:when>
214 <xsl:otherwise>
215 <a class="navlink" href="{$library_name}?a=a&amp;rt=d&amp;s=PhindApplet&amp;c={$collName}"><xsl:if test="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"/></xsl:attribute></xsl:if>phrases</a>
216 </xsl:otherwise>
217 </xsl:choose>
218 </xsl:template>
219
220 <xsl:template match="classifier" mode="navbar">
221 <xsl:param name="collName"/>
222 <xsl:param name="clTop"/>
223 <xsl:choose>
224 <xsl:when test="/page/pageRequest/@action='b' and $clTop=@name">
225 <span class="narspace"><xsl:value-of select="displayItem[@name='name']"/></span>
226 </xsl:when>
227 <xsl:otherwise>
228 <a class="navlink" href="{$library_name}?a=b&amp;rt=r&amp;s=ClassifierBrowse&amp;c={$collName}&amp;cl={@name}"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute><xsl:value-of select="displayItem[@name='name']"/></a>
229 </xsl:otherwise>
230 </xsl:choose>
231 </xsl:template>
232
233 <xsl:template name="dividerBar">
234 <xsl:param name='text'/>
235 <xsl:choose>
236 <xsl:when test="$text">
237 <div class="divbar"><p class="navbar"><xsl:value-of select="$text"/></p></div>
238 </xsl:when>
239 <xsl:otherwise>
240 <div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
241 </xsl:otherwise>
242 </xsl:choose>
243 </xsl:template>
244
245 <xsl:template name="nzdlPageBanner">
246 <div><img src="interfaces/nzdl/images/nzdl2gr.gif" width="457" height="181" ><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></xsl:attribute></img></div>
247 <!-- end of page banner -->
248 </xsl:template>
249
250 <xsl:template name="greenstoneFooter">
251 <div class="divbar"><p class="navbar">powered by greenstone3</p>
252 </div>
253 </xsl:template>
254
255 <xsl:template name="imagegreenstone">
256 <img src="interfaces/nzdl/images/gsdl.gif" width="140" height="77" border="0" hspace='0'><xsl:attribute name='alt'><xsl:call-template name='textimagegreenstone'/></xsl:attribute></img>
257 </xsl:template>
258
259 <!-- Display the appropriate image, depending on the node type -->
260 <xsl:template match="documentNode" mode="displayNodeIcon">
261
262 <!-- Root node: book icon (open or closed) -->
263 <xsl:choose>
264 <xsl:when test="@nodeType='root'">
265 <xsl:choose>
266 <xsl:when test="documentNode">
267 <xsl:call-template name="openbookimg">
268 <xsl:with-param name="title">Close this book</xsl:with-param>
269 </xsl:call-template>
270 </xsl:when>
271 <xsl:otherwise>
272 <xsl:call-template name="closedbookimg">
273 <xsl:with-param name="title">Open this document and view contents</xsl:with-param>
274 </xsl:call-template>
275 </xsl:otherwise>
276 </xsl:choose>
277 </xsl:when>
278
279 <!-- Internal node: folder icon (open or closed) -->
280 <xsl:when test="@nodeType='internal'">
281 <xsl:choose>
282 <xsl:when test="documentNode">
283 <xsl:call-template name="openfolderimg">
284 <xsl:with-param name="title">Close this folder</xsl:with-param>
285 </xsl:call-template>
286 </xsl:when>
287 <xsl:otherwise>
288 <xsl:call-template name="closedfolderimg">
289 <xsl:with-param name="title">Open this folder and view contents</xsl:with-param>
290 </xsl:call-template>
291 </xsl:otherwise>
292 </xsl:choose>
293 </xsl:when>
294
295 <!-- Leaf node: page icon, and this is the default -->
296 <xsl:otherwise>
297 <xsl:call-template name="textpageimg">
298 <xsl:with-param name="title">View the document</xsl:with-param>
299 </xsl:call-template>
300 </xsl:otherwise>
301 </xsl:choose>
302 </xsl:template>
303
304
305 <xsl:template name="openbookimg">
306 <xsl:param name="alt"/>
307 <xsl:param name="title"/>
308 <img border="0" width="28" height="23"
309 src="interfaces/default/images/openbook.gif"
310 alt="{$alt}" title="{$title}"/>
311 </xsl:template>
312
313 <xsl:template name="closedbookimg">
314 <xsl:param name="alt"/>
315 <xsl:param name="title"/>
316 <img border="0" width="18" height="11"
317 src="interfaces/default/images/book.gif"
318 alt="{$alt}" title="{$title}"/>
319 </xsl:template>
320
321 <xsl:template name="openfolderimg">
322 <xsl:param name="alt"/>
323 <xsl:param name="title"/>
324 <img border="0" width="23" height="15"
325 src="interfaces/default/images/openfldr.gif"
326 alt="{$alt}" title="{$title}"/>
327 </xsl:template>
328
329 <xsl:template name="closedfolderimg">
330 <xsl:param name="alt"/>
331 <xsl:param name="title"/>
332 <img border="0" width="23" height="15"
333 src="interfaces/default/images/clsdfldr.gif"
334 alt="{$alt}" title="{$title}"/>
335 </xsl:template>
336
337 <xsl:template name="textpageimg">
338 <xsl:param name="alt"/>
339 <xsl:param name="title"/>
340 <img border="0" width="16" height="21"
341 src="interfaces/default/images/itext.gif"
342 alt="{$alt}" title="{$title}"/>
343 </xsl:template>
344
345 <xsl:template name="bookshelfimg">
346 <xsl:param name="alt"/>
347 <xsl:param name="title"/>
348 <img border="0" width="20" height="16"
349 src="interfaces/default/images/bshelf.gif"
350 alt="{$alt}" title="{$title}"/>
351 </xsl:template>
352
353 <xsl:template name="iconpdf">
354 <xsl:param name="alt">PDF</xsl:param>
355 <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonpdf')"/></xsl:param>
356 <img border="0" width='26' height='26'
357 src='interfaces/default/images/ipdf.gif'
358 alt='{$alt}' title='{$title}'/>
359 </xsl:template>
360
361 <xsl:template name="icondoc">
362 <xsl:param name="alt">Word</xsl:param>
363 <xsl:param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'texticonmsword')"/></xsl:param>
364 <img border="0" width='26' height='26'
365 src='interfaces/default/images/imsword.gif'
366 alt='{$alt}' title='{$title}'/>
367 </xsl:template>
368
369 <xsl:template name="direction">
370 <xsl:if test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:if>
371 </xsl:template>
372
373</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.