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