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">&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">&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"> &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&sa=about&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&rt=d&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&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:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
|
---|
276 | <xsl:param name="pageType"/>
|
---|
277 | <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
|
---|
278 | <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
|
---|
279 |
|
---|
280 | <xsl:template name="aboutCollectionPageTitle">
|
---|
281 | <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
|
---|
282 | <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>
|
---|
283 | <xsl:text> </xsl:text>
|
---|
284 | </xsl:template>
|
---|
285 |
|
---|
286 | <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
|
---|
287 | <a href="{$library_name}?a=p&sa=about&c={$collName}">
|
---|
288 | <xsl:choose>
|
---|
289 | <xsl:when test="$this-element/displayItem[@name='icon']">
|
---|
290 | <img border="0">
|
---|
291 | <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>
|
---|
292 | <xsl:attribute name="alt">
|
---|
293 | <xsl:value-of select="$this-element/displayItem[@name='name']"/>
|
---|
294 | </xsl:attribute>
|
---|
295 | <xsl:attribute name="title">
|
---|
296 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
|
---|
297 | </xsl:attribute>
|
---|
298 | </img>
|
---|
299 | </xsl:when>
|
---|
300 | <xsl:otherwise>
|
---|
301 | <xsl:value-of select="$this-element/displayItem[@name='name']"/>
|
---|
302 | </xsl:otherwise>
|
---|
303 | </xsl:choose>
|
---|
304 | </a>
|
---|
305 | </xsl:template>
|
---|
306 |
|
---|
307 | <xsl:template name="homeButtonTop">
|
---|
308 | <a href="{$library_name}?a=p&sa=home">
|
---|
309 | <xsl:attribute name="title">
|
---|
310 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/>
|
---|
311 | </xsl:attribute>
|
---|
312 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
|
---|
313 | </a>
|
---|
314 | </xsl:template>
|
---|
315 |
|
---|
316 | <xsl:template name="helpButtonTop">
|
---|
317 | <xsl:choose>
|
---|
318 | <xsl:when test="$pageType='help'">
|
---|
319 | <li>
|
---|
320 | <a>
|
---|
321 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
|
---|
322 | </a>
|
---|
323 | </li>
|
---|
324 | </xsl:when>
|
---|
325 | <xsl:otherwise>
|
---|
326 | <li>
|
---|
327 | <a href="{$library_name}?a=p&sa=help&c={$collName}">
|
---|
328 | <xsl:attribute name="title">
|
---|
329 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/>
|
---|
330 | </xsl:attribute>
|
---|
331 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
|
---|
332 | </a>
|
---|
333 | </li>
|
---|
334 | </xsl:otherwise>
|
---|
335 | </xsl:choose>
|
---|
336 | </xsl:template>
|
---|
337 |
|
---|
338 | <xsl:template name="preferencesButtonTop">
|
---|
339 | <xsl:choose>
|
---|
340 | <xsl:when test="$pageType='pref'">
|
---|
341 | <li>
|
---|
342 | <a>
|
---|
343 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
|
---|
344 | </a>
|
---|
345 | </li>
|
---|
346 | </xsl:when>
|
---|
347 | <xsl:otherwise>
|
---|
348 | <li>
|
---|
349 | <a href="{$library_name}?a=p&sa=pref&c={$collName}">
|
---|
350 | <xsl:attribute name="title">
|
---|
351 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/>
|
---|
352 | </xsl:attribute>
|
---|
353 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
|
---|
354 | </a>
|
---|
355 | </li>
|
---|
356 | </xsl:otherwise>
|
---|
357 | </xsl:choose>
|
---|
358 | </xsl:template>
|
---|
359 |
|
---|
360 | <xsl:template name="servicesNavigationBar">
|
---|
361 | <xsl:for-each select="$this-element/serviceList/service">
|
---|
362 | <xsl:variable name="action">
|
---|
363 | <xsl:choose>
|
---|
364 | <xsl:when test="@name=$this-service">CURRENT</xsl:when>
|
---|
365 | <xsl:when test="@type='query'">q</xsl:when>
|
---|
366 | <xsl:when test="@type='browse'">b</xsl:when>
|
---|
367 | <xsl:when test="@type='process'">pr</xsl:when>
|
---|
368 | <xsl:when test="@type='applet'">a</xsl:when>
|
---|
369 | <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
|
---|
370 | </xsl:choose>
|
---|
371 | </xsl:variable>
|
---|
372 | <xsl:choose>
|
---|
373 | <xsl:when test="$action='CURRENT'">
|
---|
374 | <li>
|
---|
375 | <a>
|
---|
376 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
377 | </a>
|
---|
378 | </li>
|
---|
379 | </xsl:when>
|
---|
380 | <xsl:when test="$action !='DO_NOT_DISPLAY'">
|
---|
381 | <li>
|
---|
382 | <a href="{$library_name}?a={$action}&rt=d&s={@name}&c={$collName}">
|
---|
383 | <xsl:if test="displayItem[@name='description']">
|
---|
384 | <xsl:attribute name="title">
|
---|
385 | <xsl:value-of select="displayItem[@name='description']"/>
|
---|
386 | </xsl:attribute>
|
---|
387 | </xsl:if>
|
---|
388 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
389 | </a>
|
---|
390 | </li>
|
---|
391 | </xsl:when>
|
---|
392 | </xsl:choose>
|
---|
393 | </xsl:for-each>
|
---|
394 | </xsl:template>
|
---|
395 |
|
---|
396 | <xsl:template name="collectionDescriptionTextAndServicesLinks">
|
---|
397 | <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
|
---|
398 | </xsl:template>
|
---|
399 | <xsl:template match="collection|serviceCluster">
|
---|
400 | <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
|
---|
401 | <xsl:apply-templates select="serviceList">
|
---|
402 | <xsl:with-param name="collName" select="$collName"/>
|
---|
403 | </xsl:apply-templates>
|
---|
404 | </xsl:template>
|
---|
405 |
|
---|
406 | <xsl:template match="serviceList">
|
---|
407 | <xsl:param name="collName"/>
|
---|
408 | <xsl:if test="service[not(@type = 'query' or @type = 'browse' or @type = 'retrieve' or @type = 'oai')]">
|
---|
409 | <h3>
|
---|
410 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/>
|
---|
411 | </h3>
|
---|
412 | <p>
|
---|
413 | <xsl:choose>
|
---|
414 | <xsl:when test="service">
|
---|
415 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
|
---|
416 | </xsl:when>
|
---|
417 | <xsl:otherwise>
|
---|
418 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
|
---|
419 | </xsl:otherwise>
|
---|
420 | </xsl:choose>
|
---|
421 | </p>
|
---|
422 | <xsl:if test="service">
|
---|
423 | <div id="servicelist">
|
---|
424 | <xsl:for-each select="service">
|
---|
425 | <xsl:sort select="position()" order="descending" data-type="number"/>
|
---|
426 | <xsl:variable name="action">
|
---|
427 | <xsl:choose>
|
---|
428 | <xsl:when test="@type='query'">q</xsl:when>
|
---|
429 | <xsl:when test="@type='browse'">b</xsl:when>
|
---|
430 | <xsl:when test="@type='process'">pr</xsl:when>
|
---|
431 | <xsl:when test="@type='applet'">a</xsl:when>
|
---|
432 | <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
|
---|
433 | </xsl:choose>
|
---|
434 | </xsl:variable>
|
---|
435 | <xsl:if test="$action != 'DO_NOT_DISPLAY'">
|
---|
436 | <div class="paramLabel">
|
---|
437 | <a href="{$library_name}?a={$action}&rt=d&s={@name}&c={$collName}">
|
---|
438 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
439 | </a>
|
---|
440 | </div>
|
---|
441 | <div class="paramLabel">
|
---|
442 | <xsl:value-of select="displayItem[@name='description']"/>
|
---|
443 | </div>
|
---|
444 | <br class="clear"/>
|
---|
445 | </xsl:if>
|
---|
446 | </xsl:for-each>
|
---|
447 | </div>
|
---|
448 | </xsl:if>
|
---|
449 | </xsl:if>
|
---|
450 | </xsl:template>
|
---|
451 |
|
---|
452 | <!-- classifier page ............................................................................ -->
|
---|
453 | <xsl:template name="collapsedNavigationTab">
|
---|
454 | <xsl:param name="type"/>
|
---|
455 | <xsl:variable name="isCurrent" select="/page/pageResponse/service[@type=$type]"/>
|
---|
456 | <li>
|
---|
457 | <xsl:if test="$isCurrent">
|
---|
458 | <xsl:attribute name="class">current</xsl:attribute>
|
---|
459 | </xsl:if>
|
---|
460 | <a>
|
---|
461 | <xsl:if test="service[@name=$type]/displayItem[@name='description']">
|
---|
462 | <xsl:attribute name="title">
|
---|
463 | <xsl:value-of select="service[@name=$type]/displayItem[@name='description']"/>
|
---|
464 | </xsl:attribute>
|
---|
465 | </xsl:if>
|
---|
466 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=q&rt=d&s=<xsl:value-of select="service[@type=$type]/@name"/>&c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
|
---|
467 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, $type)"/>
|
---|
468 | </a>
|
---|
469 | </li>
|
---|
470 | </xsl:template>
|
---|
471 |
|
---|
472 | <xsl:template name="navigationTab">
|
---|
473 | <xsl:variable name="isCurrent" select="@name=/page/pageResponse/service/@name"/>
|
---|
474 | <xsl:variable name="action">
|
---|
475 | <xsl:choose>
|
---|
476 | <xsl:when test="@type='query'">q</xsl:when>
|
---|
477 | <xsl:when test="@type='browse'">b</xsl:when>
|
---|
478 | <xsl:when test="@type='process'">pr</xsl:when>
|
---|
479 | <xsl:when test="@type='applet'">a</xsl:when>
|
---|
480 | <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
|
---|
481 | </xsl:choose>
|
---|
482 | </xsl:variable>
|
---|
483 | <xsl:if test="$action!='DO_NOT_DISPLAY'">
|
---|
484 | <li>
|
---|
485 | <xsl:if test="$isCurrent">
|
---|
486 | <xsl:attribute name="class">current</xsl:attribute>
|
---|
487 | </xsl:if>
|
---|
488 | <a>
|
---|
489 | <xsl:if test="displayItem[@name='description']">
|
---|
490 | <xsl:attribute name="title">
|
---|
491 | <xsl:value-of select="displayItem[@name='description']"/>
|
---|
492 | </xsl:attribute>
|
---|
493 | </xsl:if>
|
---|
494 | <xsl:choose>
|
---|
495 | <xsl:when test="classifierList/classifier/@name">
|
---|
496 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&rt=s&s=<xsl:value-of select="@name"/>&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&cl=<xsl:value-of select="classifierList/classifier/@name"/></xsl:attribute>
|
---|
497 | </xsl:when>
|
---|
498 | <xsl:otherwise>
|
---|
499 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=<xsl:value-of select="$action"/>&rt=d&s=<xsl:value-of select="@name"/>&c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
|
---|
500 | </xsl:otherwise>
|
---|
501 | </xsl:choose>
|
---|
502 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
503 | </a>
|
---|
504 | </li>
|
---|
505 | </xsl:if>
|
---|
506 | </xsl:template>
|
---|
507 |
|
---|
508 | <xsl:template name="classifierLink">
|
---|
509 | <xsl:if test="@name=/page/pageResponse/classifier/@name">
|
---|
510 | <xsl:attribute name="class">current</xsl:attribute>
|
---|
511 | </xsl:if>
|
---|
512 | <a href="{$library_name}?a=b&rt=r&s={/page/pageResponse/service/@name}&c={/page/pageResponse/collection/@name}&cl={@name}">
|
---|
513 | <xsl:value-of select="displayItem[@name='description']"/>
|
---|
514 | </a>
|
---|
515 | </xsl:template>
|
---|
516 |
|
---|
517 | <!-- query page ............................................................................ -->
|
---|
518 | <xsl:template name="indexName">
|
---|
519 | <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/>
|
---|
520 | </xsl:template>
|
---|
521 | <xsl:template name="queryPageCollectionName">
|
---|
522 | <xsl:choose>
|
---|
523 | <xsl:when test="/page/pageResponse/collection">
|
---|
524 | <gslib:aboutCollectionPageTitle/>
|
---|
525 | </xsl:when>
|
---|
526 | <xsl:otherwise>Cross-Collection</xsl:otherwise>
|
---|
527 | </xsl:choose>
|
---|
528 | </xsl:template>
|
---|
529 |
|
---|
530 | <!--
|
---|
531 | BERRY BASKET TEMPLATES
|
---|
532 | These get used on many different pages to add the
|
---|
533 | berry basket function to the site
|
---|
534 | -->
|
---|
535 | <!-- put the drag&drop berry basket on the page -->
|
---|
536 | <xsl:template name="berryBasket">
|
---|
537 | <xsl:if test="$berryBasketOn">
|
---|
538 | <div id="berrybasket" class="hide">
|
---|
539 | <span>Berry Basket</span>
|
---|
540 | <span id="berryBasketExpandCollapseLinks" style="display: none;">
|
---|
541 | <a id="berryBasketExpandLink" href="javascript:showBasket()">Expand</a>
|
---|
542 | <a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()">Collapse</a>
|
---|
543 | </span>
|
---|
544 | <div id="baskethandle">
|
---|
545 | <span>
|
---|
546 | <xsl:text> </xsl:text>
|
---|
547 | </span>
|
---|
548 | </div>
|
---|
549 | <div id="berries">
|
---|
550 | <span>
|
---|
551 | <xsl:text> </xsl:text>
|
---|
552 | </span>
|
---|
553 | </div>
|
---|
554 | </div>
|
---|
555 | </xsl:if>
|
---|
556 | </xsl:template>
|
---|
557 |
|
---|
558 | <!-- put the drag&drop document basket on the page -->
|
---|
559 | <xsl:template name="documentBasket">
|
---|
560 | <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))">
|
---|
561 | <div id="documentbasket" class="hide">
|
---|
562 | <span>Document Basket</span>
|
---|
563 | <span id="documentBasketExpandCollapseLinks" style="display: none;">
|
---|
564 | <a id="documentBasketExpandLink" href="javascript:showDocumentBox()">Expand</a>
|
---|
565 | <a id="documentBasketCollapseLink" style="display: none;" href="javascript:hideDocumentBox()">Collapse</a>
|
---|
566 | </span>
|
---|
567 | <div id="documenthandle">
|
---|
568 | <span>
|
---|
569 | <xsl:text> </xsl:text>
|
---|
570 | </span>
|
---|
571 | </div>
|
---|
572 | <div id="documentpages">
|
---|
573 | <span>
|
---|
574 | <xsl:text> </xsl:text>
|
---|
575 | </span>
|
---|
576 | </div>
|
---|
577 | <div>
|
---|
578 | <a href="javascript:clearBasket();">Clear basket</a>
|
---|
579 | </div>
|
---|
580 | </div>
|
---|
581 | </xsl:if>
|
---|
582 | </xsl:template>
|
---|
583 |
|
---|
584 | <!-- include the required javascript and css for berry baskets -->
|
---|
585 | <xsl:template name="berryBasketHeadTags">
|
---|
586 | <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/yahoo-min.js"><xsl:text> </xsl:text></script>
|
---|
587 | <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/event-min.js"><xsl:text> </xsl:text></script>
|
---|
588 | <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/connection-min.js"><xsl:text> </xsl:text></script>
|
---|
589 | <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dom-min.js"><xsl:text> </xsl:text></script>
|
---|
590 | <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/dragdrop-min.js"><xsl:text> </xsl:text></script>
|
---|
591 | <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/cookie-min.js"><xsl:text> </xsl:text></script>
|
---|
592 | <script type="text/javascript" src="interfaces/{$interface_name}/js/yui/animation-min.js"><xsl:text> </xsl:text></script>
|
---|
593 |
|
---|
594 | <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDPlayer.js"><xsl:text> </xsl:text></script>
|
---|
595 | <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/ygDDOnTop.js"><xsl:text> </xsl:text></script>
|
---|
596 | <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket/berrybasket.js"><xsl:text> </xsl:text></script>
|
---|
597 | <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/>
|
---|
598 |
|
---|
599 | <!-- Combo-handled YUI CSS files: -->
|
---|
600 | <link rel="stylesheet" type="text/css" href="interfaces/{$interface_name}/style/skin.css"/>
|
---|
601 |
|
---|
602 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentbasket.js"><xsl:text> </xsl:text></script>
|
---|
603 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/documentBasketDragDrop.js"><xsl:text> </xsl:text></script>
|
---|
604 | <!-- Combo-handled YUI JS files: -->
|
---|
605 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yahoo-dom-event.js"><xsl:text> </xsl:text></script>
|
---|
606 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/container_core-min.js"><xsl:text> </xsl:text></script>
|
---|
607 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/element-min.js"><xsl:text> </xsl:text></script>
|
---|
608 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/menu-min.js"><xsl:text> </xsl:text></script>
|
---|
609 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/button-min.js"><xsl:text> </xsl:text></script>
|
---|
610 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-min.js"><xsl:text> </xsl:text></script>
|
---|
611 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/yuiloader-min.js"><xsl:text> </xsl:text></script>
|
---|
612 | <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/documentbasket/editor-dialog.js"><xsl:text> </xsl:text></script>-->
|
---|
613 |
|
---|
614 | <link rel="stylesheet" href="interfaces/{$interface_name}/style/documentbasket.css" type="text/css"/>
|
---|
615 | </xsl:template>
|
---|
616 |
|
---|
617 | <!--
|
---|
618 | create a little berry which can be drag&dropped onto the berry basket
|
---|
619 | used on classifier and search result pages
|
---|
620 | -->
|
---|
621 | <xsl:template name="documentBerryForClassifierOrSearchPage">
|
---|
622 | <xsl:if test="$berryBasketOn">
|
---|
623 | <img class="pick" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0">
|
---|
624 | <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
|
---|
625 | </img>
|
---|
626 | </xsl:if>
|
---|
627 | </xsl:template>
|
---|
628 |
|
---|
629 | <!--
|
---|
630 | create little berrys which can be drag&dropped onto the berry basket
|
---|
631 | used on the document page
|
---|
632 | -->
|
---|
633 | <xsl:template name="documentBerryForDocumentPage">
|
---|
634 | <xsl:variable name="selectedNode">
|
---|
635 | <xsl:value-of select="/page/pageResponse/document/@selectedNode"/>
|
---|
636 | </xsl:variable>
|
---|
637 | <xsl:variable name="rootNode">
|
---|
638 | <xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/>
|
---|
639 | </xsl:variable>
|
---|
640 | <xsl:if test="$berryBasketOn">
|
---|
641 | <div id="documentberries">
|
---|
642 | <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"/>
|
---|
643 | <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
|
---|
644 | <!--<xsl:if test="$selectedNode != $rootNode">
|
---|
645 | <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"/>
|
---|
646 | <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
|
---|
647 | </xsl:if>-->
|
---|
648 | </div>
|
---|
649 | </xsl:if>
|
---|
650 | </xsl:template>
|
---|
651 |
|
---|
652 | <!-- document page -->
|
---|
653 | <xsl:template name="documentTitle">
|
---|
654 | <xsl:value-of select="/page/pageResponse/document/documentNode/metadataList/metadata[@name='Title']"/>
|
---|
655 | </xsl:template>
|
---|
656 | <xsl:template name="coverImage">
|
---|
657 | <img>
|
---|
658 | <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>
|
---|
659 | </img>
|
---|
660 | </xsl:template>
|
---|
661 |
|
---|
662 | <xsl:template name="previousNextButtons">
|
---|
663 | <!-- prev -->
|
---|
664 | <a>
|
---|
665 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&d=<xsl:value-of select="@selectedNode"/>.pp&sib=1&p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name="p.s"]/@value"/>&p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name="p.sa"]/@value"/>&p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name="p.a"]/@value"/></xsl:attribute>
|
---|
666 | <img class="lessarrow" src="interfaces/{$interface_name}/images/previous.png"/>
|
---|
667 | </a>
|
---|
668 | <!-- next -->
|
---|
669 | <a>
|
---|
670 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&d=<xsl:value-of select="@selectedNode"/>.np&sib=1&p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name="p.s"]/@value"/>&p.sa=<xsl:value-of select="/page/pageRequest/paramList/param[@name="p.sa"]/@value"/>&p.a=<xsl:value-of select="/page/pageRequest/paramList/param[@name="p.a"]/@value"/></xsl:attribute>
|
---|
671 | <img class="morearrow" src="interfaces/{$interface_name}/images/next.png"/>
|
---|
672 | </a>
|
---|
673 | </xsl:template>
|
---|
674 |
|
---|
675 |
|
---|
676 | <!-- This next template expands gslib:langfrag (used by document.xsl and documentbasket.xsl).
|
---|
677 | When debugging with o=skinandlibdoc, it's seen that <gslib:langfrag name='dse' /> gets expanded to:
|
---|
678 | <xsl:call-template name="langfrag">
|
---|
679 | <xsl:with-param name="name">dse</xsl:with-param>
|
---|
680 | </xsl:call-template>
|
---|
681 | Before the param can be used in this template, need to retrieve it by name with <xsl:param/>
|
---|
682 | as explained in http://www.maconstateit.net/tutorials/XML/XML05/xml05-05.aspx
|
---|
683 | -->
|
---|
684 | <xsl:template name="langfrag">
|
---|
685 | <xsl:param name="name"/>
|
---|
686 | <script type="text/javascript">
|
---|
687 | <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceStringsAsJavascript($interface_name, /page/@lang, $name)"/>
|
---|
688 | </script>
|
---|
689 | </xsl:template>
|
---|
690 |
|
---|
691 | </xsl:stylesheet>
|
---|