source: main/trunk/greenstone3/web/interfaces/oran/transform/util.xsl@ 25071

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

Added a clear basket link to the document basket

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