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

Last change on this file since 25920 was 25920, checked in by sjm84, 12 years ago

Some fixes and tidying

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