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

Last change on this file since 33638 was 33638, checked in by kjdon, 4 years ago

gslib doesn't use xml-to-string.xsl. its only used by formatmanager, so include it from there, and move xml-to-string into the layouts folder

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