source: main/trunk/greenstone3/web/interfaces/default/transform/util.xsl@ 25835

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

Adding a global xslt variable for httpPath

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