source: main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl@ 33261

Last change on this file since 33261 was 33261, checked in by davidb, 5 years ago

XSL changes to support for either berries or favourites

File size: 47.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
5 xmlns:gslib="http://www.greenstone.org/XSL/Library"
6 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
7 xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
8 xmlns:gs3="http://www.greenstone.org/gs3"
9 xmlns:xlink="http://www.w3.org/1999/xlink"
10 xmlns:gsvar="http://www.greenstone.org/skinning-var"
11 exclude-result-prefixes="util xalan gslib gsf xslt gs3 gsvar xlink">
12<!-- all namespaces used by greenstone should be defined here and listed in exclude-result-prefixes, including those in core/transform/preProcess.xsl, otherwise xmlns attributes will be included in the html output -->
13
14 <!-- force lower priority on xsl:output, so other files like rss.xsl can override with their own xsl:output stmt
15 If other files don't specify any, gslib.xsl specifies html output as default and defines a loose DOCTYPE for it. -->
16 <xsl:import href="html-output.xsl" />
17
18 <xsl:include href="xml-to-string.xsl"/>
19
20 <!-- some global parameters - these are set by whoever is invoking the transformation
21 Any servlet init parameters can be accessed by adding a param here-->
22 <xsl:param name="interface_name"/>
23 <xsl:param name="library_name"/>
24 <xsl:param name="site_name"/>
25 <xsl:param name="use_client_side_xslt"/>
26 <xsl:param name="filepath"/>
27 <xsl:param name="google_tracking_id"/>
28
29 <xsl:variable name="berry_icon">berry.png</xsl:variable>
30 <xsl:variable name="unselected_favourite_icon">favourite-star-transparent-unselected32.png</xsl:variable>
31 <xsl:variable name="selected_favourite_icon">favourite-star-transparent-selected32.png</xsl:variable>
32
33 <!-- every pages ....................................................................... -->
34
35 <xsl:template name="siteName">
36 <xsl:value-of select="/page/pageResponse/displayItemList/displayItem[@name='siteName']"/>
37 </xsl:template>
38
39 <xsl:template name="siteDescription">
40 <xsl:value-of select="/page/pageResponse/displayItemList/displayItem[@name='siteDescription']"/>
41 </xsl:template>
42
43 <xsl:template name="siteLink">
44 <a href="./{$library_name}">
45 <xsl:call-template name="siteName"/>
46 </a>
47 <xsl:text> </xsl:text>
48 </xsl:template>
49
50 <xsl:variable name="a">
51 <xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/>
52 </xsl:variable>
53
54 <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
55
56 <xsl:variable name="berrybasketswitch">
57 <xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/>
58 </xsl:variable>
59 <xsl:variable name="favouritesbasketswitch">
60 <xsl:value-of select="/page/pageRequest/paramList/param[@name='favouritesbasket']/@value"/>
61 </xsl:variable>
62
63 <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
64 <xsl:variable name="favouritesBasketOn" select="/page/pageRequest/paramList/param[@name='favouritesbasket' and @value='on']"/>
65 <xsl:variable name="documentBasketOn" select="/page/pageRequest/paramList/param[@name='documentbasket' and @value='on']"/>
66
67 <xsl:variable name="thisCollectionEditor">
68 <xsl:value-of select="/page/pageRequest/paramList/param[@name = 'c']/@value"/>
69 <xsl:text>-collection-editor</xsl:text>
70 </xsl:variable>
71
72 <!-- template to get the name of the current collection -->
73 <xsl:template name="collectionName">
74 <xsl:choose>
75 <xsl:when test="/page/pageResponse/collection/displayItemList/displayItem[@name='name']">
76 <xsl:value-of select="/page/pageResponse/collection/displayItemList/displayItem[@name='name']"/>
77 </xsl:when>
78 <xsl:when test="/page/pageResponse/collection/@name">
79 <xsl:value-of select="/page/pageResponse/collection/@name"/>
80 </xsl:when>
81 </xsl:choose>
82 </xsl:template>
83
84 <!-- template to get the name of the current collection or 'all collections' if not in a specific collection -->
85 <xsl:template name="collectionNameOrAll">
86 <xsl:choose>
87 <xsl:when test="/page/pageResponse/collection">
88 <xsl:value-of select="/page/pageResponse/collection/displayItemList/displayItem[@name='name']"/>
89 </xsl:when>
90 <xsl:otherwise>All Collections</xsl:otherwise>
91 </xsl:choose>
92 </xsl:template>
93
94 <xsl:template name="collectionNameShort">
95 <xsl:value-of select="/page/pageResponse/collection/@name"/>
96 </xsl:template>
97 <xsl:template name="collectionNameLinked">
98 <xsl:if test="/page/pageResponse/collection">
99 <a>
100 <xsl:attribute name="href">./<xsl:value-of select="$library_name"/>/collection/<xsl:call-template name="collectionNameShort"/>/page/about</xsl:attribute>
101 <xsl:call-template name="collectionName"/>
102 </a>
103 </xsl:if>
104 </xsl:template>
105
106 <xsl:template name="collectionMeta">
107 <xsl:param name="name"/>
108 <xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name=$name]"/>
109 </xsl:template>
110
111 <!-- text to get the name of the current service ("Browse","Search" etc) -->
112 <xsl:template name="serviceName">
113 <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
114 </xsl:template>
115
116 <xsl:template name="textDirectionAttribute">
117 <xsl:attribute name="dir">
118 <xsl:choose>
119 <xsl:when 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:when>
120 <xsl:otherwise>ltr</xsl:otherwise>
121 </xsl:choose>
122 </xsl:attribute>
123 </xsl:template>
124
125 <xsl:template name="actionClass">
126 <xsl:attribute name="class"><xsl:value-of select="/page/pageRequest/@action"/>Action <xsl:if test="/page/pageRequest/@subaction"><xsl:value-of select="/page/pageRequest/@subaction"/>Subaction</xsl:if></xsl:attribute>
127 </xsl:template>
128 <!-- username, if logged in -->
129 <!--
130 <xsl:template name="username">
131 <xsl:if test="$un_s!=''">
132 <xsl:if test="$asn!='' and $asn!='0'">
133 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/> : <xsl:value-of select="$un_s"/>
134 </xsl:if>
135 </xsl:if>
136 </xsl:template>
137 -->
138 <xsl:template name="defaultDividerBar">
139 <xsl:param name="text"/>
140 <xsl:choose>
141 <xsl:when test="$text">
142 <div class="divbar">
143 <xsl:value-of select="$text"/>
144 </div>
145 </xsl:when>
146 <xsl:otherwise>
147 <div class="divbar">
148 <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
149 </div>
150 </xsl:otherwise>
151 </xsl:choose>
152 </xsl:template>
153
154 <xsl:template match="error">
155 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'error')"/> <xsl:value-of select="."/>
156 </xsl:template>
157 <xsl:template name="displayErrorsIfAny">
158 <xsl:if test="descendant::error">
159 <script language="Javascript">
160 <xsl:text disable-output-escaping="yes">
161 function removeAllChildren(node) {
162 while (node.hasChildNodes()) {
163 node.removeChild(node.firstChild);
164 }
165 }
166
167 function toggleHideError(obj) {
168 if (obj.style.display == "none") {
169 obj.style.display = "";
170 hide_link = document.getElementById("hide");
171 removeAllChildren(hide_link);
172 hide_link.appendChild(document.createTextNode("</xsl:text>
173 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/>
174 <xsl:text disable-output-escaping="yes">"));
175 } else {
176 obj.style.display = "none";
177 hide_link = document.getElementById("hide");
178 removeAllChildren(hide_link);
179 hide_link.appendChild(document.createTextNode("</xsl:text>
180 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/>
181 <xsl:text disable-output-escaping="yes">"));
182 }
183 }
184 </xsl:text>
185 </script>
186 <p align="right">
187 <a id="hide" href="javascript:toggleHideError(error);">
188 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/>
189 </a>
190 </p>
191 <div id="error" style="display: none;">
192 <xsl:apply-templates select="descendant::error"/>
193 </div>
194 </xsl:if>
195 </xsl:template>
196
197 <xsl:template name="noTextBar">
198 <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text><!-- could also be expressed &#160; -->
199 </xsl:template>
200
201 <xsl:template name="poweredByGS3TextBar">
202 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
203 </xsl:template>
204
205 <xsl:template name="rightArrow">
206 <xsl:text disable-output-escaping="yes"> » </xsl:text> <!-- could also be expressed &amp;raquo; or &#187; but prefer literal UTF8 char so it renders correctly if used in title of browser-tab -->
207 </xsl:template>
208
209 <!-- site home ....................................................................... -->
210 <xsl:template name="siteHomePageTitle">
211 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
212 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
213 <xsl:text> </xsl:text>
214 </xsl:template>
215
216 <xsl:template name="selectACollectionTextBar">
217 <xsl:choose>
218 <xsl:when test="/page/pageResponse/groupList/group and /page/pageResponse/collectionList/collection">
219 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection_or_group')"/>
220 </xsl:when>
221 <xsl:when test="/page/pageResponse/groupList/group">
222 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_group')"/>
223 </xsl:when>
224 <xsl:when test="/page/pageResponse/collectionList/collection">
225 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
226 </xsl:when>
227 <xsl:otherwise>
228 <xsl:choose>
229 <xsl:when test="/page/pageResponse/pathList/group">
230 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections_group')"/>
231 </xsl:when>
232 <xsl:otherwise>
233 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections')"/>
234 </xsl:otherwise>
235 </xsl:choose>
236 </xsl:otherwise>
237 </xsl:choose>
238 </xsl:template>
239
240 <xsl:template name="crossCollectionQuickSearchForm">
241 <xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
242 </xsl:template>
243
244 <xsl:template match="service[@name='TextQuery']">
245 <form name="QuickSearch" method="get" action="{$library_name}">
246 <input type="hidden" name="a" value="q"/>
247 <input type="hidden" name="rt" value="rd"/>
248 <input type="hidden" name="s" value="{@name}"/>
249 <xsl:choose>
250 <xsl:when test="/page/pageRequest/paramList/param[@name='group']/@value">
251 <input type="hidden" name="s1.group">
252 <xsl:attribute name="value">
253 <xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value" />
254 </xsl:attribute>
255 </input>
256 </xsl:when>
257 <xsl:otherwise>
258 <input type="hidden" name="s1.collection" value="all" />
259 </xsl:otherwise>
260 </xsl:choose>
261 <input type="text" name="s1.query" size="20"/>
262 <input type="submit">
263 <xsl:attribute name="value">
264 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/>
265 </xsl:attribute>
266 </input>
267 </form>
268 </xsl:template>
269
270 <xsl:template name="groupName">
271 <xsl:param name="path"/>
272 <xsl:value-of select="/page/pageResponse/pathList/group[@path=$path]/title"/>
273 </xsl:template>
274 <xsl:template name="groupDescription">
275 <xsl:param name="path"/>
276 <xsl:value-of select="/page/pageResponse/pathList/group[@path=$path]/description"/>
277 </xsl:template>
278
279 <xsl:template name="groupHref">
280 <xsl:param name="path"/>
281 <xsl:value-of select="$library_name"/>/group/<xsl:value-of select="@path"/>
282 </xsl:template>
283
284 <xsl:template name="groupLinkWithImage">
285 <xsl:variable name="desc"><xsl:value-of select="description"/></xsl:variable>
286 <xsl:variable name="group_href"><xsl:value-of select="$library_name"/>/group/<xsl:if test="/page/pageRequest/paramList/param[@name='group']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/</xsl:if><xsl:value-of select="@name"/></xsl:variable>
287
288 <xsl:choose>
289 <xsl:when test="util:checkFileExistence($site_name, backgroundImage)">
290 <a href="{$group_href}" title="{$desc}">
291 <img class="groupLinkImage">
292 <xsl:attribute name="alt"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:attribute>
293 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/<xsl:value-of select="backgroundImage"/></xsl:attribute>
294 </img>
295 </a>
296 </xsl:when>
297 <xsl:otherwise>
298 <a href="{$group_href}" title="{$desc}">
299 <div class="groupLink ui-corner-all">
300 <div class="groupLinkText ui-widget-content ui-corner-top">
301 <xsl:choose>
302 <xsl:when test="boolean(title)">
303 <xsl:value-of select="title"/>
304 </xsl:when>
305 <xsl:otherwise>
306 <xsl:value-of select="@name"/>
307 </xsl:otherwise>
308 </xsl:choose>
309 </div>
310 <div style="height:15px;" class="ui-state-default ui-corner-bottom"><xsl:text> </xsl:text></div>
311 </div>
312 </a>
313 </xsl:otherwise>
314 </xsl:choose>
315 </xsl:template>
316
317 <xsl:template name="collectionLinkWithImage">
318 <xsl:variable name="desc"><xsl:value-of select="displayItemList/displayItem[@name='shortDescription']"/></xsl:variable>
319 <xsl:variable name="coll_href"><xsl:value-of select="$library_name"/>/collection/<xsl:if test="/page/pageRequest/paramList/param[@name='group']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/>/</xsl:if><xsl:value-of select="@name"/>/page/about<xsl:choose><xsl:when test="libraryParamList/param">?<xsl:for-each select="libraryParamList/param"><xsl:value-of select="@name"/>=<xsl:value-of select="@default"/>&amp;</xsl:for-each></xsl:when></xsl:choose></xsl:variable>
320 <xsl:choose>
321 <xsl:when test="displayItemList/displayItem[@name='smallicon']">
322 <a href="{$coll_href}" title="{$desc}">
323 <img class="collectionLinkImage">
324 <xsl:attribute name="alt"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:attribute>
325 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="displayItemList/displayItem[@name='smallicon']"/></xsl:attribute>
326 </img>
327 </a>
328 </xsl:when>
329 <xsl:otherwise>
330 <a href="{$coll_href}" title="{$desc}">
331 <div class="collectionLink ui-corner-all">
332 <div class="collectionLinkText ui-widget-content ui-corner-top">
333 <xsl:choose><xsl:when test="displayItemList/displayItem[@name='name']"><xsl:value-of select="displayItemList/displayItem[@name='name']"/></xsl:when>
334 <xsl:otherwise>
335 <xsl:value-of select="@name"/>
336 </xsl:otherwise>
337 </xsl:choose>
338
339 </div>
340 <div style="height:15px;" class="ui-state-default ui-corner-bottom"><xsl:text> </xsl:text></div>
341 </div>
342 </a>
343 </xsl:otherwise>
344 </xsl:choose>
345 </xsl:template>
346
347 <xsl:template name="serviceClusterList">
348 <xsl:apply-templates select="serviceClusterList"/>
349 </xsl:template>
350
351 <xsl:template match="serviceClusterList">
352 <xsl:for-each select="serviceCluster">
353 <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
354 <xsl:value-of select="@name"/>
355 <xsl:value-of select="displayItemList/displayItem[@name='name']"/>
356 </a>
357 </xsl:for-each>
358 </xsl:template>
359
360 <xsl:template name="serviceLink">
361 <div class="paramLabel">
362 <a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}">
363 <xsl:value-of select="displayItem[@name='name']"/>
364 </a>
365 </div>
366 <div class="paramValue">
367 <xsl:value-of select="displayItem[@name='description']"/>
368 </div>
369 <br class="clear"/>
370 </xsl:template>
371
372 <xsl:template name="authenticationLink">
373 <xsl:for-each select="//serviceList/service[@type='authen']">
374 <div class="paramLabel">
375 <a href="{$library_name}/admin/ListUsers">
376 <xsl:value-of select="displayItem[@name='name']"/>
377 </a>
378 </div>
379 <div class="paramValue">
380 <xsl:value-of select="displayItem[@name='description']"/>
381 </div>
382 </xsl:for-each>
383 </xsl:template>
384
385 <xsl:template name="registerLink">
386 <xsl:for-each select="//serviceList/service[@type='authen']">
387 <div class="paramLabel">
388 <a href="{$library_name}/admin/Register"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.register')"/>
389 </a>
390 </div>
391 <div class="paramValue">
392<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.register_as_new')"/>
393 </div>
394 </xsl:for-each>
395 </xsl:template>
396
397 <xsl:template name="aboutGreenstoneLink">
398
399 <div class="paramLabel">
400 <a href="{$library_name}?a=p&amp;sa=gsdl"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl.title')"/></a>
401 </div>
402 <div class="paramValue">
403 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl.brief')"/>
404 </div>
405 </xsl:template>
406
407 <xsl:template name="libraryInterfaceLink">
408 <div class="paramLabel">
409 <!--
410 Using HTML5 download attribute to anchor tag, providing download-as-filename value, so Gli App JNLP file downloads.
411 Seems we don't need to set the MIME type for downloaded JNLP to launch, if program associations are correctly set up.
412 -->
413 <a href="{$library_name}?a=p&amp;sa=gli4gs3" download="GLIappWebStart.jnlp">
414 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/>
415 </a>
416 </div>
417 <div class="paramValue">
418 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.gliapp_webstart')"/>
419 </div>
420 </xsl:template>
421
422 <xsl:template name="greenstoneLogoAlternateText">
423 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
424 </xsl:template>
425
426 <!-- about page - collection home ....................................................................... -->
427 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
428 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
429 <xsl:variable name="siteName" select="$site_name"/>
430 <!--
431 Already defined above as a variable, not sure why if way being defined here again as a 'param'
432 <xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
433 -->
434 <xsl:param name="pageType"/>
435 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
436 <xsl:variable name="this-service" select="/page/pageRequest/paramList/param[@name = 's']/@value"/>
437
438<!--
439_httpimages_ {_httpweb_/images}
440_httpscript_ {_httpweb_/script}
441_httpstyle_ {_httpweb_/style}
442_httpflash_ {_httpweb_/flash}
443_httpjava_ {_httpweb_/java}
444-->
445
446
447 <xsl:template name="define-js-variable">
448 <xsl:param name="name"/>
449 <xsl:param name="value"/>
450 <script type="text/javascript">
451 gs.variables[<xslt:text disable-output-escaping="yes">"</xslt:text><xsl:value-of select="$name"/><xslt:text disable-output-escaping="yes">"</xslt:text>]
452 <xslt:text disable-output-escaping="yes"> = "</xslt:text>
453 <xsl:value-of select="$value"/>
454 <xslt:text disable-output-escaping="yes">";</xslt:text>
455 </script>
456 </xsl:template>
457
458 <xsl:variable name="_httpcollection_" select="$httpPath"/>
459 <xsl:variable name="_httpbrowse_"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/browse</xsl:variable>
460 <xsl:variable name="_httpquery_"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/search</xsl:variable>
461
462 <xsl:template name="define-js-macro-variables">
463
464 <xsl:call-template name="define-js-variable">
465 <xsl:with-param name="name" select="'_httpbrowse_'"/>
466 <xsl:with-param name="value" select="$_httpbrowse_"/>
467 </xsl:call-template>
468
469 <xsl:call-template name="define-js-variable">
470 <xsl:with-param name="name" select="'_httpquery_'"/>
471 <xsl:with-param name="value" select="$_httpquery_"/>
472 </xsl:call-template>
473
474 </xsl:template>
475
476
477 <xsl:template name="aboutCollectionPageTitle">
478 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
479 <xsl:value-of select="/page/pageResponse/collection/displayItemList/displayItem[@name='name']"/>
480 <xsl:text> </xsl:text>
481 </xsl:template>
482
483 <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
484 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
485 <xsl:choose>
486 <xsl:when test="$this-element/displayItemList/displayItem[@name='icon']">
487 <img border="0">
488 <xsl:attribute name="src"><xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItemList/displayItem[@name='icon']"/></xsl:attribute>
489 <xsl:attribute name="alt">
490 <xsl:value-of select="$this-element/displayItemList/displayItem[@name='name']"/>
491 </xsl:attribute>
492 <xsl:attribute name="title">
493 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
494 </xsl:attribute>
495 </img>
496 </xsl:when>
497 <xsl:otherwise>
498 <xsl:value-of select="$this-element/displayItemList/displayItem[@name='name']"/>
499 </xsl:otherwise>
500 </xsl:choose>
501 </a>
502 </xsl:template>
503
504 <xsl:template name="homeButtonTop">
505 <a href="{$library_name}?a=p&amp;sa=home">
506 <xsl:attribute name="title">
507 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/>
508 </xsl:attribute>
509 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
510 </a>
511 </xsl:template>
512
513 <xsl:template name="helpButtonTop">
514 <xsl:choose>
515 <xsl:when test="$pageType='help'">
516 <li>
517 <a>
518 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
519 </a>
520 </li>
521 </xsl:when>
522 <xsl:otherwise>
523 <li>
524 <a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}">
525 <xsl:attribute name="title">
526 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/>
527 </xsl:attribute>
528 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
529 </a>
530 </li>
531 </xsl:otherwise>
532 </xsl:choose>
533 </xsl:template>
534
535 <xsl:template name="preferencesButtonTop">
536 <xsl:choose>
537 <xsl:when test="$pageType='pref'">
538 <li>
539 <a>
540 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
541 </a>
542 </li>
543 </xsl:when>
544 <xsl:otherwise>
545 <li>
546 <a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}">
547 <xsl:attribute name="title">
548 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/>
549 </xsl:attribute>
550 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
551 </a>
552 </li>
553 </xsl:otherwise>
554 </xsl:choose>
555 </xsl:template>
556
557 <xsl:template name="servicesNavigationBar">
558 <xsl:for-each select="$this-element/serviceList/service">
559 <xsl:variable name="action">
560 <xsl:choose>
561 <xsl:when test="@name=$this-service">CURRENT</xsl:when>
562 <xsl:when test="@type='query'">q</xsl:when>
563 <xsl:when test="@type='browse'">b</xsl:when>
564 <xsl:when test="@type='process'">pr</xsl:when>
565 <xsl:when test="@type='applet'">a</xsl:when>
566 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
567 </xsl:choose>
568 </xsl:variable>
569 <xsl:choose>
570 <xsl:when test="$action='CURRENT'">
571 <li>
572 <a>
573 <xsl:value-of select="displayItem[@name='name']"/>
574 </a>
575 </li>
576 </xsl:when>
577 <xsl:when test="$action !='DO_NOT_DISPLAY'">
578 <li>
579 <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
580 <xsl:if test="displayItem[@name='description']">
581 <xsl:attribute name="title">
582 <xsl:value-of select="displayItem[@name='description']"/>
583 </xsl:attribute>
584 </xsl:if>
585 <xsl:value-of select="displayItem[@name='name']"/>
586 </a>
587 </li>
588 </xsl:when>
589 </xsl:choose>
590 </xsl:for-each>
591 </xsl:template>
592
593 <xsl:template name="collectionDescriptionTextAndServicesLinks">
594 <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
595 </xsl:template>
596
597 <xsl:template match="collection|serviceCluster">
598 <xsl:value-of select="displayItemList/displayItem[@name='description']" disable-output-escaping="yes"/>
599<!-- Uncomment this section if you want the collection service links and their descriptions to appear -->
600 <!--<xsl:apply-templates select="serviceList">
601 <xsl:with-param name="collName" select="$collName"/>
602 </xsl:apply-templates>-->
603 </xsl:template>
604
605 <xsl:template match="serviceList">
606 <xsl:param name="collName"/>
607 <h3>
608 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/>
609 </h3>
610 <p>
611 <xsl:choose>
612 <xsl:when test="service">
613 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
614 </xsl:when>
615 <xsl:otherwise>
616 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
617 </xsl:otherwise>
618 </xsl:choose>
619 </p>
620 <xsl:if test="service">
621 <div id="servicelist">
622 <xsl:for-each select="service">
623 <xsl:sort select="position()" order="descending" data-type="number"/>
624 <xsl:variable name="action">
625 <xsl:choose>
626 <xsl:when test="@type='query'">q</xsl:when>
627 <xsl:when test="@type='process'">pr</xsl:when>
628 <xsl:when test="@type='applet'">a</xsl:when>
629 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
630 </xsl:choose>
631 </xsl:variable>
632 <xsl:if test="$action != 'DO_NOT_DISPLAY'">
633 <div class="paramLabel">
634 <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
635 <xsl:value-of select="displayItem[@name='name']"/>
636 </a>
637 </div>
638 <div class="paramLabel">
639 <xsl:value-of select="displayItem[@name='description']"/>
640 </div>
641 <br class="clear"/>
642 </xsl:if>
643 </xsl:for-each>
644 </div>
645 </xsl:if>
646
647 </xsl:template>
648
649 <!-- classifier page ............................................................................ -->
650 <xsl:template name="collapsedNavigationTab">
651 <xsl:param name="type"/>
652 <xsl:variable name="isCurrent" select="/page/pageResponse/service[@type=$type]"/>
653 <li>
654 <xsl:if test="$isCurrent">
655 <xsl:attribute name="class">current</xsl:attribute>
656 </xsl:if>
657 <a>
658 <xsl:if test="service[@name=$type]/displayItem[@name='description']">
659 <xsl:attribute name="title">
660 <xsl:value-of select="service[@name=$type]/displayItem[@name='description']"/>
661 </xsl:attribute>
662 </xsl:if>
663 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=q&amp;rt=d&amp;s=<xsl:value-of select="service[@type=$type]/@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
664 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $type)"/>
665 </a>
666 </li>
667 </xsl:template>
668
669 <xsl:template name="navigationTab">
670 <xsl:variable name="isCurrent" select="@name=/page/pageResponse/service/@name"/>
671 <xsl:variable name="action">
672 <xsl:choose>
673 <xsl:when test="@type='query'">q</xsl:when>
674 <xsl:when test="@type='browse'">b</xsl:when>
675 <xsl:when test="@type='process'">pr</xsl:when>
676 <xsl:when test="@type='applet'">a</xsl:when>
677 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
678 </xsl:choose>
679 </xsl:variable>
680 <xsl:if test="$action!='DO_NOT_DISPLAY'">
681 <li>
682 <xsl:if test="$isCurrent">
683 <xsl:attribute name="class">current</xsl:attribute>
684 </xsl:if>
685 <a>
686 <xsl:if test="displayItem[@name='description']">
687 <xsl:attribute name="title">
688 <xsl:value-of select="displayItem[@name='description']"/>
689 </xsl:attribute>
690 </xsl:if>
691 <xsl:choose>
692 <xsl:when test="classifierList/classifier/@name">
693 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&amp;rt=s&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;cl=<xsl:value-of select="classifierList/classifier/@name"/></xsl:attribute>
694 </xsl:when>
695 <xsl:otherwise>
696 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&amp;rt=d&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
697 </xsl:otherwise>
698 </xsl:choose>
699 <xsl:value-of select="displayItem[@name='name']"/>
700 </a>
701 </li>
702 </xsl:if>
703 </xsl:template>
704
705 <xsl:template name="classifierLink">
706 <xsl:if test="@name=/page/pageResponse/classifier/@name">
707 <xsl:attribute name="class">current</xsl:attribute>
708 </xsl:if>
709 <a href="{$library_name}?a=b&amp;rt=r&amp;s={/page/pageResponse/service/@name}&amp;c={/page/pageResponse/collection/@name}&amp;cl={@name}">
710 <xsl:value-of select="displayItem[@name='description']"/>
711 </a>
712 </xsl:template>
713
714 <!-- query page ............................................................................ -->
715<!-- <xsl:template name="indexName">
716 <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
717 </xsl:template>
718
719 <xsl:template name="queryPageCollectionName">
720 <xsl:choose>
721 <xsl:when test="/page/pageResponse/collection">
722 <gslib:aboutCollectionPageTitle/>
723 </xsl:when>
724 <xsl:otherwise>Cross-Collection</xsl:otherwise>
725 </xsl:choose>
726 </xsl:template>-->
727
728 <!--
729BERRY BASKET TEMPLATES
730These get used on many different pages to add the
731berry basket function to the site
732-->
733 <!-- put the drag&drop berry basket on the page -->
734 <xsl:template name="berryBasket">
735 <xsl:if test="$berryBasketOn">
736 <div id="berrybasket" class="hide">
737 <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.title')"/><xsl:text> </xsl:text></span>
738 <span id="berryBasketExpandCollapseLinks" style="display: none;">
739 <a id="berryBasketExpandLink" href="javascript:showBasket()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.expand')"/></a>
740 <a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.collapse')"/></a>
741 </span>
742 <div id="baskethandle">
743 <span>
744 <xsl:text> </xsl:text>
745 </span>
746 </div>
747 <div id="berries">
748 <span>
749 <xsl:text> </xsl:text>
750 </span>
751 </div>
752 <div><a id="berryFullViewLink" style="display: none;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div>
753 <div id="berryHelpMsg"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.help')"/></div>
754 </div>
755
756 </xsl:if>
757 </xsl:template>
758
759 <!--
760 Goto Favourites Template
761 This gets used on many different pages to add the
762 goto favourites check-out functionality to the site
763 -->
764 <xsl:template name="gotoFavourites">
765 <xsl:if test="$favouritesBasketOn">
766 <div id="berrybasket" class="hide">
767 <img src="interfaces/{$interface_name}/images/{$selected_favourite_icon}" title="click to add to favourites" width="16" height="16" border="0" />
768 <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.title')"/><xsl:text> </xsl:text></span>
769 <span id="favouritesCountDisplay">...</span>
770
771 <div><a id="favouritesFullViewLink" style="display: block;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div>
772 </div>
773 <gsf:script>
774 //set url and show full view link
775 var fullView = YAHOO.util.Dom.get('favouritesFullViewLink');
776 //Find the collection in the cgi parameters
777 var url = window.location.href;
778 var colstart = url.indexOf("&amp;c=");
779 var collectionName = "";
780 if (colstart != -1)
781 {
782 var colend = url.indexOf("&amp;", (colstart + 1));
783 if (colend == -1)
784 {
785 colend = url.length - 1;
786 }
787 collectionName = url.substring(colstart + 3, colend);
788 }
789
790 fullView.setAttribute("href",gs.xsltParams.library_name + "?a=g&amp;sa=berry&amp;c=&amp;s=DisplayList&amp;rt=r&amp;p.c=" + collectionName);
791 fullView.style.display='block';
792
793 </gsf:script>
794 </xsl:if>
795 </xsl:template>
796
797
798
799
800 <!-- put the drag&drop document basket on the page -->
801 <xsl:template name="documentBasket">
802 <xsl:if test="$documentBasketOn and /page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
803 <div id="documentbasket" class="hide">
804 <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'db.doc_basket')"/><xsl:text> </xsl:text></span>
805 <span id="documentBasketExpandCollapseLinks" style="display: none;">
806 <a id="documentBasketExpandLink" href="javascript:showDocumentBox()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.expand')"/></a>
807 <a id="documentBasketCollapseLink" style="display: none;" href="javascript:hideDocumentBox()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.collapse')"/></a>
808 </span>
809 <div id="documenthandle">
810 <span>
811 <xsl:text> </xsl:text>
812 </span>
813 </div>
814 <div id="documentpages">
815 <span>
816 <xsl:text> </xsl:text>
817 </span>
818 </div>
819 <div>
820 <a href="javascript:clearBasket();"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.clear')"/></a>
821 </div>
822 </div>
823 </xsl:if>
824 </xsl:template>
825
826 <!-- include the required javascript and css for berry baskets -->
827 <xsl:template name="basketHeadTags">
828 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script>
829 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script>
830 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/connection-min.js"><xsl:text> </xsl:text></script>
831 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dom-min.js"><xsl:text> </xsl:text></script>
832 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dragdrop-min.js"><xsl:text> </xsl:text></script>
833 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/cookie-min.js"><xsl:text> </xsl:text></script>
834 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/animation-min.js"><xsl:text> </xsl:text></script>
835 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/berryvariables.js"><xsl:text> </xsl:text></script>
836 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDPlayer.js"><xsl:text> </xsl:text></script>
837 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDOnTop.js"><xsl:text> </xsl:text></script>
838 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/berrybasket.js"><xsl:text> </xsl:text></script>
839 <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/>
840
841 <!-- Combo-handled YUI CSS files: -->
842 <link rel="stylesheet" type="text/css" href="interfaces/{$interface_name}/style/skin.css"/>
843
844 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentbasket.js"><xsl:text> </xsl:text></script>
845 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentBasketDragDrop.js"><xsl:text> </xsl:text></script>
846 <!-- Combo-handled YUI JS files: -->
847 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yahoo-dom-event.js"><xsl:text> </xsl:text></script>
848 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/container_core-min.js"><xsl:text> </xsl:text></script>
849 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/element-min.js"><xsl:text> </xsl:text></script>
850 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/menu-min.js"><xsl:text> </xsl:text></script>
851 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/button-min.js"><xsl:text> </xsl:text></script>
852 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-min.js"><xsl:text> </xsl:text></script>
853 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yuiloader-min.js"><xsl:text> </xsl:text></script>
854 <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-dialog.js"><xsl:text> </xsl:text></script>-->
855 <link rel="stylesheet" href="interfaces/{$interface_name}/style/documentbasket.css" type="text/css"/>
856 </xsl:template>
857
858 <!--
859create a little berry which can be drag&dropped onto the berry basket
860used on classifier and search result pages
861-->
862 <xsl:template name="documentBerryForClassifierOrSearchPage">
863 <xsl:if test="$berryBasketOn">
864 <img class="pick" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0">
865 <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
866 </img>
867 </xsl:if>
868 </xsl:template>
869
870 <xsl:template name="documentFavouriteForClassifierOrSearchPage">
871
872 <gsf:variable name="selected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$selected_favourite_icon"/></gsf:variable>
873 <gsf:variable name="unselected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$unselected_favourite_icon"/></gsf:variable>
874
875 <xsl:if test="$favouritesBasketOn">
876 <img src="interfaces/{$interface_name}/images/{$unselected_favourite_icon}" title="click to add to favourites" width="20" height="20" border="0" onclick="toggleFavourite(this)" data-is-favourite="false">
877 <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
878 </img>
879 </xsl:if>
880 </xsl:template>
881
882 <!--
883create little berrys which can be drag&dropped onto the berry basket
884used on the document page
885-->
886 <xsl:template name="documentBerryForDocumentPage">
887 <xsl:variable name="selectedNode">
888 <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
889 </xsl:variable>
890 <xsl:variable name="rootNode">
891 <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
892 </xsl:variable>
893 <xsl:if test="$berryBasketOn">
894 <div id="documentberries">
895 <img class="pick" id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/>
896 <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
897 <!--<xsl:if test="$selectedNode != $rootNode">
898 <img class="pick" id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/>
899 <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
900 </xsl:if>-->
901 </div>
902 </xsl:if>
903 </xsl:template>
904
905 <xsl:template name="documentFavouriteForDocumentPage">
906 <xsl:variable name="selectedNode">
907 <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
908 </xsl:variable>
909 <xsl:variable name="rootNode">
910 <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
911 </xsl:variable>
912 <xsl:if test="$favouritesBasketOn">
913 <div id="documentberries">
914 <img id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/{$unselected_favourite_icon}" alt="in basket" width="15" height="15" border="0"/>
915 <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
916 <!--<xsl:if test="$selectedNode != $rootNode">
917 <img id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/>
918 <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
919 </xsl:if>-->
920 </div>
921 </xsl:if>
922 </xsl:template>
923
924 <!-- document page -->
925 <xsl:template name="documentTitle">
926 <xsl:value-of select="/page/pageResponse/document/documentNode/metadataList/metadata[@name='Title']"/>
927 </xsl:template>
928 <xsl:template name="coverImage">
929 <img>
930 <xsl:attribute name="src"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg</xsl:attribute>
931 </img>
932 </xsl:template>
933
934 <xsl:template name="previousNextButtons">
935 <!-- prev -->
936 <a>
937 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@selectedNode"/>.pp&amp;sib=1&amp;p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>&amp;p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.a']/@value"/></xsl:attribute>
938 <img class="lessarrow" src="interfaces/{$interface_name}/images/previous.png"/>
939 </a>
940 <!-- next -->
941 <a>
942 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@selectedNode"/>.np&amp;sib=1&amp;p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>&amp;p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.a']/@value"/></xsl:attribute>
943 <img class="morearrow" src="interfaces/{$interface_name}/images/next.png"/>
944 </a>
945 </xsl:template>
946
947
948 <!-- This next template expands gslib:langfrag (used by document.xsl and documentbasket.xsl).
949 When debugging with o=skinandlibdoc, it's seen that <gslib:langfrag name='dse' /> gets expanded to:
950 <xsl:call-template name="langfrag">
951 <xsl:with-param name="name">dse</xsl:with-param>
952 </xsl:call-template>
953 Before the param can be used in this template, need to retrieve it by name with <xsl:param/>
954 as explained in http://www.maconstateit.net/tutorials/XML/XML05/xml05-05.aspx
955 -->
956 <xsl:template name="langfrag">
957 <xsl:param name="name"/>
958 <script type="text/javascript">
959 <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceStringsAsJavascript($interface_name, /page/@lang, $name)"/>
960 </script>
961 </xsl:template>
962
963
964 <!-- builds up links to available document types equivalent to the default source
965 document with as anchor the equivalent documents' doctype icons. -->
966 <xsl:template name="equivDocLinks">
967 <xsl:param name="count"/>
968
969 <xsl:variable name="docicon" select="metadataList/metadata[contains(@name, 'equivDocIcon')]"/>
970 <xsl:variable name="docEndlink" select="metadataList/metadata[contains(@name, '/equivDocLink')]"/>
971
972 <!--<xsl:variable name="docStartlink" select="metadataList/metadata[contains(@name, 'all_*,*_equivDocLink')]"/>-->
973 <!-- In the following variable statement, we're trying to set the docStartlink to any metadata whose value
974 ends on equivDocLink but NOT /equivDocLink. Unfortunately, the xslt function fn:ends-with only exists from
975 xslt 2.0 onwards. So need to use substring() and string-lenth() functions now to check whether the 13th char
976 from the end is a slash or not, in order to distinguish between the start of a doclink and end of one.
977 If this 13th char from the end is not a slash, then we found (the string we want to store in) docStartlink. -->
978 <xsl:variable name="docStartlink">
979 <xsl:for-each select="metadataList/metadata">
980 <xsl:if test="contains(@name, 'equivDocLink')">
981 <xsl:variable name="tmpvar" select="substring(@name, string-length(@name)-12, 1)"/>
982 <xsl:if test="not($tmpvar='/')">
983 <xsl:value-of select="self::node()[@name]"/>
984 </xsl:if>
985 </xsl:if>
986 </xsl:for-each>
987 </xsl:variable>
988
989 <xsl:variable name="equivDocIcon" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($docicon, $count)" />
990 <xsl:variable name="equivStartlink" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($docStartlink, $count)" />
991 <xsl:variable name="equivEndlink" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($docEndlink, $count)" />
992
993 <xsl:if test="$equivDocIcon != ''">
994 <xsl:value-of disable-output-escaping="yes" select="$equivStartlink"/>
995 <xsl:value-of disable-output-escaping="yes" select="$equivDocIcon"/>
996 <xsl:value-of disable-output-escaping="yes" select="$equivEndlink"/>
997
998 <!-- recursively call this template to get multiple entries -->
999 <xsl:call-template name="equivDocLinks">
1000 <xsl:with-param name="count"><xsl:value-of select="$count + 1"/></xsl:with-param>
1001 </xsl:call-template>
1002 </xsl:if>
1003
1004 </xsl:template>
1005
1006 <xsl:template name="expandContractDocumentLinks">
1007 <!--<xsl:if test="count(//documentNode) > 1">-->
1008 <xsl:variable name="doc_url"><xsl:value-of select='$library_name'/>/collection/<xsl:value-of select='/page/pageResponse/collection/@name'/>/document/<xsl:value-of select='/page/pageResponse/document/documentNode/@nodeID'/>?<xsl:if test="/page/pageRequest/paramList/param[@name='p.s']">p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>&amp;</xsl:if></xsl:variable>
1009 <div id="expandContractLinks"><table style="width:100%; text-align:center;"><tr><td><a href="{$doc_url}ed=1"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc')"/></a></td><td><a href="javascript:expandOrCollapseAll(false);"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.collapse_doc')"/></a></td></tr></table></div>
1010 <!--</xsl:if>-->
1011 </xsl:template>
1012</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.