source: main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl@ 29314

Last change on this file since 29314 was 29314, checked in by ak19, 6 years ago

Re-instating Jenny's change to display the index being searched within a search form (quick search) if there is but a single index. For a single index, the index field had been hidden recently. But this not only conflicts with the Simple-Image tutorial, it also does not provide feedback to users on what the default search index is.

  • Property svn:executable set to *
File size: 29.7 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')]">
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 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.hitsPerPage'])">
502 <input type="hidden" name="s1.hitsPerPage" value="20"/>
503 </xsl:if>
504 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.maxDocs'])">
505 <input type="hidden" name="s1.maxDocs" value="100"/>
506 </xsl:if>
507 <!-- The query text box -->
508 <span class="querybox">
509 <xsl:variable name="qs">
510 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
511 </xsl:variable>
512 <nobr>
513 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
514 <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
515 </xsl:apply-templates>
516 </nobr>
517 </span>
518 <!-- The index selection list -->
519 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
520 <span class="textselect">
521 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
522 <xsl:with-param name="default">
523 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
524 </xsl:with-param>
525 <xsl:with-param name="hideSingle">false</xsl:with-param>
526 <xsl:with-param name="quickSearch">true</xsl:with-param>
527 </xsl:apply-templates>
528 </span>
529 </xsl:if>
530 <!-- The partition selection list -->
531 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']/@type = 'enum_single'">
532 <span class="textselect">
533 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']">
534 <xsl:with-param name="default">
535 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']" mode="calculate-default"/>
536 </xsl:with-param>
537 <xsl:with-param name="hideSingle">true</xsl:with-param>
538 <xsl:with-param name="quickSearch">true</xsl:with-param>
539 </xsl:apply-templates>
540 </span>
541 </xsl:if>
542 <!-- The language selection list -->
543 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']/@type = 'enum_single'">
544 <span class="textselect">
545 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']">
546 <xsl:with-param name="default">
547 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']" mode="calculate-default"/>
548 </xsl:with-param>
549 <xsl:with-param name="hideSingle">true</xsl:with-param>
550 <xsl:with-param name="quickSearch">true</xsl:with-param>
551 </xsl:apply-templates>
552 </span>
553 </xsl:if>
554 <!-- The submit button (for TextQuery) -->
555 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
556 <input type="submit" id="quickSearchSubmitButton">
557 <xsl:attribute name="value">
558 <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
559 </xsl:attribute>
560 </input>
561 <br/>
562 </xsl:if>
563 </form>
564 </xsl:when>
565 <xsl:otherwise><br/></xsl:otherwise>
566 </xsl:choose>
567 </xsl:if>
568 <!-- The list of other search types -->
569 <ul>
570 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
571 <li>
572 <xsl:choose>
573 <xsl:when test="@name = /page/pageRequest/paramList/param[@name='s']/@value and not(/page/pageRequest/paramList/param[@name='qs']/@value = 1)">
574 <xsl:attribute name="class">ui-state-default ui-corner-all ui-state-active</xsl:attribute>
575 </xsl:when>
576 <xsl:otherwise>
577 <xsl:attribute name="class">ui-state-default ui-corner-all</xsl:attribute>
578 </xsl:otherwise>
579 </xsl:choose>
580 <a>
581 <xsl:attribute name="href">
582 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="@name"/>
583 </xsl:attribute>
584 <xsl:value-of select="displayItem[@name='name']"/>
585 </a>
586 </li>
587 </xsl:for-each>
588 </ul>
589 </div>
590 </xsl:if>
591 </xsl:template>
592
593 <xsl:template name="map-scripts">
594 <meta content="initial-scale=1.0, user-scalable=no" name="viewport"/>
595 <script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"><xsl:text> </xsl:text></script>
596 <script src="interfaces/{$interface_name}/js/map-scripts.js" type="text/javascript"><xsl:text> </xsl:text></script>
597 <script type="text/javascript">$(window).load(initializeMapScripts);</script>
598 </xsl:template>
599
600 <xsl:template name="openlayers-map-scripts">
601 <script src="interfaces/{interface_name}/js/OpenLayers.js" type="text/javascript"><xsl:text> </xsl:text></script>
602 </xsl:template>
603
604 <xsl:template name="panoramaViewer-scripts">
605 <script src="interfaces/{$interface_name}/js/three45.min.js" type="text/javascript"><xsl:text> </xsl:text></script>
606 <script src="interfaces/{$interface_name}/js/Tween.js" type="text/javascript"><xsl:text> </xsl:text></script>
607 <script src="interfaces/{$interface_name}/js/Detector.js" type="text/javascript"><xsl:text> </xsl:text></script>
608 <script src="interfaces/{$interface_name}/js/RequestAnimationFrame.js" type="text/javascript"><xsl:text> </xsl:text></script>
609 <script src="interfaces/{$interface_name}/js/panoramaMarker.js" type="text/javascript"><xsl:text> </xsl:text></script>
610 <script src="interfaces/{$interface_name}/js/panoramaViewer.js" type="text/javascript"><xsl:text> </xsl:text></script>
611 <script type="text/javascript">$(window).load(initPanoramaViewer);$(window).load(_animate);</script>
612 </xsl:template>
613
614 <xsl:template name="choose-title">
615 <gsf:choose-metadata>
616 <gsf:metadata name="dc.Title"/>
617 <gsf:metadata name="exp.Title"/>
618 <gsf:metadata name="ex.dc.Title"/>
619 <gsf:metadata name="Title"/>
620 <gsf:default>Untitled</gsf:default>
621 </gsf:choose-metadata>
622 </xsl:template>
623</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.