source: main/trunk/greenstone3/web/interfaces/default_old/transform/layouts/header.xsl@ 29861

Last change on this file since 29861 was 29861, checked in by Georgiy Litvinov, 9 years ago

renamed interfaces

  • Property svn:executable set to *
File size: 29.4 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util gsf">
10
11 <xsl:include href="../query-common.xsl"/>
12 <xsl:include href="../javascript-global-setup.xsl"/>
13
14 <!-- If the c parameter is empty then use the p.c parameter for the collection name-->
15 <xsl:variable name="collNameChecked">
16 <xsl:choose>
17 <xsl:when test="$collName = '' and /page/pageRequest/paramList/param[@name='p.c']/@value">
18 <xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/>
19 </xsl:when>
20 <xsl:otherwise>
21 <xsl:value-of select="$collName"/>
22 </xsl:otherwise>
23 </xsl:choose>
24 </xsl:variable>
25
26 <!-- Creates a header for the html page -->
27 <xsl:template name="create-html-header">
28 <base>
29 <xsl:attribute name="href">
30 <xsl:choose>
31 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'siteURL']">
32 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'siteURL']"/>
33 </xsl:when>
34 <xsl:when test="/page/pageRequest/@baseURL">
35 <xsl:value-of select="/page/pageRequest/@baseURL"/>
36 </xsl:when>
37 </xsl:choose>
38 </xsl:attribute>
39 </base>
40 <xsl:comment>[if lte IE 6]&gt;&lt;/base&gt;&lt;![endif]</xsl:comment>
41
42 <title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
43
44 <xsl:if test="/page/pageRequest/@action ='d'">
45
46 <xsl:variable name="myMetadataHeader" select="/page/pageResponse/format/gsf:headMetaTags/gsf:metadata"/>
47 <xsl:for-each select="$myMetadataHeader">
48 <xsl:variable name="metaname" select="@name"/>
49
50 <xsl:variable name="metavals"
51 select="/page/pageResponse/document/metadataList/metadata[@name = $metaname]|/page/pageResponse/document/documentNode/metadataList/metadata[@name = $metaname]"/>
52 <xsl:for-each select="$metavals">
53 <META NAME="{$metaname}" CONTENT="{.}"/>
54 </xsl:for-each>
55 </xsl:for-each>
56
57 </xsl:if>
58
59 <xsl:choose>
60 <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value">
61 <!-- Get the theme from the interfaceConfig.xml file -->
62 <link rel="stylesheet" href="{/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value}" type="text/css"/>
63 </xsl:when>
64 <xsl:otherwise>
65 <link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui-1.8.16.custom.css" type="text/css"/>
66 </xsl:otherwise>
67 </xsl:choose>
68 <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
69 <link rel="shortcut icon" href="interfaces/{$interface_name}/images/favicon.ico"/>
70
71 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.min.js"><xsl:text> </xsl:text></script>
72 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery-ui-1.10.2.custom/js/jquery-ui-1.10.2.custom.min.js"><xsl:text> </xsl:text></script>
73 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.themeswitcher.min.js"><xsl:text> </xsl:text></script>
74 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.blockUI.js"><xsl:text> </xsl:text></script>
75 <script type="text/javascript" src="interfaces/{$interface_name}/js/ace/ace.js"><xsl:text> </xsl:text></script>
76
77 <script type="text/javascript" src="interfaces/{$interface_name}/js/zoomer.js"><xsl:text> </xsl:text></script>
78
79 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
80 <xsl:call-template name="map-scripts"/>
81 </xsl:if>
82
83 <xsl:if test="/page/pageResponse/format/gsf:option[@name='mapEnabledOpenLayers']/@value = 'true'">
84 <xsl:call-template name="openlayers-map-scripts"/>
85 </xsl:if>
86
87
88 <xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
89 <xsl:call-template name="panoramaViewer-scripts"/>
90 </xsl:if>
91
92 <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' 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))">
93 <xsl:if test="/page/pageRequest/paramList/param[(@name='docEdit') and (@value='on' or @value='true' or @value='1')]">
94 <script type="text/javascript" src="interfaces/{$interface_name}/js/direct-edit.js"><xsl:text> </xsl:text></script>
95 <xsl:call-template name="init-direct-edit"/>
96 </xsl:if>
97 <script type="text/javascript" src="interfaces/{$interface_name}/js/debug_scripts.js"><xsl:text> </xsl:text></script>
98 <script type="text/javascript" src="interfaces/{$interface_name}/js/visual-xml-editor.js"><xsl:text> </xsl:text></script>
99 </xsl:if>
100
101 <xsl:call-template name="setup-gs-variable"/>
102 <xsl:call-template name="define-js-macro-variables"/>
103
104 <xsl:call-template name="additionalHeaderContent"/>
105 </xsl:template>
106
107 <!-- This template allows for extra header content to be added by interface, site and collection. -->
108 <xsl:template name="additionalHeaderContent">
109 <xsl:call-template name="additionalHeaderContent-interface"/>
110 <xsl:call-template name="additionalHeaderContent-site"/>
111 <xsl:call-template name="additionalHeaderContent-collection"/>
112 </xsl:template>
113 <!-- This template should be overridden in header.xsl of a new interface file if you want to add extra header content -->
114 <xsl:template name="additionalHeaderContent-interface">
115 </xsl:template>
116 <!-- This template should be overridden in the header.xsl file in a site's transform directory if you want to add site specific headers -->
117 <xsl:template name="additionalHeaderContent-site">
118 </xsl:template>
119 <!-- This template should be overridden in the collectionConfig.xml file if you want to add extra header content -->
120 <xsl:template name="additionalHeaderContent-collection">
121 </xsl:template>
122
123 <xsl:template name="init-direct-edit">
124 <script type="text/javascript">
125 <xsl:text disable-output-escaping="yes">
126 de.onready(function()
127 {
128 try
129 {
130 de.init();
131 }
132 catch (err)
133 {
134 alert("Seaweed failed to initialise: " + err.message);
135 }
136 });
137 </xsl:text>
138 </script>
139 </xsl:template>
140
141 <!-- ***** HEADER LAYOUT TEMPLATE ***** -->
142 <xsl:template name="create-banner">
143 <div id="gs_banner" class="ui-widget-header ui-corner-bottom">
144 <div id="titlesearchcontainer">
145 <xsl:call-template name="page-title-area"/>
146 <xsl:call-template name="quick-search-area"/>
147 <div style="clear:both;"><xsl:text> </xsl:text></div>
148 </div>
149 <xsl:call-template name="browsing-tabs"/>
150 </div>
151 </xsl:template>
152
153 <!-- ***** BROWSING TABS ***** -->
154 <xsl:template name="browsing-tabs">
155 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service">
156 <ul id="gs-nav">
157 <!-- If this collection has a ClassifierBrowse service then add a tab for each classifier-->
158 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='browse' and @name='ClassifierBrowse']">
159 <!-- Loop through each classifier -->
160 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
161 <li>
162 <xsl:choose>
163 <!-- If this tab is selected then colour it differently -->
164 <xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
165 <xsl:attribute name='class'>ui-state-default ui-corner-top ui-tabs-selected ui-state-active</xsl:attribute>
166 </xsl:when>
167 <xsl:otherwise>
168 <xsl:attribute name='class'>ui-state-default ui-corner-top</xsl:attribute>
169 </xsl:otherwise>
170 </xsl:choose>
171
172 <a>
173 <!-- Add a title element to the <a> tag if a description exists for this classifier -->
174 <xsl:if test="displayItem[@name='description']">
175 <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
176 </xsl:if>
177
178 <!-- Add the href element to the <a> tag -->
179 <xsl:choose>
180 <xsl:when test="@name">
181 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/<xsl:value-of select="@name"/></xsl:attribute>
182 </xsl:when>
183 <xsl:otherwise>
184 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/1</xsl:attribute>
185 </xsl:otherwise>
186 </xsl:choose>
187
188 <!-- Add the actual text of the <a> tag -->
189 <xsl:value-of select="displayItem[@name='name']"/>
190 </a>
191 </li>
192 </xsl:for-each>
193 </xsl:if>
194
195 <!-- PhindApplet. Need something similar for the Collage applet too, probably -->
196 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='PhindApplet']">
197 <li>
198 <xsl:choose>
199 <!-- If this tab is selected then colour it differently -->
200 <xsl:when test="/page/pageRequest[@action='a']">
201 <xsl:attribute name='class'>ui-state-default ui-corner-top ui-tabs-selected ui-state-active</xsl:attribute>
202 </xsl:when>
203 <xsl:otherwise>
204 <xsl:attribute name='class'>ui-state-default ui-corner-top</xsl:attribute>
205 </xsl:otherwise>
206 </xsl:choose>
207
208 <a>
209 <xsl:if test="displayItem[@name='description']">
210 <xsl:attribute name="title">
211 <xsl:value-of select="displayItem[@name='description']"/>
212 </xsl:attribute>
213 </xsl:if>
214 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=a&amp;rt=d&amp;s=<xsl:value-of select="@name"/>&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:attribute>
215 <xsl:value-of select="displayItem[@name='name']"/>
216 </a>
217 </li>
218 </xsl:for-each>
219
220 <!-- all other services -->
221 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[not(@type='query') and not(@type='browse') and not (@name='PhindApplet')]">
222 <xsl:call-template name="navigationTab"/>
223 </xsl:for-each>
224 </ul>
225 <div style="clear:both;"><xsl:text> </xsl:text></div>
226 </xsl:if>
227 </xsl:template>
228
229 <!-- ***** HOME HELP PREFERENCES LOGIN ***** -->
230 <xsl:template name="home-help-preferences">
231 <ul id="bannerLinks">
232
233 <!-- RSS feed link can appear in a global format statement (where it has no type attribute)
234 or in section specific format statements, such as browse, search, display.
235 If it's present in any format statement, display the RSS link in the bannerlinks section. -->
236 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search' or not(@type)]/gsf:option[@name='RSS']/@value = 'true'">
237 <li><gsf:link type="rss"><gsf:icon file="rssicon.png"/></gsf:link></li>
238 </xsl:if>
239
240 <!-- preferences -->
241 <li>
242 <a href="{$library_name}/collection/{$collNameChecked}/page/pref">
243 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
244 <span id="preferencesButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></span>
245 <script type="text/javascript">
246 <xsl:text disable-output-escaping="yes">
247 $("#preferencesButton").button({icons:{primary:"ui-icon-wrench"}});
248 $("#preferencesButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
249 </xsl:text>
250 </script>
251 </a>
252 </li>
253
254 <!-- help -->
255 <li>
256 <a href="{$library_name}/collection/{$collNameChecked}/page/help">
257 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
258 <span id="helpButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></span>
259 <script type="text/javascript">
260 <xsl:text disable-output-escaping="yes">
261 $("#helpButton").button({icons:{primary:"ui-icon-help"}});
262 $("#helpButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
263 </xsl:text>
264 </script>
265 </a>
266 </li>
267
268 <!-- login/logout -->
269 <li id="userMenuButton">
270 <xsl:choose>
271 <xsl:when test="/page/pageRequest/userInformation/@username">
272 <a>
273 <xsl:attribute name="href">javascript:toggleUserMenu();</xsl:attribute>
274 <script type="text/javascript">
275 <xsl:text disable-output-escaping="yes">
276 function toggleUserMenu()
277 {
278 var button = $("#userMenuButton");
279 var menu;
280
281 if(button.data("userMenu"))
282 {
283 menu = button.data("userMenu");
284 if(menu.css("display") == "block")
285 {
286 menu.hide();
287 }
288 else
289 {
290 menu.show();
291 }
292 }
293 else
294 {
295 menu = $("&lt;UL&gt;")
296 .css("position", "absolute")
297 .css("display", "block")
298 .css("z-index", "100")
299 .css("list-style", "none outside none")
300 .css("margin", "0px")
301 .css("padding", "0px")
302 .css("font-size", "90%");
303
304 menu.attr("id", "userMenu");
305
306 button.data("userMenu", menu);
307
308 var settingsLink = $("&lt;a&gt;")
309 .attr("href", gs.xsltParams.library_name + "/admin/AccountSettings?s1.username=</xsl:text><xsl:value-of select="/page/pageRequest/userInformation/@username"/><xsl:text disable-output-escaping="yes">");
310 var settingsButton = $("&lt;LI&gt;")
311 .css("padding", "3px")
312 .html("Account settings")
313 .addClass("ui-state-default");
314 settingsLink.append(settingsButton);
315
316 var editingLink = $("&lt;a&gt;")
317 .attr("href", "javascript:;");
318 var editingButton = $("&lt;LI&gt;")
319 .css("padding", "3px")
320 .html((gs.userInformation.editEnabled == "true") ? "Disable edit mode" : "Enable edit mode")
321 .addClass("ui-state-default")
322 .click(function()
323 {
324 var url = gs.xsltParams.library_name + "?a=g&amp;rt=ro&amp;s=ChangeUserEditMode&amp;s1.username=" + gs.userInformation.username + "&amp;s1.enabled=" + ((gs.userInformation.editEnabled == "true") ? "false" : "true");
325 $.ajax(url)
326 .success(function(response)
327 {
328 location.reload();
329 });
330 });
331 editingLink.append(editingButton);
332
333 var url = document.URL;
334 var hasQueryString = (url.indexOf("?") != -1);
335 var hashIndex = url.indexOf("#");
336
337 var hashPart;
338 if(hashIndex != -1)
339 {
340 hashPart = url.substring(hashIndex);
341 url = url.substring(0, hashIndex);
342 }
343
344 var logoutLink = $("&lt;a&gt;")
345 .attr("href", url + (hasQueryString ? "&amp;" : "?") + "logout=" + (hashPart ? hashPart : ""));
346 var logoutButton = $("&lt;LI&gt;")
347 .css("padding", "3px")
348 .html("Logout")
349 .addClass("ui-state-default");
350 logoutLink.append(logoutButton);
351
352 menu.append(settingsLink);
353 menu.append(editingLink);
354 menu.append(logoutLink);
355
356 var buttonLeft = button.offset().left;
357 var buttonTop = button.offset().top;
358
359 var buttonHeight = button.height();
360
361 menu.offset({top: buttonTop + buttonHeight + 4, left: buttonLeft});
362 $("#topArea").append(menu);
363 }
364 }
365 </xsl:text>
366 </script>
367 <span id="loginButton"><xsl:value-of select="/page/pageRequest/userInformation/@username"/></span>
368 <script type="text/javascript">
369 <xsl:text disable-output-escaping="yes">
370 $("#loginButton").button({icons:{primary:"ui-icon-unlocked"}});
371 $("#loginButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
372 </xsl:text>
373 </script>
374 </a>
375 </xsl:when>
376 <xsl:otherwise>
377 <a>
378 <xsl:attribute name="href">
379 <xsl:value-of select="$library_name"/>
380 <xsl:text>?a=p&amp;sa=login&amp;redirectURL=</xsl:text>
381 <xsl:value-of select="$library_name"/>
382 <xsl:text>%3F</xsl:text>
383 <xsl:if test="/page/pageRequest/@action">
384 <xsl:text>a=</xsl:text>
385 <xsl:value-of select="/page/pageRequest/@action"/>
386 </xsl:if>
387 <xsl:if test="/page/pageRequest/@subaction">
388 <xsl:text>%26sa=</xsl:text>
389 <xsl:value-of select="/page/pageRequest/@subaction"/>
390 </xsl:if>
391 <xsl:for-each select="/page/pageRequest/paramList/param">
392 <xsl:if test="@name != 'password' and @name != 's1.password' and @name != 's1.newPassword' and @name != 's1.oldPassword'">
393 <xsl:text>%26</xsl:text>
394 <xsl:value-of select="@name"/>
395 <xsl:text>=</xsl:text>
396 <xsl:value-of select="@value"/>
397 </xsl:if>
398 </xsl:for-each>
399 </xsl:attribute>
400 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/></xsl:attribute>
401 <span id="loginButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_b')"/></span>
402 <script type="text/javascript">
403 <xsl:text disable-output-escaping="yes">
404 $("#loginButton").button({icons:{primary:"ui-icon-locked"}});
405 $("#loginButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
406 </xsl:text>
407 </script>
408 </a>
409 </xsl:otherwise>
410 </xsl:choose>
411 </li>
412 <!-- debuginfo (doesn't use class="ui-state-error" since the text is not legible due to inherited text-colour) -->
413 <xsl:if test="/page/pageRequest/paramList/param[(@name='debug') and (@value='on' or @value='true' or @value='1' or @value='yes')]">
414 <li>
415 <a href="{$library_name}/collection/{$collNameChecked}/page/debug">
416 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'debuginfo_tip')"/></xsl:attribute>
417 <span id="debugButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'debuginfo_b')"/></span>
418 <script type="text/javascript">
419 <xsl:text disable-output-escaping="yes">
420 $("#debugButton").button({icons:{primary:"ui-icon-info"}});
421 $("#debugButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"});
422 </xsl:text>
423 </script>
424 </a>
425 </li>
426 </xsl:if>
427 </ul>
428 </xsl:template>
429
430 <!-- ***** PAGE TITLE ***** -->
431 <xsl:template name="page-title-area">
432 <xsl:variable name="pageTitleVar"><xsl:call-template name="pageTitle"/></xsl:variable>
433 <div id="titlearea">
434 <h2>
435 <!-- Resize the title based on how long it is (There's probably a better way to do this) -->
436 <xsl:attribute name="style">
437 <xsl:choose>
438 <xsl:when test="string-length($pageTitleVar) &lt; 20">
439 <xsl:text>font-size: 1.5em;</xsl:text>
440 </xsl:when>
441 <xsl:when test="string-length($pageTitleVar) &lt; 30">
442 <xsl:text>font-size: 1.4em;</xsl:text>
443 </xsl:when>
444 <xsl:when test="string-length($pageTitleVar) &lt; 40">
445 <xsl:text>font-size: 1.3em;</xsl:text>
446 </xsl:when>
447 <xsl:when test="string-length($pageTitleVar) &lt; 50">
448 <xsl:text>font-size: 1.2em;</xsl:text>
449 </xsl:when>
450 <xsl:when test="string-length($pageTitleVar) &lt; 60">
451 <xsl:text>font-size: 1.1em;</xsl:text>
452 </xsl:when>
453 <xsl:when test="string-length($pageTitleVar) &lt; 70">
454 <xsl:text>font-size: 1em;</xsl:text>
455 </xsl:when>
456 <xsl:when test="string-length($pageTitleVar) &lt; 80">
457 <xsl:text>font-size: 0.9em;</xsl:text>
458 </xsl:when>
459 <xsl:when test="string-length($pageTitleVar) &lt; 90">
460 <xsl:text>font-size: 0.8em;</xsl:text>
461 </xsl:when>
462 <xsl:otherwise>
463 <xsl:text>font-size: 0.7em;</xsl:text>
464 </xsl:otherwise>
465 </xsl:choose>
466 </xsl:attribute>
467 <!--<xsl:value-of select="string-length($pageTitleVar)" />-->
468 <xsl:value-of select="$pageTitleVar" />
469 </h2><xsl:text> </xsl:text>
470 </div>
471 </xsl:template>
472
473 <!-- ***** QUICK SEARCH AREA ***** -->
474 <!-- Search form should only appear if there's a search (query) service AND it has an index.
475 By default, all collections end up with some query service (default is MGPP) even when they have
476 no search indexes, which is why the extra test for the presence of an index/fq-something is necessary. -->
477 <xsl:template name="quick-search-area">
478 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
479 <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
480 <div id="quicksearcharea">
481 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
482 <xsl:choose>
483 <xsl:when test="not(page/pageRequest[@action='q']) or /page/pageRequest/paramList/param[@name='qs']/@value = '1'">
484 <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
485 <!-- This parameter says that we have come from the quick search area -->
486 <input type="hidden" name="qs" value="1"/>
487 <input type="hidden" name="rt" value="rd"/>
488 <input type="hidden" name="s1.level">
489 <xsl:attribute name="value">
490 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
491 </xsl:attribute>
492 </input>
493 <xsl:choose>
494 <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
495 <input type="hidden" name="s1.startPage" value="1"/>
496 </xsl:when>
497 <xsl:otherwise>
498 <input type="hidden" name="startPage" value="1"/>
499 </xsl:otherwise>
500 </xsl:choose>
501
502 <!-- The query text box -->
503 <span class="querybox">
504 <xsl:variable name="qs">
505 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
506 </xsl:variable>
507 <nobr>
508 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
509 <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
510 </xsl:apply-templates>
511 </nobr>
512 </span>
513 <!-- The index selection list -->
514 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
515 <span class="textselect">
516 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
517 <xsl:with-param name="default">
518 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
519 </xsl:with-param>
520 <xsl:with-param name="hideSingle">false</xsl:with-param>
521 <xsl:with-param name="quickSearch">true</xsl:with-param>
522 </xsl:apply-templates>
523 </span>
524 </xsl:if>
525 <!-- The partition selection list -->
526 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']/@type = 'enum_single'">
527 <span class="textselect">
528 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']">
529 <xsl:with-param name="default">
530 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']" mode="calculate-default"/>
531 </xsl:with-param>
532 <xsl:with-param name="hideSingle">true</xsl:with-param>
533 <xsl:with-param name="quickSearch">true</xsl:with-param>
534 </xsl:apply-templates>
535 </span>
536 </xsl:if>
537 <!-- The language selection list -->
538 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']/@type = 'enum_single'">
539 <span class="textselect">
540 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']">
541 <xsl:with-param name="default">
542 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']" mode="calculate-default"/>
543 </xsl:with-param>
544 <xsl:with-param name="hideSingle">true</xsl:with-param>
545 <xsl:with-param name="quickSearch">true</xsl:with-param>
546 </xsl:apply-templates>
547 </span>
548 </xsl:if>
549 <!-- The submit button (for TextQuery) -->
550 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
551 <input type="submit" id="quickSearchSubmitButton">
552 <xsl:attribute name="value">
553 <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
554 </xsl:attribute>
555 </input>
556 <br/>
557 </xsl:if>
558 </form>
559 </xsl:when>
560 <xsl:otherwise><br/></xsl:otherwise>
561 </xsl:choose>
562 </xsl:if>
563 <!-- The list of other search types -->
564 <ul>
565 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
566 <li>
567 <xsl:choose>
568 <xsl:when test="@name = /page/pageRequest/paramList/param[@name='s']/@value and not(/page/pageRequest/paramList/param[@name='qs']/@value = 1)">
569 <xsl:attribute name="class">ui-state-default ui-corner-all ui-state-active</xsl:attribute>
570 </xsl:when>
571 <xsl:otherwise>
572 <xsl:attribute name="class">ui-state-default ui-corner-all</xsl:attribute>
573 </xsl:otherwise>
574 </xsl:choose>
575 <a>
576 <xsl:attribute name="href">
577 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="@name"/>
578 </xsl:attribute>
579 <xsl:value-of select="displayItem[@name='name']"/>
580 </a>
581 </li>
582 </xsl:for-each>
583 </ul>
584 </div>
585 </xsl:if>
586 </xsl:template>
587
588 <xsl:template name="map-scripts">
589 <meta content="initial-scale=1.0, user-scalable=no" name="viewport"/>
590 <script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"><xsl:text> </xsl:text></script>
591 <script src="interfaces/{$interface_name}/js/map-scripts.js" type="text/javascript"><xsl:text> </xsl:text></script>
592 <script type="text/javascript">$(window).load(initializeMapScripts);</script>
593 </xsl:template>
594
595 <xsl:template name="openlayers-map-scripts">
596 <script src="interfaces/{interface_name}/js/OpenLayers.js" type="text/javascript"><xsl:text> </xsl:text></script>
597 </xsl:template>
598
599 <xsl:template name="panoramaViewer-scripts">
600 <script src="interfaces/{$interface_name}/js/three45.min.js" type="text/javascript"><xsl:text> </xsl:text></script>
601 <script src="interfaces/{$interface_name}/js/Tween.js" type="text/javascript"><xsl:text> </xsl:text></script>
602 <script src="interfaces/{$interface_name}/js/Detector.js" type="text/javascript"><xsl:text> </xsl:text></script>
603 <script src="interfaces/{$interface_name}/js/RequestAnimationFrame.js" type="text/javascript"><xsl:text> </xsl:text></script>
604 <script src="interfaces/{$interface_name}/js/panoramaMarker.js" type="text/javascript"><xsl:text> </xsl:text></script>
605 <script src="interfaces/{$interface_name}/js/panoramaViewer.js" type="text/javascript"><xsl:text> </xsl:text></script>
606 <script type="text/javascript">$(window).load(initPanoramaViewer);$(window).load(_animate);</script>
607 </xsl:template>
608
609 <xsl:template name="choose-title">
610 <gsf:choose-metadata>
611 <gsf:metadata name="dc.Title"/>
612 <gsf:metadata name="exp.Title"/>
613 <gsf:metadata name="ex.dc.Title"/>
614 <gsf:metadata name="Title"/>
615 <gsf:default>Untitled</gsf:default>
616 </gsf:choose-metadata>
617 </xsl:template>
618</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.