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

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

added depositorTitleAndLink template. TODO - get depositor text from the dictionary

File size: 49.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 <!-- 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="depositorTitleAndLink">
421 <a href="{$library_name}?a=de">Depositor</a>
422 </xsl:template>
423
424 <xsl:template name="greenstoneLogoAlternateText">
425 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
426 </xsl:template>
427
428 <!-- about page - collection home ....................................................................... -->
429 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
430 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
431 <xsl:variable name="siteName" select="$site_name"/>
432 <!--
433 Already defined above as a variable, not sure why if way being defined here again as a 'param'
434 <xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
435 -->
436 <xsl:param name="pageType"/>
437 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
438 <xsl:variable name="this-service" select="/page/pageRequest/paramList/param[@name = 's']/@value"/>
439
440<!--
441_httpimages_ {_httpweb_/images}
442_httpscript_ {_httpweb_/script}
443_httpstyle_ {_httpweb_/style}
444_httpflash_ {_httpweb_/flash}
445_httpjava_ {_httpweb_/java}
446-->
447
448
449 <xsl:template name="define-js-variable">
450 <xsl:param name="name"/>
451 <xsl:param name="value"/>
452 <script type="text/javascript">
453 gs.variables[<xslt:text disable-output-escaping="yes">"</xslt:text><xsl:value-of select="$name"/><xslt:text disable-output-escaping="yes">"</xslt:text>]
454 <xslt:text disable-output-escaping="yes"> = "</xslt:text>
455 <xsl:value-of select="$value"/>
456 <xslt:text disable-output-escaping="yes">";</xslt:text>
457 </script>
458 </xsl:template>
459
460 <xsl:variable name="_httpcollection_" select="$httpPath"/>
461 <xsl:variable name="_httpbrowse_"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/browse</xsl:variable>
462 <xsl:variable name="_httpquery_"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/search</xsl:variable>
463
464 <xsl:template name="define-js-macro-variables">
465
466 <xsl:call-template name="define-js-variable">
467 <xsl:with-param name="name" select="'_httpbrowse_'"/>
468 <xsl:with-param name="value" select="$_httpbrowse_"/>
469 </xsl:call-template>
470
471 <xsl:call-template name="define-js-variable">
472 <xsl:with-param name="name" select="'_httpquery_'"/>
473 <xsl:with-param name="value" select="$_httpquery_"/>
474 </xsl:call-template>
475
476 </xsl:template>
477
478
479 <xsl:template name="aboutCollectionPageTitle">
480 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
481 <xsl:value-of select="/page/pageResponse/collection/displayItemList/displayItem[@name='name']"/>
482 <xsl:text> </xsl:text>
483 </xsl:template>
484
485 <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
486 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
487 <xsl:choose>
488 <xsl:when test="$this-element/displayItemList/displayItem[@name='icon']">
489 <img border="0">
490 <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>
491 <xsl:attribute name="alt">
492 <xsl:value-of select="$this-element/displayItemList/displayItem[@name='name']"/>
493 </xsl:attribute>
494 <xsl:attribute name="title">
495 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
496 </xsl:attribute>
497 </img>
498 </xsl:when>
499 <xsl:otherwise>
500 <xsl:value-of select="$this-element/displayItemList/displayItem[@name='name']"/>
501 </xsl:otherwise>
502 </xsl:choose>
503 </a>
504 </xsl:template>
505
506 <xsl:template name="homeButtonTop">
507 <a href="{$library_name}?a=p&amp;sa=home">
508 <xsl:attribute name="title">
509 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/>
510 </xsl:attribute>
511 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
512 </a>
513 </xsl:template>
514
515 <xsl:template name="helpButtonTop">
516 <xsl:choose>
517 <xsl:when test="$pageType='help'">
518 <li>
519 <a>
520 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
521 </a>
522 </li>
523 </xsl:when>
524 <xsl:otherwise>
525 <li>
526 <a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}">
527 <xsl:attribute name="title">
528 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/>
529 </xsl:attribute>
530 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
531 </a>
532 </li>
533 </xsl:otherwise>
534 </xsl:choose>
535 </xsl:template>
536
537 <xsl:template name="preferencesButtonTop">
538 <xsl:choose>
539 <xsl:when test="$pageType='pref'">
540 <li>
541 <a>
542 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
543 </a>
544 </li>
545 </xsl:when>
546 <xsl:otherwise>
547 <li>
548 <a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}">
549 <xsl:attribute name="title">
550 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/>
551 </xsl:attribute>
552 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
553 </a>
554 </li>
555 </xsl:otherwise>
556 </xsl:choose>
557 </xsl:template>
558
559 <xsl:template name="servicesNavigationBar">
560 <xsl:for-each select="$this-element/serviceList/service">
561 <xsl:variable name="action">
562 <xsl:choose>
563 <xsl:when test="@name=$this-service">CURRENT</xsl:when>
564 <xsl:when test="@type='query'">q</xsl:when>
565 <xsl:when test="@type='browse'">b</xsl:when>
566 <xsl:when test="@type='process'">pr</xsl:when>
567 <xsl:when test="@type='applet'">a</xsl:when>
568 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
569 </xsl:choose>
570 </xsl:variable>
571 <xsl:choose>
572 <xsl:when test="$action='CURRENT'">
573 <li>
574 <a>
575 <xsl:value-of select="displayItem[@name='name']"/>
576 </a>
577 </li>
578 </xsl:when>
579 <xsl:when test="$action !='DO_NOT_DISPLAY'">
580 <li>
581 <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
582 <xsl:if test="displayItem[@name='description']">
583 <xsl:attribute name="title">
584 <xsl:value-of select="displayItem[@name='description']"/>
585 </xsl:attribute>
586 </xsl:if>
587 <xsl:value-of select="displayItem[@name='name']"/>
588 </a>
589 </li>
590 </xsl:when>
591 </xsl:choose>
592 </xsl:for-each>
593 </xsl:template>
594
595 <xsl:template name="collectionDescriptionTextAndServicesLinks">
596 <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
597 </xsl:template>
598
599 <xsl:template match="collection|serviceCluster">
600 <xsl:value-of select="displayItemList/displayItem[@name='description']" disable-output-escaping="yes"/>
601<!-- Uncomment this section if you want the collection service links and their descriptions to appear -->
602 <!--<xsl:apply-templates select="serviceList">
603 <xsl:with-param name="collName" select="$collName"/>
604 </xsl:apply-templates>-->
605 </xsl:template>
606
607 <xsl:template match="serviceList">
608 <xsl:param name="collName"/>
609 <h3>
610 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/>
611 </h3>
612 <p>
613 <xsl:choose>
614 <xsl:when test="service">
615 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
616 </xsl:when>
617 <xsl:otherwise>
618 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
619 </xsl:otherwise>
620 </xsl:choose>
621 </p>
622 <xsl:if test="service">
623 <div id="servicelist">
624 <xsl:for-each select="service">
625 <xsl:sort select="position()" order="descending" data-type="number"/>
626 <xsl:variable name="action">
627 <xsl:choose>
628 <xsl:when test="@type='query'">q</xsl:when>
629 <xsl:when test="@type='process'">pr</xsl:when>
630 <xsl:when test="@type='applet'">a</xsl:when>
631 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
632 </xsl:choose>
633 </xsl:variable>
634 <xsl:if test="$action != 'DO_NOT_DISPLAY'">
635 <div class="paramLabel">
636 <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
637 <xsl:value-of select="displayItem[@name='name']"/>
638 </a>
639 </div>
640 <div class="paramLabel">
641 <xsl:value-of select="displayItem[@name='description']"/>
642 </div>
643 <br class="clear"/>
644 </xsl:if>
645 </xsl:for-each>
646 </div>
647 </xsl:if>
648
649 </xsl:template>
650
651 <!-- classifier page ............................................................................ -->
652 <xsl:template name="collapsedNavigationTab">
653 <xsl:param name="type"/>
654 <xsl:variable name="isCurrent" select="/page/pageResponse/service[@type=$type]"/>
655 <li>
656 <xsl:if test="$isCurrent">
657 <xsl:attribute name="class">current</xsl:attribute>
658 </xsl:if>
659 <a>
660 <xsl:if test="service[@name=$type]/displayItem[@name='description']">
661 <xsl:attribute name="title">
662 <xsl:value-of select="service[@name=$type]/displayItem[@name='description']"/>
663 </xsl:attribute>
664 </xsl:if>
665 <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>
666 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $type)"/>
667 </a>
668 </li>
669 </xsl:template>
670
671 <xsl:template name="navigationTab">
672 <xsl:variable name="isCurrent" select="@name=/page/pageResponse/service/@name"/>
673 <xsl:variable name="action">
674 <xsl:choose>
675 <xsl:when test="@type='query'">q</xsl:when>
676 <xsl:when test="@type='browse'">b</xsl:when>
677 <xsl:when test="@type='process'">pr</xsl:when>
678 <xsl:when test="@type='applet'">a</xsl:when>
679 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
680 </xsl:choose>
681 </xsl:variable>
682 <xsl:if test="$action!='DO_NOT_DISPLAY'">
683 <li>
684 <xsl:if test="$isCurrent">
685 <xsl:attribute name="class">current</xsl:attribute>
686 </xsl:if>
687 <a>
688 <xsl:if test="displayItem[@name='description']">
689 <xsl:attribute name="title">
690 <xsl:value-of select="displayItem[@name='description']"/>
691 </xsl:attribute>
692 </xsl:if>
693 <xsl:choose>
694 <xsl:when test="classifierList/classifier/@name">
695 <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>
696 </xsl:when>
697 <xsl:otherwise>
698 <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>
699 </xsl:otherwise>
700 </xsl:choose>
701 <xsl:value-of select="displayItem[@name='name']"/>
702 </a>
703 </li>
704 </xsl:if>
705 </xsl:template>
706
707 <xsl:template name="classifierLink">
708 <xsl:if test="@name=/page/pageResponse/classifier/@name">
709 <xsl:attribute name="class">current</xsl:attribute>
710 </xsl:if>
711 <a href="{$library_name}?a=b&amp;rt=r&amp;s={/page/pageResponse/service/@name}&amp;c={/page/pageResponse/collection/@name}&amp;cl={@name}">
712 <xsl:value-of select="displayItem[@name='description']"/>
713 </a>
714 </xsl:template>
715
716 <!-- query page ............................................................................ -->
717<!-- <xsl:template name="indexName">
718 <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
719 </xsl:template>
720
721 <xsl:template name="queryPageCollectionName">
722 <xsl:choose>
723 <xsl:when test="/page/pageResponse/collection">
724 <gslib:aboutCollectionPageTitle/>
725 </xsl:when>
726 <xsl:otherwise>Cross-Collection</xsl:otherwise>
727 </xsl:choose>
728 </xsl:template>-->
729
730 <!--
731BERRY BASKET TEMPLATES
732These get used on many different pages to add the
733berry basket function to the site
734 -->
735
736 <xsl:template name="displayBaskets">
737 <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)))">
738<!-- <div id="float-anchor" style="position: absolute; width: 29%; min-width:180px; /*top: 105px;*/ right:20px; margin: 0 0 10px 20px;">
739 <xsl:comment>Filler needed for div</xsl:comment>-->
740 <div id="rightSidebar">
741 <xsl:if test="$berryBasketOn">
742 <!-- show the berry basket if it's turned on -->
743 <gslib:berryBasket/>
744 <xsl:text> </xsl:text>
745 </xsl:if>
746
747 <xsl:if test="$favouriteBasketOn">
748 <!-- show the favourites 'basket' if it's turned on -->
749 <gslib:gotoFavourites/>
750 <xsl:text> </xsl:text>
751 </xsl:if>
752
753 <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))">
754 <!-- show the document basket if its turned on and the user has permission-->
755 <gslib:documentBasket/>
756 <xsl:text> </xsl:text>
757 </xsl:if>
758 </div>
759 <!-- </div>-->
760 </xsl:if>
761 </xsl:template>
762
763 <!-- put the drag&drop berry basket on the page -->
764 <xsl:template name="berryBasket">
765 <xsl:if test="$berryBasketOn">
766 <div id="berrybasket" class="hide">
767 <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.title')"/><xsl:text> </xsl:text></span>
768 <span id="berryBasketExpandCollapseLinks" style="display: none;">
769 <a id="berryBasketExpandLink" href="javascript:showBasket()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.expand')"/></a>
770 <a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.collapse')"/></a>
771 </span>
772 <div id="baskethandle">
773 <span>
774 <xsl:text> </xsl:text>
775 </span>
776 </div>
777 <div id="berries">
778 <span>
779 <xsl:text> </xsl:text>
780 </span>
781 </div>
782 <div><a id="berryFullViewLink" style="display: none;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div>
783 <div id="berryHelpMsg"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.help')"/></div>
784 </div>
785
786 </xsl:if>
787 </xsl:template>
788
789 <!--
790 Goto Favourites Template
791 This gets used on many different pages to add the
792 goto favourites check-out functionality to the site
793 -->
794 <xsl:template name="gotoFavourites">
795 <!-- set up these gsf variables so we have access in javascript -->
796 <gsf:variable name="selected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$selected_favourite_icon"/></gsf:variable>
797 <gsf:variable name="unselected_favourite_icon_url">interfaces/<xsl:value-of select="$interface_name"/>/images/<xsl:value-of select="$unselected_favourite_icon"/></gsf:variable>
798 <xsl:if test="$favouriteBasketOn">
799 <div id="berrybasket" class="hide">
800 <img src="interfaces/{$interface_name}/images/{$selected_favourite_icon}" title="click to add to favourites" width="16" height="16" border="0" />
801 <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'favourites.title')"/><xsl:text> </xsl:text></span>
802 <span id="favouritesCountDisplay">...</span>
803
804 <div><a id="favouritesFullViewLink" style="display: block;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'berry.full')"/></a></div>
805 </div>
806 <gsf:script>
807 //set url and show full view link
808 var fullView = YAHOO.util.Dom.get('favouritesFullViewLink');
809 //Find the collection in the cgi parameters
810 var url = window.location.href;
811 var colstart = url.indexOf("&amp;c=");
812 var collectionName = "";
813 if (colstart != -1)
814 {
815 var colend = url.indexOf("&amp;", (colstart + 1));
816 if (colend == -1)
817 {
818 colend = url.length - 1;
819 }
820 collectionName = url.substring(colstart + 3, colend);
821 }
822
823 fullView.setAttribute("href",gs.xsltParams.library_name + "?a=g&amp;sa=berry&amp;c=&amp;s=DisplayList&amp;rt=r&amp;p.c=" + collectionName);
824 fullView.style.display='block';
825
826 </gsf:script>
827 </xsl:if>
828 </xsl:template>
829
830
831
832
833 <!-- put the drag&drop document basket on the page -->
834 <xsl:template name="documentBasket">
835 <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))">
836 <div id="documentbasket" class="hide">
837 <span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'db.doc_basket')"/><xsl:text> </xsl:text></span>
838 <span id="documentBasketExpandCollapseLinks" style="display: none;">
839 <a id="documentBasketExpandLink" href="javascript:showDocumentBox()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.expand')"/></a>
840 <a id="documentBasketCollapseLink" style="display: none;" href="javascript:hideDocumentBox()"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.collapse')"/></a>
841 </span>
842 <div id="documenthandle">
843 <span>
844 <xsl:text> </xsl:text>
845 </span>
846 </div>
847 <div id="documentpages">
848 <span>
849 <xsl:text> </xsl:text>
850 </span>
851 </div>
852 <div>
853 <a href="javascript:clearBasket();"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'basket.clear')"/></a>
854 </div>
855 </div>
856 </xsl:if>
857 </xsl:template>
858
859 <!-- include the required javascript and css for berry baskets -->
860 <xsl:template name="basketHeadTags">
861 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script>
862 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script>
863 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/connection-min.js"><xsl:text> </xsl:text></script>
864 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dom-min.js"><xsl:text> </xsl:text></script>
865 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dragdrop-min.js"><xsl:text> </xsl:text></script>
866 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/cookie-min.js"><xsl:text> </xsl:text></script>
867 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/animation-min.js"><xsl:text> </xsl:text></script>
868 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/berryvariables.js"><xsl:text> </xsl:text></script>
869 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDPlayer.js"><xsl:text> </xsl:text></script>
870 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDOnTop.js"><xsl:text> </xsl:text></script>
871 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/berrybasket.js"><xsl:text> </xsl:text></script>
872 <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/>
873
874 <!-- Combo-handled YUI CSS files: -->
875 <link rel="stylesheet" type="text/css" href="interfaces/{$interface_name}/style/skin.css"/>
876
877 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentbasket.js"><xsl:text> </xsl:text></script>
878 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentBasketDragDrop.js"><xsl:text> </xsl:text></script>
879 <!-- Combo-handled YUI JS files: -->
880 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yahoo-dom-event.js"><xsl:text> </xsl:text></script>
881 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/container_core-min.js"><xsl:text> </xsl:text></script>
882 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/element-min.js"><xsl:text> </xsl:text></script>
883 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/menu-min.js"><xsl:text> </xsl:text></script>
884 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/button-min.js"><xsl:text> </xsl:text></script>
885 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-min.js"><xsl:text> </xsl:text></script>
886 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yuiloader-min.js"><xsl:text> </xsl:text></script>
887 <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-dialog.js"><xsl:text> </xsl:text></script>-->
888 <link rel="stylesheet" href="interfaces/{$interface_name}/style/documentbasket.css" type="text/css"/>
889 </xsl:template>
890
891 <!--
892create a little berry which can be drag&dropped onto the berry basket
893used on classifier and search result pages
894-->
895 <xsl:template name="documentBerryForClassifierOrSearchPage">
896 <xsl:if test="$berryBasketOn">
897 <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>
898 <img class="pick" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0">
899 <xsl:attribute name="id"><xsl:value-of select="$collname"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
900 </img>
901 </xsl:if>
902 </xsl:template>
903
904
905 <xsl:template name="documentFavouriteForClassifierOrSearchPage">
906 <xsl:if test="$favouriteBasketOn">
907 <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>
908 <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">
909 <xsl:attribute name="id"><xsl:value-of select="$collname"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
910 </img>
911 </xsl:if>
912 </xsl:template>
913
914 <!--
915create little berrys which can be drag&dropped onto the berry basket
916used on the document page
917-->
918 <xsl:template name="documentBerryForDocumentPage">
919 <xsl:variable name="selectedNode">
920 <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
921 </xsl:variable>
922 <xsl:variable name="rootNode">
923 <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
924 </xsl:variable>
925 <xsl:if test="$berryBasketOn">
926 <div id="documentberries">
927 <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"/>
928 <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
929 <!--<xsl:if test="$selectedNode != $rootNode">
930 <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"/>
931 <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
932 </xsl:if>-->
933 </div>
934 </xsl:if>
935 </xsl:template>
936
937 <xsl:template name="documentFavouriteForDocumentPage">
938 <xsl:variable name="selectedNode">
939 <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
940 </xsl:variable>
941 <xsl:variable name="rootNode">
942 <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
943 </xsl:variable>
944 <xsl:if test="$favouriteBasketOn">
945 <div id="documentberries">
946 <img id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/{$unselected_favourite_icon}" alt="in basket" width="15" height="15" border="0"/>
947 <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
948 <!--<xsl:if test="$selectedNode != $rootNode">
949 <img id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/{$berry_icon}" alt="in basket" width="15" height="15" border="0"/>
950 <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
951 </xsl:if>-->
952 </div>
953 </xsl:if>
954 </xsl:template>
955
956 <!-- document page -->
957 <xsl:template name="documentTitle">
958 <xsl:value-of select="/page/pageResponse/document/documentNode/metadataList/metadata[@name='Title']"/>
959 </xsl:template>
960 <xsl:template name="coverImage">
961 <img>
962 <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>
963 </img>
964 </xsl:template>
965
966 <xsl:template name="previousNextButtons">
967 <!-- prev -->
968 <a>
969 <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>
970 <img class="lessarrow" src="interfaces/{$interface_name}/images/previous.png"/>
971 </a>
972 <!-- next -->
973 <a>
974 <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>
975 <img class="morearrow" src="interfaces/{$interface_name}/images/next.png"/>
976 </a>
977 </xsl:template>
978
979
980 <!-- This next template expands gslib:langfrag (used by document.xsl and documentbasket.xsl).
981 When debugging with o=skinandlibdoc, it's seen that <gslib:langfrag name='dse' /> gets expanded to:
982 <xsl:call-template name="langfrag">
983 <xsl:with-param name="name">dse</xsl:with-param>
984 </xsl:call-template>
985 Before the param can be used in this template, need to retrieve it by name with <xsl:param/>
986 as explained in http://www.maconstateit.net/tutorials/XML/XML05/xml05-05.aspx
987 -->
988 <xsl:template name="langfrag">
989 <xsl:param name="name"/>
990 <script type="text/javascript">
991 <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceStringsAsJavascript($interface_name, /page/@lang, $name)"/>
992 </script>
993 </xsl:template>
994
995
996 <!-- builds up links to available document types equivalent to the default source
997 document with as anchor the equivalent documents' doctype icons. -->
998 <xsl:template name="equivDocLinks">
999 <xsl:param name="count"/>
1000
1001 <xsl:variable name="docicon" select="metadataList/metadata[contains(@name, 'equivDocIcon')]"/>
1002 <xsl:variable name="docEndlink" select="metadataList/metadata[contains(@name, '/equivDocLink')]"/>
1003
1004 <!--<xsl:variable name="docStartlink" select="metadataList/metadata[contains(@name, 'all_*,*_equivDocLink')]"/>-->
1005 <!-- In the following variable statement, we're trying to set the docStartlink to any metadata whose value
1006 ends on equivDocLink but NOT /equivDocLink. Unfortunately, the xslt function fn:ends-with only exists from
1007 xslt 2.0 onwards. So need to use substring() and string-lenth() functions now to check whether the 13th char
1008 from the end is a slash or not, in order to distinguish between the start of a doclink and end of one.
1009 If this 13th char from the end is not a slash, then we found (the string we want to store in) docStartlink. -->
1010 <xsl:variable name="docStartlink">
1011 <xsl:for-each select="metadataList/metadata">
1012 <xsl:if test="contains(@name, 'equivDocLink')">
1013 <xsl:variable name="tmpvar" select="substring(@name, string-length(@name)-12, 1)"/>
1014 <xsl:if test="not($tmpvar='/')">
1015 <xsl:value-of select="self::node()[@name]"/>
1016 </xsl:if>
1017 </xsl:if>
1018 </xsl:for-each>
1019 </xsl:variable>
1020
1021 <xsl:variable name="equivDocIcon" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($docicon, $count)" />
1022 <xsl:variable name="equivStartlink" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($docStartlink, $count)" />
1023 <xsl:variable name="equivEndlink" select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($docEndlink, $count)" />
1024
1025 <xsl:if test="$equivDocIcon != ''">
1026 <xsl:value-of disable-output-escaping="yes" select="$equivStartlink"/>
1027 <xsl:value-of disable-output-escaping="yes" select="$equivDocIcon"/>
1028 <xsl:value-of disable-output-escaping="yes" select="$equivEndlink"/>
1029
1030 <!-- recursively call this template to get multiple entries -->
1031 <xsl:call-template name="equivDocLinks">
1032 <xsl:with-param name="count"><xsl:value-of select="$count + 1"/></xsl:with-param>
1033 </xsl:call-template>
1034 </xsl:if>
1035
1036 </xsl:template>
1037
1038 <xsl:template name="expandContractDocumentLinks">
1039 <!--<xsl:if test="count(//documentNode) > 1">-->
1040 <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>
1041 <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>
1042 <!--</xsl:if>-->
1043 </xsl:template>
1044</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.