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