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