[23989] | 1 | <xsl:stylesheet version="1.0"
|
---|
| 2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 3 | xmlns:java="http://xml.apache.org/xslt/java"
|
---|
| 4 | xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
| 5 | xmlns:gslib="http://www.greenstone.org/skinning"
|
---|
[25001] | 6 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
[23989] | 7 | extension-element-prefixes="java util"
|
---|
[25001] | 8 | exclude-result-prefixes="java util gsf">
|
---|
[23989] | 9 |
|
---|
| 10 | <xsl:include href="../query-common.xsl"/>
|
---|
[24458] | 11 | <xsl:include href="../javascript-global-setup.xsl"/>
|
---|
[23989] | 12 |
|
---|
| 13 | <!-- If the c parameter is empty then use the p.c parameter for the collection name-->
|
---|
| 14 | <xsl:variable name="collNameChecked">
|
---|
| 15 | <xsl:choose>
|
---|
| 16 | <xsl:when test="$collName = '' and /page/pageRequest/paramList/param[@name='p.c']/@value">
|
---|
| 17 | <xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/>
|
---|
| 18 | </xsl:when>
|
---|
| 19 | <xsl:otherwise>
|
---|
| 20 | <xsl:value-of select="$collName"/>
|
---|
| 21 | </xsl:otherwise>
|
---|
| 22 | </xsl:choose>
|
---|
| 23 | </xsl:variable>
|
---|
| 24 |
|
---|
[24149] | 25 | <!-- Creates a header for the html page -->
|
---|
[23989] | 26 | <xsl:template name="create-html-header">
|
---|
[25436] | 27 | <base>
|
---|
| 28 | <xsl:attribute name="href">
|
---|
| 29 | <xsl:choose>
|
---|
| 30 | <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'baseURL']">
|
---|
| 31 | <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'baseURL']"/>
|
---|
| 32 | </xsl:when>
|
---|
| 33 | <xsl:when test="/page/pageRequest/@baseURL">
|
---|
| 34 | <xsl:value-of select="/page/pageRequest/@baseURL"/>
|
---|
| 35 | </xsl:when>
|
---|
| 36 | </xsl:choose>
|
---|
| 37 | </xsl:attribute>
|
---|
| 38 | </base>
|
---|
[25360] | 39 | <xsl:comment>[if lte IE 6]></base><![endif]</xsl:comment>
|
---|
[25278] | 40 |
|
---|
[23989] | 41 | <title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
|
---|
[25123] | 42 |
|
---|
| 43 | <xsl:choose>
|
---|
| 44 | <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value">
|
---|
[25142] | 45 | <!-- Get the theme from the interfaceConfig.xml file -->
|
---|
[25123] | 46 | <link rel="stylesheet" href="{/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value}" type="text/css"/>
|
---|
| 47 | </xsl:when>
|
---|
| 48 | <xsl:otherwise>
|
---|
| 49 | <link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui-1.8.16.custom.css" type="text/css"/>
|
---|
| 50 | </xsl:otherwise>
|
---|
| 51 | </xsl:choose>
|
---|
[23989] | 52 | <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
|
---|
| 53 | <link rel="shortcut icon" href="favicon.ico"/>
|
---|
[24458] | 54 |
|
---|
[25759] | 55 | <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.min.js"><xsl:text> </xsl:text></script>
|
---|
| 56 | <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery-ui.min.js"><xsl:text> </xsl:text></script>
|
---|
[25001] | 57 | <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.themeswitcher.min.js"><xsl:text> </xsl:text></script>
|
---|
| 58 |
|
---|
| 59 | <script type="text/javascript" src="interfaces/{$interface_name}/js/direct-edit.js"><xsl:text> </xsl:text></script>
|
---|
[25177] | 60 | <script type="text/javascript" src="interfaces/{$interface_name}/js/zoomer.js"><xsl:text> </xsl:text></script>
|
---|
[25686] | 61 |
|
---|
[25001] | 62 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
| 63 | <xsl:call-template name="map-scripts"/>
|
---|
| 64 | </xsl:if>
|
---|
[25142] | 65 |
|
---|
[25177] | 66 | <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))">
|
---|
| 67 | <xsl:call-template name="init-direct-edit"/>
|
---|
| 68 | </xsl:if>
|
---|
[24458] | 69 | <xsl:call-template name="setup-gs-variable"/>
|
---|
[24781] | 70 | <xsl:call-template name="additionalHeaderContent"/>
|
---|
[23989] | 71 | </xsl:template>
|
---|
[24781] | 72 |
|
---|
| 73 | <xsl:template name="additionalHeaderContent">
|
---|
| 74 | <!-- This template should be overridden in the collectionConfig.xml file if you want to add extra header content -->
|
---|
| 75 | </xsl:template>
|
---|
[25001] | 76 |
|
---|
[25142] | 77 | <xsl:template name="init-direct-edit">
|
---|
[24653] | 78 | <script type="text/javascript">
|
---|
| 79 | <xsl:text disable-output-escaping="yes">
|
---|
[25142] | 80 | de.onready(function()
|
---|
| 81 | {
|
---|
| 82 | try
|
---|
| 83 | {
|
---|
[24653] | 84 | de.init();
|
---|
| 85 | }
|
---|
[25142] | 86 | catch (err)
|
---|
| 87 | {
|
---|
[25001] | 88 | alert("Seaweed failed to initialise: " + err.message);
|
---|
[24653] | 89 | }
|
---|
| 90 | });
|
---|
| 91 | </xsl:text>
|
---|
| 92 | </script>
|
---|
| 93 | </xsl:template>
|
---|
| 94 |
|
---|
[23989] | 95 | <!-- ***** HEADER LAYOUT TEMPLATE ***** -->
|
---|
[25001] | 96 | <xsl:template name="create-banner">
|
---|
| 97 | <div id="gs_banner" class="ui-widget-header ui-corner-bottom">
|
---|
[26028] | 98 | <div id="titlesearchcontainer">
|
---|
| 99 | <xsl:call-template name="page-title-area"/>
|
---|
| 100 | <xsl:call-template name="quick-search-area"/>
|
---|
| 101 | <div style="clear:both;"><xsl:text> </xsl:text></div>
|
---|
| 102 | </div>
|
---|
[25001] | 103 | <xsl:call-template name="browsing-tabs"/>
|
---|
| 104 | </div>
|
---|
[23989] | 105 | </xsl:template>
|
---|
| 106 |
|
---|
| 107 | <!-- ***** BROWSING TABS ***** -->
|
---|
| 108 | <xsl:template name="browsing-tabs">
|
---|
| 109 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service">
|
---|
[25935] | 110 | <ul id="gs-nav">
|
---|
[23989] | 111 | <!-- If this collection has a ClassifierBrowse service then add a tab for each classifier-->
|
---|
| 112 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='browse' and @name='ClassifierBrowse']">
|
---|
| 113 | <!-- Loop through each classifier -->
|
---|
| 114 | <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
|
---|
[25001] | 115 | <li>
|
---|
| 116 | <xsl:choose>
|
---|
| 117 | <!-- If this tab is selected then colour it differently -->
|
---|
[25686] | 118 | <xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
|
---|
[25001] | 119 | <xsl:attribute name='class'>ui-state-default ui-corner-top ui-tabs-selected ui-state-active</xsl:attribute>
|
---|
| 120 | </xsl:when>
|
---|
| 121 | <xsl:otherwise>
|
---|
| 122 | <xsl:attribute name='class'>ui-state-default ui-corner-top</xsl:attribute>
|
---|
| 123 | </xsl:otherwise>
|
---|
| 124 | </xsl:choose>
|
---|
[23989] | 125 |
|
---|
[25001] | 126 | <a>
|
---|
[23989] | 127 | <!-- Add a title element to the <a> tag if a description exists for this classifier -->
|
---|
| 128 | <xsl:if test="displayItem[@name='description']">
|
---|
| 129 | <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
|
---|
| 130 | </xsl:if>
|
---|
| 131 |
|
---|
| 132 | <!-- Add the href element to the <a> tag -->
|
---|
| 133 | <xsl:choose>
|
---|
| 134 | <xsl:when test="@name">
|
---|
[25436] | 135 | <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] | 136 | </xsl:when>
|
---|
| 137 | <xsl:otherwise>
|
---|
[25436] | 138 | <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] | 139 | </xsl:otherwise>
|
---|
| 140 | </xsl:choose>
|
---|
| 141 |
|
---|
| 142 | <!-- Add the actual text of the <a> tag -->
|
---|
| 143 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
[25001] | 144 | </a>
|
---|
| 145 | </li>
|
---|
[23989] | 146 | </xsl:for-each>
|
---|
| 147 | </xsl:if>
|
---|
| 148 |
|
---|
| 149 | <!-- all other services -->
|
---|
| 150 | <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[not(@type='query') and not(@type='browse')]">
|
---|
| 151 | <xsl:call-template name="navigationTab"/>
|
---|
| 152 | </xsl:for-each>
|
---|
| 153 | </ul>
|
---|
| 154 | </xsl:if>
|
---|
| 155 | </xsl:template>
|
---|
| 156 |
|
---|
[25001] | 157 | <!-- ***** HOME HELP PREFERENCES LOGIN ***** -->
|
---|
[23989] | 158 | <xsl:template name="home-help-preferences">
|
---|
[25278] | 159 | <ul id="bannerLinks">
|
---|
| 160 | <!-- preferences -->
|
---|
| 161 | <li class="ui-state-default ui-corner-all">
|
---|
[25436] | 162 | <a href="{$library_name}/collection/{$collNameChecked}/page/pref">
|
---|
[25278] | 163 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
|
---|
| 164 | <ul>
|
---|
| 165 | <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></span></li>
|
---|
| 166 | <li><span class="ui-icon ui-icon-wrench"><xsl:text> </xsl:text></span></li>
|
---|
| 167 | </ul>
|
---|
| 168 | </a>
|
---|
| 169 | </li>
|
---|
[23989] | 170 |
|
---|
[25278] | 171 | <!-- help -->
|
---|
| 172 | <li class="ui-state-default ui-corner-all">
|
---|
[25436] | 173 | <a href="{$library_name}/collection/{$collNameChecked}/page/help">
|
---|
[25278] | 174 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
|
---|
| 175 | <ul>
|
---|
| 176 | <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></span></li>
|
---|
| 177 | <li><span class="ui-icon ui-icon-help"><xsl:text> </xsl:text></span></li>
|
---|
| 178 | </ul>
|
---|
| 179 | </a>
|
---|
| 180 | </li>
|
---|
| 181 |
|
---|
| 182 | <!-- login/logout -->
|
---|
| 183 | <li class="ui-state-default ui-corner-all" id="userMenuButton">
|
---|
| 184 | <xsl:choose>
|
---|
| 185 | <xsl:when test="/page/pageRequest/userInformation/@username">
|
---|
| 186 | <a>
|
---|
| 187 | <xsl:attribute name="href">javascript:toggleUserMenu();</xsl:attribute>
|
---|
| 188 | <script type="text/javascript">
|
---|
| 189 | <xsl:text disable-output-escaping="yes">
|
---|
| 190 | function toggleUserMenu()
|
---|
| 191 | {
|
---|
| 192 | var button = $("#userMenuButton");
|
---|
| 193 | var menu;
|
---|
[23989] | 194 |
|
---|
[25278] | 195 | if(button.data("userMenu"))
|
---|
| 196 | {
|
---|
| 197 | menu = button.data("userMenu");
|
---|
| 198 | if(menu.css("display") == "block")
|
---|
| 199 | {
|
---|
| 200 | menu.hide();
|
---|
| 201 | }
|
---|
| 202 | else
|
---|
| 203 | {
|
---|
| 204 | menu.show();
|
---|
| 205 | }
|
---|
| 206 | }
|
---|
| 207 | else
|
---|
| 208 | {
|
---|
| 209 | menu = $("<UL>")
|
---|
| 210 | .css("position", "absolute")
|
---|
| 211 | .css("display", "block")
|
---|
| 212 | .css("z-index", "100")
|
---|
| 213 | .css("list-style", "none outside none")
|
---|
| 214 | .css("margin-left", "0px")
|
---|
| 215 | .css("padding", "0px")
|
---|
| 216 | .css("font-size", "90%");
|
---|
| 217 |
|
---|
| 218 | button.data("userMenu", menu);
|
---|
| 219 |
|
---|
| 220 | var settingsLink = $("<a>")
|
---|
| 221 | .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">");
|
---|
| 222 | var settingsButton = $("<LI>")
|
---|
| 223 | .css("padding", "3px")
|
---|
| 224 | .html("Account settings")
|
---|
| 225 | .addClass("ui-state-default");
|
---|
| 226 | settingsLink.append(settingsButton);
|
---|
| 227 |
|
---|
| 228 | var url = document.URL;
|
---|
| 229 | var hasQueryString = (url.indexOf("?") != -1);
|
---|
| 230 | var hashIndex = url.indexOf("#");
|
---|
| 231 |
|
---|
| 232 | var hashPart;
|
---|
| 233 | if(hashIndex != -1)
|
---|
| 234 | {
|
---|
| 235 | hashPart = url.substring(hashIndex);
|
---|
| 236 | url = url.substring(0, hashIndex);
|
---|
| 237 | }
|
---|
| 238 |
|
---|
| 239 | var logoutLink = $("<a>")
|
---|
| 240 | .attr("href", url + (hasQueryString ? "&" : "?") + "logout=" + (hashPart ? hashPart : ""));
|
---|
| 241 | var logoutButton = $("<LI>")
|
---|
| 242 | .css("padding", "3px")
|
---|
| 243 | .html("Logout")
|
---|
| 244 | .addClass("ui-state-default");
|
---|
| 245 | logoutLink.append(logoutButton);
|
---|
| 246 |
|
---|
| 247 | menu.append(settingsLink);
|
---|
| 248 | menu.append(logoutLink);
|
---|
| 249 |
|
---|
| 250 | var buttonLeft = button.offset().left;
|
---|
| 251 | var buttonTop = button.offset().top;
|
---|
| 252 | var buttonHeight = button.height();
|
---|
| 253 |
|
---|
| 254 | menu.offset({top: buttonTop + buttonHeight + 4, left: buttonLeft});
|
---|
| 255 | $("#topArea").append(menu);
|
---|
| 256 | }
|
---|
| 257 | }
|
---|
| 258 | </xsl:text>
|
---|
| 259 | </script>
|
---|
| 260 | <ul>
|
---|
| 261 | <li><span><xsl:value-of select="/page/pageRequest/userInformation/@username"/></span></li>
|
---|
| 262 | <li><span class="ui-icon ui-icon-unlocked"><xsl:text> </xsl:text></span></li>
|
---|
| 263 | </ul>
|
---|
| 264 | </a>
|
---|
| 265 | </xsl:when>
|
---|
| 266 | <xsl:otherwise>
|
---|
| 267 | <a>
|
---|
| 268 | <xsl:attribute name="href">
|
---|
| 269 | <xsl:value-of select="$library_name"/>
|
---|
| 270 | <xsl:text>?a=p&sa=login&redirectURL=</xsl:text>
|
---|
| 271 | <xsl:value-of select="$library_name"/>
|
---|
| 272 | <xsl:text>%3F</xsl:text>
|
---|
| 273 | <xsl:if test="/page/pageRequest/@action">
|
---|
| 274 | <xsl:text>a=</xsl:text>
|
---|
| 275 | <xsl:value-of select="/page/pageRequest/@action"/>
|
---|
| 276 | </xsl:if>
|
---|
| 277 | <xsl:if test="/page/pageRequest/@subaction">
|
---|
| 278 | <xsl:text>%26sa=</xsl:text>
|
---|
| 279 | <xsl:value-of select="/page/pageRequest/@subaction"/>
|
---|
| 280 | </xsl:if>
|
---|
| 281 | <xsl:for-each select="/page/pageRequest/paramList/param">
|
---|
| 282 | <xsl:if test="@name != 'password' and @name != 's1.password' and @name != 's1.newPassword' and @name != 's1.oldPassword'">
|
---|
[25123] | 283 | <xsl:text>%26</xsl:text>
|
---|
| 284 | <xsl:value-of select="@name"/>
|
---|
| 285 | <xsl:text>=</xsl:text>
|
---|
| 286 | <xsl:value-of select="@value"/>
|
---|
[25278] | 287 | </xsl:if>
|
---|
| 288 | </xsl:for-each>
|
---|
| 289 | </xsl:attribute>
|
---|
| 290 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/></xsl:attribute>
|
---|
| 291 | <ul>
|
---|
| 292 | <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_b')"/></span></li>
|
---|
| 293 | <li><span class="ui-icon ui-icon-locked"><xsl:text> </xsl:text></span></li>
|
---|
| 294 | </ul>
|
---|
| 295 | </a>
|
---|
| 296 | </xsl:otherwise>
|
---|
| 297 | </xsl:choose>
|
---|
| 298 | </li>
|
---|
[25469] | 299 | <!-- debuginfo (doesn't use class="ui-state-error" since the text is not legible due to inherited text-colour) -->
|
---|
| 300 | <xsl:if test="/page/pageRequest/paramList/param[(@name='debug') and (@value='on' or @value='true' or @value='1')]">
|
---|
[25457] | 301 | <li class="ui-state-default ui-corner-all">
|
---|
[25950] | 302 | <a href="{$library_name}/collection/{$collNameChecked}/page/debug">
|
---|
[25457] | 303 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'debuginfo_tip')"/></xsl:attribute>
|
---|
| 304 | <ul>
|
---|
| 305 | <li><span><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'debuginfo_b')"/></span></li>
|
---|
| 306 | <li><span class="ui-icon ui-icon-info"><xsl:text> </xsl:text></span></li>
|
---|
| 307 | </ul>
|
---|
| 308 | </a>
|
---|
| 309 | </li>
|
---|
| 310 | </xsl:if>
|
---|
[25278] | 311 | </ul>
|
---|
[23989] | 312 | </xsl:template>
|
---|
| 313 |
|
---|
| 314 | <!-- ***** PAGE TITLE ***** -->
|
---|
| 315 | <xsl:template name="page-title-area">
|
---|
| 316 | <xsl:variable name="pageTitleVar"><xsl:call-template name="pageTitle"/></xsl:variable>
|
---|
[26028] | 317 | <div id="titlearea">
|
---|
[23989] | 318 | <h2>
|
---|
[24420] | 319 | <!-- Resize the title based on how long it is (There's probably a better way to do this) -->
|
---|
[23989] | 320 | <xsl:attribute name="style">
|
---|
| 321 | <xsl:choose>
|
---|
| 322 | <xsl:when test="string-length($pageTitleVar) < 20">
|
---|
[25001] | 323 | <xsl:text>font-size: 1.5em;</xsl:text>
|
---|
[23989] | 324 | </xsl:when>
|
---|
| 325 | <xsl:when test="string-length($pageTitleVar) < 30">
|
---|
[25001] | 326 | <xsl:text>font-size: 1.4em;</xsl:text>
|
---|
[23989] | 327 | </xsl:when>
|
---|
| 328 | <xsl:when test="string-length($pageTitleVar) < 40">
|
---|
[25001] | 329 | <xsl:text>font-size: 1.3em;</xsl:text>
|
---|
[23989] | 330 | </xsl:when>
|
---|
| 331 | <xsl:when test="string-length($pageTitleVar) < 50">
|
---|
[25001] | 332 | <xsl:text>font-size: 1.2em;</xsl:text>
|
---|
[23989] | 333 | </xsl:when>
|
---|
| 334 | <xsl:when test="string-length($pageTitleVar) < 60">
|
---|
[25001] | 335 | <xsl:text>font-size: 1.1em;</xsl:text>
|
---|
[23989] | 336 | </xsl:when>
|
---|
| 337 | <xsl:when test="string-length($pageTitleVar) < 70">
|
---|
[25001] | 338 | <xsl:text>font-size: 1em;</xsl:text>
|
---|
[23989] | 339 | </xsl:when>
|
---|
| 340 | <xsl:when test="string-length($pageTitleVar) < 80">
|
---|
[25001] | 341 | <xsl:text>font-size: 0.9em;</xsl:text>
|
---|
[23989] | 342 | </xsl:when>
|
---|
| 343 | <xsl:when test="string-length($pageTitleVar) < 90">
|
---|
[25001] | 344 | <xsl:text>font-size: 0.8em;</xsl:text>
|
---|
[23989] | 345 | </xsl:when>
|
---|
| 346 | <xsl:otherwise>
|
---|
[25001] | 347 | <xsl:text>font-size: 0.7em;</xsl:text>
|
---|
[23989] | 348 | </xsl:otherwise>
|
---|
| 349 | </xsl:choose>
|
---|
| 350 | </xsl:attribute>
|
---|
| 351 | <!--<xsl:value-of select="string-length($pageTitleVar)" />-->
|
---|
| 352 | <xsl:value-of select="$pageTitleVar" />
|
---|
[26028] | 353 | </h2><xsl:text> </xsl:text>
|
---|
| 354 | </div>
|
---|
[23989] | 355 | </xsl:template>
|
---|
| 356 |
|
---|
| 357 | <!-- ***** QUICK SEARCH AREA ***** -->
|
---|
[25774] | 358 | <!-- Search form should only appear if there's a search (query) service AND it has an index.
|
---|
| 359 | By default, all collections end up with some query service (default is MGPP) even when they have
|
---|
[26057] | 360 | no search indexes, which is why the extra test for the presence of an index/fq-something is necessary. -->
|
---|
[23989] | 361 | <xsl:template name="quick-search-area">
|
---|
[26057] | 362 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']/paramList/param[@name='index' or fn:starts-with('fq')]">
|
---|
[23989] | 363 | <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
|
---|
[26028] | 364 | <div id="quicksearcharea">
|
---|
[25436] | 365 | <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
|
---|
[25884] | 366 | <input type="hidden" name="rt" value="r"/>
|
---|
[25436] | 367 | <input type="hidden" name="s1.level">
|
---|
| 368 | <xsl:attribute name="value">
|
---|
| 369 | <xsl:choose>
|
---|
| 370 | <xsl:when test="/page/pageRequest/paramList/param[@name = 's1.level']">
|
---|
| 371 | <xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.level']/@value"/>
|
---|
| 372 | </xsl:when>
|
---|
| 373 | <xsl:otherwise>
|
---|
| 374 | <xsl:text>Sec</xsl:text>
|
---|
| 375 | </xsl:otherwise>
|
---|
| 376 | </xsl:choose>
|
---|
| 377 | </xsl:attribute>
|
---|
| 378 | </input>
|
---|
[25485] | 379 | <xsl:choose>
|
---|
| 380 | <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
|
---|
| 381 | <input type="hidden" name="s1.startPage" value="1"/>
|
---|
| 382 | </xsl:when>
|
---|
| 383 | <xsl:otherwise>
|
---|
| 384 | <input type="hidden" name="startPage" value="1"/>
|
---|
| 385 | </xsl:otherwise>
|
---|
| 386 | </xsl:choose>
|
---|
| 387 | <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.hitsPerPage'])">
|
---|
| 388 | <input type="hidden" name="s1.hitsPerPage" value="20"/>
|
---|
| 389 | </xsl:if>
|
---|
| 390 | <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.maxDocs'])">
|
---|
| 391 | <input type="hidden" name="s1.maxDocs" value="100"/>
|
---|
| 392 | </xsl:if>
|
---|
[23989] | 393 | <!-- The query text box -->
|
---|
| 394 | <span class="querybox">
|
---|
| 395 | <xsl:variable name="qs">
|
---|
| 396 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
|
---|
| 397 | </xsl:variable>
|
---|
| 398 | <nobr>
|
---|
| 399 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
|
---|
| 400 | <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs)"/>
|
---|
| 401 | </xsl:apply-templates>
|
---|
| 402 | </nobr>
|
---|
| 403 | </span>
|
---|
| 404 | <!-- The index selection list -->
|
---|
| 405 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
|
---|
| 406 | <span class="textselect">
|
---|
| 407 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
|
---|
| 408 | <xsl:with-param name="default">
|
---|
| 409 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
|
---|
| 410 | </xsl:with-param>
|
---|
| 411 | </xsl:apply-templates>
|
---|
| 412 | </span>
|
---|
| 413 | </xsl:if>
|
---|
[26057] | 414 | <!-- The submit button (for TextQuery) -->
|
---|
| 415 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
|
---|
[25001] | 416 | <input type="submit" id="quickSearchSubmitButton">
|
---|
[23989] | 417 | <xsl:attribute name="value">
|
---|
| 418 | <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
|
---|
| 419 | </xsl:attribute>
|
---|
| 420 | </input>
|
---|
| 421 | <br/>
|
---|
[26057] | 422 | </xsl:if>
|
---|
[23989] | 423 | <!-- The list of other search types -->
|
---|
[25001] | 424 | <ul>
|
---|
| 425 | <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
|
---|
| 426 | <li class="ui-state-default ui-corner-all">
|
---|
| 427 | <a>
|
---|
| 428 | <xsl:attribute name="href">
|
---|
[25436] | 429 | <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="@name"/>
|
---|
[25001] | 430 | </xsl:attribute>
|
---|
| 431 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
| 432 | </a>
|
---|
| 433 | </li>
|
---|
| 434 | </xsl:for-each>
|
---|
| 435 | </ul>
|
---|
[23989] | 436 | </form>
|
---|
[26028] | 437 | </div>
|
---|
[23989] | 438 | </xsl:if>
|
---|
| 439 | </xsl:template>
|
---|
[25294] | 440 |
|
---|
[25001] | 441 | <xsl:template name="map-scripts">
|
---|
| 442 | <meta content="initial-scale=1.0, user-scalable=no" name="viewport"/>
|
---|
| 443 | <script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"><xsl:text> </xsl:text></script>
|
---|
[25024] | 444 | <script src="interfaces/{$interface_name}/js/map-scripts.js" type="text/javascript"><xsl:text> </xsl:text></script>
|
---|
[25001] | 445 | <script type="text/javascript">$(window).load(initializeMapScripts);</script>
|
---|
| 446 | </xsl:template>
|
---|
[24137] | 447 | </xsl:stylesheet>
|
---|