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

Last change on this file since 25873 was 25873, checked in by kjdon, 12 years ago

moved the xsl:output from library.xsl to gslib.xsl. now we will include gslib instead of library, and I will delete library.xsl

File size: 30.3 KB
RevLine 
[18617]1<?xml version="1.0" encoding="UTF-8"?>
[25869]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 exclude-result-prefixes="util xalan gslib gsf xslt">
[25873]9
10
11<xsl:output
12 method="html"
13 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
14 doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
15
[23813]16 <!-- some global parameters - these are set by whoever is invoking the transformation -->
[18617]17 <xsl:param name="interface_name"/>
18 <xsl:param name="library_name"/>
[25280]19 <xsl:param name="site_name"/>
[22458]20 <xsl:include href="xml-to-string.xsl"/>
[18617]21 <!-- every pages ....................................................................... -->
[25280]22
[23813]23 <xsl:template name="siteName">
24 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteName']"/>
25 </xsl:template>
[25280]26
[23813]27 <xsl:template name="siteLink">
28 <a href="./{$library_name}">
29 <xsl:call-template name="siteName"/>
30 <xsl:text> </xsl:text>
31 </a>
32 </xsl:template>
[24018]33
[23813]34 <xsl:variable name="a">
35 <xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/>
36 </xsl:variable>
[24018]37
[23813]38 <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
[24018]39
[23813]40 <xsl:variable name="berrybasketswitch">
41 <xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/>
42 </xsl:variable>
[24018]43
[23813]44 <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
[24510]45 <xsl:variable name="documentBasketOn" select="/page/pageRequest/paramList/param[@name='documentbasket' and @value='on']"/>
[24018]46
[25144]47 <xsl:variable name="thisCollectionEditor">
48 <xsl:value-of select="/page/pageRequest/paramList/param[@name = 'c']/@value"/>
49 <xsl:text>-collection-editor</xsl:text>
50 </xsl:variable>
51
[23813]52 <!-- template to get the name of the current collection -->
53 <xsl:template name="collectionName">
54 <xsl:choose>
55 <xsl:when test="/page/pageResponse/collection">
56 <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>
57 </xsl:when>
58 <xsl:otherwise>All Collections</xsl:otherwise>
59 </xsl:choose>
60 </xsl:template>
[24018]61
[23813]62 <xsl:template name="collectionNameShort">
63 <xsl:value-of select="/page/pageResponse/collection/@name"/>
64 </xsl:template>
65 <xsl:template name="collectionNameLinked">
66 <xsl:if test="/page/pageResponse/collection">
67 <a>
[25439]68 <xsl:attribute name="href">./<xsl:value-of select="$library_name"/>/collection/<xsl:call-template name="collectionNameShort"/>/page/about</xsl:attribute>
[23813]69 <xsl:call-template name="collectionName"/>
70 </a>
71 </xsl:if>
72 </xsl:template>
[24018]73
[23813]74 <!-- text to get the name of the current service ("Browse","Search" etc) -->
75 <xsl:template name="serviceName">
76 <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
77 </xsl:template>
[24018]78
[23813]79 <xsl:template name="textDirectionAttribute">
80 <xsl:attribute name="dir">
81 <xsl:choose>
82 <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>
83 <xsl:otherwise>ltr</xsl:otherwise>
84 </xsl:choose>
85 </xsl:attribute>
86 </xsl:template>
[24018]87
[23813]88 <xsl:template name="actionClass">
89 <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>
90 </xsl:template>
91 <!-- username, if logged in -->
92 <!--
[19988]93 <xsl:template name="username">
94 <xsl:if test="$un_s!=''">
95 <xsl:if test="$asn!='' and $asn!='0'">
96 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/> : <xsl:value-of select="$un_s"/>
97 </xsl:if>
98 </xsl:if>
99 </xsl:template>
100 -->
[23813]101 <xsl:template name="defaultDividerBar">
102 <xsl:param name="text"/>
103 <xsl:choose>
[18617]104 <xsl:when test="$text">
[23813]105 <div class="divbar">
106 <xsl:value-of select="$text"/>
107 </div>
[18617]108 </xsl:when>
109 <xsl:otherwise>
[23813]110 <div class="divbar">
111 <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
112 </div>
[18617]113 </xsl:otherwise>
[19988]114 </xsl:choose>
[18617]115 </xsl:template>
[24018]116
[23813]117 <xsl:template match="error">
[18617]118 Error: <xsl:value-of select="."/>
119 </xsl:template>
[23813]120 <xsl:template name="displayErrorsIfAny">
121 <xsl:if test="descendant::error">
[18617]122 <script language="Javascript">
[23813]123 <xsl:text disable-output-escaping="yes">
[18617]124 function removeAllChildren(node) {
125 while (node.hasChildNodes()) {
126 node.removeChild(node.firstChild);
127 }
128 }
129
130 function toggleHideError(obj) {
131 if (obj.style.display == "none") {
132 obj.style.display = "";
133 hide_link = document.getElementById("hide");
134 removeAllChildren(hide_link);
[23813]135 hide_link.appendChild(document.createTextNode("</xsl:text>
136 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'hide_error')"/>
137 <xsl:text disable-output-escaping="yes">"));
[18617]138 } else {
139 obj.style.display = "none";
140 hide_link = document.getElementById("hide");
141 removeAllChildren(hide_link);
[23813]142 hide_link.appendChild(document.createTextNode("</xsl:text>
143 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/>
144 <xsl:text disable-output-escaping="yes">"));
[19988]145 }
[18617]146 }
147 </xsl:text>
148 </script>
[23813]149 <p align="right">
150 <a id="hide" href="javascript:toggleHideError(error);">
151 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/>
152 </a>
153 </p>
[18617]154 <div id="error" style="display: none;">
[23813]155 <xsl:apply-templates select="descendant::error"/>
[18617]156 </div>
157 </xsl:if>
158 </xsl:template>
[24018]159
[23813]160 <xsl:template name="noTextBar">
161 <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
162 </xsl:template>
[24018]163
[23813]164 <xsl:template name="poweredByGS3TextBar">
165 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
166 </xsl:template>
[24018]167
[23813]168 <xsl:template name="rightArrow">
169 <xsl:text disable-output-escaping="yes"> &amp;raquo; </xsl:text>
170 </xsl:template>
[24018]171
[23813]172 <!-- site home ....................................................................... -->
173 <xsl:template name="siteHomePageTitle">
174 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
175 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
176 <xsl:text> </xsl:text>
177 </xsl:template>
[24018]178
[23813]179 <xsl:template name="selectACollectionTextBar">
180 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/>
181 </xsl:template>
[24018]182
[23813]183 <xsl:template name="crossCollectionQuickSearchForm">
184 <xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
185 </xsl:template>
[24018]186
[23813]187 <xsl:template match="service[@name='TextQuery']">
188 <form name="QuickSearch" method="get" action="{$library_name}">
189 <input type="hidden" name="a" value="q"/>
190 <input type="hidden" name="rt" value="rd"/>
191 <input type="hidden" name="s" value="{@name}"/>
192 <input type="hidden" name="s1.collection" value="all"/>
193 <input type="text" name="s1.query" size="20"/>
194 <input type="submit">
195 <xsl:attribute name="value">
196 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.quick_search')"/>
197 </xsl:attribute>
198 </input>
199 </form>
200 </xsl:template>
[24018]201
[23813]202 <xsl:template name="collectionLinkWithImage">
[25784]203 <xsl:variable name="desc"><xsl:value-of select="displayItem[@name='shortDescription']"/></xsl:variable>
[23813]204 <xsl:choose>
205 <xsl:when test="displayItem[@name='icon']">
[25784]206 <a href="{$library_name}/collection/{@name}/page/about" title="{$desc}">
[23813]207 <img class="collectionLinkImage">
[25784]208 <xsl:attribute name="alt"><xsl:value-of select="displayItem[@name='name']"/></xsl:attribute>
209 <xsl:attribute name="src">sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="displayItem[@name='icon']"/></xsl:attribute>
[23813]210 </img>
211 </a>
212 </xsl:when>
213 <xsl:otherwise>
[25784]214 <a href="{$library_name}/collection/{@name}/page/about" title="{$desc}">
[23813]215 <div class="collectionLink">
216 <xsl:value-of select="displayItem[@name='name']"/>
217 </div>
218 </a>
219 </xsl:otherwise>
220 </xsl:choose>
[19988]221 </xsl:template>
[24018]222
[23813]223 <xsl:template name="serviceClusterList">
224 <xsl:apply-templates select="serviceClusterList"/>
[19988]225 </xsl:template>
[24018]226
[23813]227 <xsl:template match="serviceClusterList">
228 <xsl:for-each select="serviceCluster">
229 <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
230 <xsl:value-of select="@name"/>
231 <xsl:value-of select="displayItem[@name='name']"/>
232 </a>
233 </xsl:for-each>
234 </xsl:template>
[24018]235
[23813]236 <xsl:template name="serviceLink">
237 <div class="paramLabel">
238 <a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}">
239 <xsl:value-of select="displayItem[@name='name']"/>
240 </a>
241 </div>
242 <div class="paramValue">
243 <xsl:value-of select="displayItem[@name='description']"/>
244 </div>
245 <br class="clear"/>
246 </xsl:template>
[24018]247
[23813]248 <xsl:template name="authenticationLink">
[24149]249 <xsl:for-each select="//serviceList/service[@type='authen']">
250 <div class="paramLabel">
[25280]251 <a href="{$library_name}/admin/ListUsers">
[24149]252 <xsl:value-of select="displayItem[@name='name']"/>
253 </a>
254 </div>
255 <div class="paramValue">
256 <xsl:value-of select="displayItem[@name='description']"/>
257 </div>
[23813]258 </xsl:for-each>
259 </xsl:template>
[25280]260
261 <xsl:template name="registerLink">
262 <xsl:for-each select="//serviceList/service[@type='authen']">
263 <div class="paramLabel">
264 <a href="{$library_name}/admin/Register">
265 <xsl:text>Register</xsl:text>
266 </a>
267 </div>
268 <div class="paramValue">
269 <xsl:text>Register as a new user</xsl:text>
270 </div>
271 </xsl:for-each>
272 </xsl:template>
273
[23813]274 <xsl:template name="libraryInterfaceLink">
275 <li>
276 <a href="{$library_name}?a=p&amp;sa=gli4gs3">
277 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/>
278 </a>
279 </li>
280 </xsl:template>
[24018]281
[23813]282 <xsl:template name="greenstoneLogoAlternateText">
283 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
284 </xsl:template>
[24018]285
[23813]286 <!-- about page - collection home ....................................................................... -->
287 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
[25835]288 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
[23813]289 <xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
290 <xsl:param name="pageType"/>
291 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
292 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
[24018]293
[23813]294 <xsl:template name="aboutCollectionPageTitle">
295 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
296 <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>
297 <xsl:text> </xsl:text>
298 </xsl:template>
[24018]299
[23813]300 <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
301 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
302 <xsl:choose>
303 <xsl:when test="$this-element/displayItem[@name='icon']">
304 <img border="0">
305 <xsl:attribute name="src"><xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/></xsl:attribute>
306 <xsl:attribute name="alt">
307 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
308 </xsl:attribute>
309 <xsl:attribute name="title">
310 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
311 </xsl:attribute>
312 </img>
313 </xsl:when>
314 <xsl:otherwise>
315 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
316 </xsl:otherwise>
317 </xsl:choose>
318 </a>
319 </xsl:template>
[24018]320
[23813]321 <xsl:template name="homeButtonTop">
322 <a href="{$library_name}?a=p&amp;sa=home">
323 <xsl:attribute name="title">
324 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/>
325 </xsl:attribute>
326 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
327 </a>
328 </xsl:template>
[24018]329
[23813]330 <xsl:template name="helpButtonTop">
[19856]331 <xsl:choose>
332 <xsl:when test="$pageType='help'">
[23813]333 <li>
334 <a>
335 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
336 </a>
337 </li>
[19856]338 </xsl:when>
339 <xsl:otherwise>
[23813]340 <li>
341 <a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}">
342 <xsl:attribute name="title">
343 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/>
344 </xsl:attribute>
345 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
346 </a>
347 </li>
[19856]348 </xsl:otherwise>
349 </xsl:choose>
[23813]350 </xsl:template>
[24018]351
[23813]352 <xsl:template name="preferencesButtonTop">
353 <xsl:choose>
354 <xsl:when test="$pageType='pref'">
355 <li>
356 <a>
357 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
358 </a>
359 </li>
360 </xsl:when>
361 <xsl:otherwise>
362 <li>
363 <a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}">
364 <xsl:attribute name="title">
365 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/>
366 </xsl:attribute>
367 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
368 </a>
369 </li>
370 </xsl:otherwise>
371 </xsl:choose>
372 </xsl:template>
[24018]373
[23813]374 <xsl:template name="servicesNavigationBar">
375 <xsl:for-each select="$this-element/serviceList/service">
376 <xsl:variable name="action">
377 <xsl:choose>
378 <xsl:when test="@name=$this-service">CURRENT</xsl:when>
379 <xsl:when test="@type='query'">q</xsl:when>
380 <xsl:when test="@type='browse'">b</xsl:when>
381 <xsl:when test="@type='process'">pr</xsl:when>
382 <xsl:when test="@type='applet'">a</xsl:when>
383 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
384 </xsl:choose>
385 </xsl:variable>
386 <xsl:choose>
387 <xsl:when test="$action='CURRENT'">
388 <li>
389 <a>
390 <xsl:value-of select="displayItem[@name='name']"/>
391 </a>
392 </li>
393 </xsl:when>
394 <xsl:when test="$action !='DO_NOT_DISPLAY'">
395 <li>
396 <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
397 <xsl:if test="displayItem[@name='description']">
398 <xsl:attribute name="title">
399 <xsl:value-of select="displayItem[@name='description']"/>
400 </xsl:attribute>
401 </xsl:if>
402 <xsl:value-of select="displayItem[@name='name']"/>
403 </a>
404 </li>
405 </xsl:when>
406 </xsl:choose>
407 </xsl:for-each>
408 </xsl:template>
[24018]409
[23813]410 <xsl:template name="collectionDescriptionTextAndServicesLinks">
411 <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
412 </xsl:template>
413 <xsl:template match="collection|serviceCluster">
414 <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
415 <xsl:apply-templates select="serviceList">
416 <xsl:with-param name="collName" select="$collName"/>
417 </xsl:apply-templates>
418 </xsl:template>
[24018]419
[23813]420 <xsl:template match="serviceList">
421 <xsl:param name="collName"/>
[25003]422 <xsl:if test="service[not(@type = 'query' or @type = 'browse' or @type = 'retrieve' or @type = 'oai')]">
[23813]423 <h3>
424 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/>
425 </h3>
426 <p>
427 <xsl:choose>
428 <xsl:when test="service">
429 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
[19988]430 </xsl:when>
431 <xsl:otherwise>
[23813]432 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
[19988]433 </xsl:otherwise>
[23813]434 </xsl:choose>
[19988]435 </p>
436 <xsl:if test="service">
[23813]437 <div id="servicelist">
438 <xsl:for-each select="service">
439 <xsl:sort select="position()" order="descending" data-type="number"/>
440 <xsl:variable name="action">
[20465]441 <xsl:choose>
[23813]442 <xsl:when test="@type='query'">q</xsl:when>
443 <xsl:when test="@type='browse'">b</xsl:when>
444 <xsl:when test="@type='process'">pr</xsl:when>
445 <xsl:when test="@type='applet'">a</xsl:when>
446 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
[20465]447 </xsl:choose>
[23813]448 </xsl:variable>
449 <xsl:if test="$action != 'DO_NOT_DISPLAY'">
450 <div class="paramLabel">
451 <a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}">
452 <xsl:value-of select="displayItem[@name='name']"/>
453 </a>
454 </div>
455 <div class="paramLabel">
456 <xsl:value-of select="displayItem[@name='description']"/>
457 </div>
458 <br class="clear"/>
459 </xsl:if>
460 </xsl:for-each>
461 </div>
462 </xsl:if>
[18617]463 </xsl:if>
[23813]464 </xsl:template>
[24018]465
[23813]466 <!-- classifier page ............................................................................ -->
467 <xsl:template name="collapsedNavigationTab">
468 <xsl:param name="type"/>
469 <xsl:variable name="isCurrent" select="/page/pageResponse/service[@type=$type]"/>
470 <li>
471 <xsl:if test="$isCurrent">
472 <xsl:attribute name="class">current</xsl:attribute>
473 </xsl:if>
474 <a>
475 <xsl:if test="service[@name=$type]/displayItem[@name='description']">
476 <xsl:attribute name="title">
477 <xsl:value-of select="service[@name=$type]/displayItem[@name='description']"/>
478 </xsl:attribute>
479 </xsl:if>
480 <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>
481 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $type)"/>
482 </a>
483 </li>
484 </xsl:template>
[24018]485
[23813]486 <xsl:template name="navigationTab">
487 <xsl:variable name="isCurrent" select="@name=/page/pageResponse/service/@name"/>
488 <xsl:variable name="action">
489 <xsl:choose>
490 <xsl:when test="@type='query'">q</xsl:when>
491 <xsl:when test="@type='browse'">b</xsl:when>
492 <xsl:when test="@type='process'">pr</xsl:when>
493 <xsl:when test="@type='applet'">a</xsl:when>
494 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
495 </xsl:choose>
496 </xsl:variable>
497 <xsl:if test="$action!='DO_NOT_DISPLAY'">
498 <li>
499 <xsl:if test="$isCurrent">
500 <xsl:attribute name="class">current</xsl:attribute>
501 </xsl:if>
502 <a>
503 <xsl:if test="displayItem[@name='description']">
504 <xsl:attribute name="title">
505 <xsl:value-of select="displayItem[@name='description']"/>
506 </xsl:attribute>
507 </xsl:if>
508 <xsl:choose>
509 <xsl:when test="classifierList/classifier/@name">
510 <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>
511 </xsl:when>
512 <xsl:otherwise>
513 <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>
514 </xsl:otherwise>
515 </xsl:choose>
516 <xsl:value-of select="displayItem[@name='name']"/>
517 </a>
518 </li>
519 </xsl:if>
520 </xsl:template>
[24018]521
[23813]522 <xsl:template name="classifierLink">
523 <xsl:if test="@name=/page/pageResponse/classifier/@name">
524 <xsl:attribute name="class">current</xsl:attribute>
525 </xsl:if>
526 <a href="{$library_name}?a=b&amp;rt=r&amp;s={/page/pageResponse/service/@name}&amp;c={/page/pageResponse/collection/@name}&amp;cl={@name}">
527 <xsl:value-of select="displayItem[@name='description']"/>
528 </a>
529 </xsl:template>
[24018]530
[23813]531 <!-- query page ............................................................................ -->
532 <xsl:template name="indexName">
533 <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
534 </xsl:template>
535 <xsl:template name="queryPageCollectionName">
536 <xsl:choose>
537 <xsl:when test="/page/pageResponse/collection">
538 <gslib:aboutCollectionPageTitle/>
539 </xsl:when>
540 <xsl:otherwise>Cross-Collection</xsl:otherwise>
541 </xsl:choose>
542 </xsl:template>
[24018]543
[23813]544 <!--
[19856]545BERRY BASKET TEMPLATES
546These get used on many different pages to add the
547berry basket function to the site
548-->
[23813]549 <!-- put the drag&drop berry basket on the page -->
550 <xsl:template name="berryBasket">
551 <xsl:if test="$berryBasketOn">
552 <div id="berrybasket" class="hide">
553 <span>Berry Basket</span>
554 <span id="berryBasketExpandCollapseLinks" style="display: none;">
555 <a id="berryBasketExpandLink" href="javascript:showBasket()">Expand</a>
556 <a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()">Collapse</a>
557 </span>
558 <div id="baskethandle">
559 <span>
560 <xsl:text> </xsl:text>
561 </span>
562 </div>
563 <div id="berries">
564 <span>
565 <xsl:text> </xsl:text>
566 </span>
567 </div>
568 </div>
569 </xsl:if>
570 </xsl:template>
[24018]571
[25071]572 <!-- put the drag&drop document basket on the page -->
573 <xsl:template name="documentBasket">
[25144]574 <xsl:if test="$documentBasketOn and /page/pageRequest/userInformation 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))">
[25071]575 <div id="documentbasket" class="hide">
576 <span>Document Basket</span>
577 <span id="documentBasketExpandCollapseLinks" style="display: none;">
578 <a id="documentBasketExpandLink" href="javascript:showDocumentBox()">Expand</a>
579 <a id="documentBasketCollapseLink" style="display: none;" href="javascript:hideDocumentBox()">Collapse</a>
580 </span>
581 <div id="documenthandle">
582 <span>
583 <xsl:text> </xsl:text>
584 </span>
585 </div>
586 <div id="documentpages">
587 <span>
588 <xsl:text> </xsl:text>
589 </span>
590 </div>
591 <div>
592 <a href="javascript:clearBasket();">Clear basket</a>
593 </div>
594 </div>
595 </xsl:if>
596 </xsl:template>
[24510]597
[23813]598 <!-- include the required javascript and css for berry baskets -->
599 <xsl:template name="berryBasketHeadTags">
[24018]600 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script>
601 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script>
602 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/connection-min.js"><xsl:text> </xsl:text></script>
603 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dom-min.js"><xsl:text> </xsl:text></script>
604 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dragdrop-min.js"><xsl:text> </xsl:text></script>
605 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/cookie-min.js"><xsl:text> </xsl:text></script>
[25003]606 <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/animation-min.js"><xsl:text> </xsl:text></script>
607
[24018]608 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDPlayer.js"><xsl:text> </xsl:text></script>
609 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDOnTop.js"><xsl:text> </xsl:text></script>
610 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/berrybasket.js"><xsl:text> </xsl:text></script>
[23813]611 <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/>
[24510]612
613 <!-- Combo-handled YUI CSS files: -->
614 <link rel="stylesheet" type="text/css" href="interfaces/{$interface_name}/style/skin.css"/>
615
616 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentbasket.js"><xsl:text> </xsl:text></script>
617 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentBasketDragDrop.js"><xsl:text> </xsl:text></script>
618 <!-- Combo-handled YUI JS files: -->
619 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yahoo-dom-event.js"><xsl:text> </xsl:text></script>
620 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/container_core-min.js"><xsl:text> </xsl:text></script>
621 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/element-min.js"><xsl:text> </xsl:text></script>
622 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/menu-min.js"><xsl:text> </xsl:text></script>
623 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/button-min.js"><xsl:text> </xsl:text></script>
624 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-min.js"><xsl:text> </xsl:text></script>
625 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yuiloader-min.js"><xsl:text> </xsl:text></script>
626 <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-dialog.js"><xsl:text> </xsl:text></script>-->
627
628 <link rel="stylesheet" href="interfaces/{$interface_name}/style/documentbasket.css" type="text/css"/>
[23813]629 </xsl:template>
[24018]630
[23813]631 <!--
[19856]632create a little berry which can be drag&dropped onto the berry basket
633used on classifier and search result pages
634-->
[23813]635 <xsl:template name="documentBerryForClassifierOrSearchPage">
636 <xsl:if test="$berryBasketOn">
637 <img class="pick" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0">
638 <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
639 </img>
640 </xsl:if>
641 </xsl:template>
[24018]642
[23813]643 <!--
[19856]644create little berrys which can be drag&dropped onto the berry basket
645used on the document page
646-->
[23813]647 <xsl:template name="documentBerryForDocumentPage">
648 <xsl:variable name="selectedNode">
649 <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
650 </xsl:variable>
651 <xsl:variable name="rootNode">
652 <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
653 </xsl:variable>
654 <xsl:if test="$berryBasketOn">
655 <div id="documentberries">
656 <img class="pick" id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
657 <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
[23989]658 <!--<xsl:if test="$selectedNode != $rootNode">
[23813]659 <img class="pick" id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
660 <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
[23989]661 </xsl:if>-->
[23813]662 </div>
663 </xsl:if>
664 </xsl:template>
[24018]665
[23813]666 <!-- document page -->
667 <xsl:template name="documentTitle">
668 <xsl:value-of select="/page/pageResponse/document/documentNode/metadataList/metadata[@name='Title']"/>
669 </xsl:template>
670 <xsl:template name="coverImage">
671 <img>
[23989]672 <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>
[23813]673 </img>
674 </xsl:template>
[24018]675
[23813]676 <xsl:template name="previousNextButtons">
677 <!-- prev -->
678 <a>
679 <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=&quot;p.s&quot;]/@value"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.sa&quot;]/@value"/>&amp;p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.a&quot;]/@value"/></xsl:attribute>
680 <img class="lessarrow" src="interfaces/{$interface_name}/images/previous.png"/>
681 </a>
682 <!-- next -->
683 <a>
684 <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=&quot;p.s&quot;]/@value"/>&amp;p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.sa&quot;]/@value"/>&amp;p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name=&quot;p.a&quot;]/@value"/></xsl:attribute>
685 <img class="morearrow" src="interfaces/{$interface_name}/images/next.png"/>
686 </a>
687 </xsl:template>
[25347]688
[25398]689
[25417]690 <!-- This next template expands gslib:langfrag (used by document.xsl and documentbasket.xsl).
[25398]691 When debugging with o=skinandlibdoc, it's seen that <gslib:langfrag name='dse' /> gets expanded to:
692 <xsl:call-template name="langfrag">
693 <xsl:with-param name="name">dse</xsl:with-param>
694 </xsl:call-template>
695 Before the param can be used in this template, need to retrieve it by name with <xsl:param/>
696 as explained in http://www.maconstateit.net/tutorials/XML/XML05/xml05-05.aspx
697 -->
[25347]698 <xsl:template name="langfrag">
[25398]699 <xsl:param name="name"/>
700 <script type="text/javascript">
701 <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceStringsAsJavascript($interface_name, /page/@lang, $name)"/>
[25347]702 </script>
703 </xsl:template>
704
[18617]705</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.