[18482] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
| 2 | <xsl:stylesheet version="1.0"
|
---|
[19895] | 3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 4 | xmlns:gslib="http://www.greenstone.org/XSL/Library"
|
---|
[20160] | 5 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
[24007] | 6 | exclude-result-prefixes="gslib gsf">
|
---|
[19895] | 7 |
|
---|
| 8 | <!-- some global parameters - these are set by whoever is invoking the transformation -->
|
---|
[18482] | 9 | <xsl:param name="interface_name"/>
|
---|
| 10 | <xsl:param name="library_name"/>
|
---|
[22569] | 11 |
|
---|
[24007] | 12 | <!-- Get rid of XSLT parameters from view -->
|
---|
| 13 | <xsl:template match="xsltparams/param">
|
---|
| 14 | <xsl:text></xsl:text>
|
---|
| 15 | </xsl:template>
|
---|
| 16 |
|
---|
[19895] | 17 | <!-- every pages ................................................. -->
|
---|
[18482] | 18 |
|
---|
[19895] | 19 | <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable>
|
---|
| 20 | <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
|
---|
[18482] | 21 |
|
---|
| 22 |
|
---|
[19895] | 23 | <xsl:template name="textDirectionAttribute">
|
---|
| 24 | <xsl:attribute name="dir">
|
---|
[18482] | 25 | <xsl:choose>
|
---|
[19895] | 26 | <xsl:when test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:when>
|
---|
| 27 | <xsl:otherwise>ltr</xsl:otherwise>
|
---|
| 28 | </xsl:choose>
|
---|
| 29 | </xsl:attribute>
|
---|
| 30 | </xsl:template>
|
---|
| 31 |
|
---|
| 32 |
|
---|
| 33 | <xsl:template name="defaultDividerBar">
|
---|
| 34 | <xsl:param name='text'/>
|
---|
| 35 | <xsl:choose>
|
---|
[18482] | 36 | <xsl:when test="$text">
|
---|
[19895] | 37 | <div class="divbar"><xsl:value-of select="$text"/></div>
|
---|
[18482] | 38 | </xsl:when>
|
---|
| 39 | <xsl:otherwise>
|
---|
[19895] | 40 | <div class="divbar"><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></div>
|
---|
[18482] | 41 | </xsl:otherwise>
|
---|
| 42 | </xsl:choose>
|
---|
[19895] | 43 | </xsl:template>
|
---|
[18482] | 44 |
|
---|
| 45 |
|
---|
[19895] | 46 | <xsl:template match="error">
|
---|
[18482] | 47 | Error: <xsl:value-of select="."/>
|
---|
[19895] | 48 | </xsl:template>
|
---|
[18482] | 49 |
|
---|
| 50 |
|
---|
[19895] | 51 | <xsl:template name="displayErrorsIfAny">
|
---|
| 52 | <xsl:if test="descendant::error">
|
---|
[18482] | 53 | <script language="Javascript">
|
---|
| 54 | <xsl:text disable-output-escaping="yes">
|
---|
| 55 | function removeAllChildren(node) {
|
---|
[19895] | 56 | while (node.hasChildNodes()) {
|
---|
| 57 | node.removeChild(node.firstChild);
|
---|
[18482] | 58 | }
|
---|
[19895] | 59 | }
|
---|
[18482] | 60 |
|
---|
| 61 | function toggleHideError(obj) {
|
---|
[19895] | 62 | if (obj.style.display == "none") {
|
---|
| 63 | obj.style.display = "";
|
---|
| 64 | hide_link = document.getElementById("hide");
|
---|
| 65 | removeAllChildren(hide_link);
|
---|
[24007] | 66 | var theText = getText('hide_error', null);
|
---|
| 67 | var hide_text = document.createTextNode(theText);
|
---|
| 68 | hide_link.appendChild(hide_text));
|
---|
[19895] | 69 | } else {
|
---|
| 70 | obj.style.display = "none";
|
---|
| 71 | hide_link = document.getElementById("hide");
|
---|
| 72 | removeAllChildren(hide_link);
|
---|
[24007] | 73 | var theText = getText('show_error', null);
|
---|
| 74 | var show_text = document.createTextNode(theText);
|
---|
| 75 | hide_link.appendChild(show_text);
|
---|
[19895] | 76 | }
|
---|
[18482] | 77 | }
|
---|
| 78 | </xsl:text>
|
---|
| 79 | </script>
|
---|
[24007] | 80 | <p align='right'><a id="hide" href="javascript:toggleHideError(error);"></a></p>
|
---|
[18482] | 81 | <div id="error" style="display: none;">
|
---|
| 82 | <xsl:apply-templates select="descendant::error"/>
|
---|
| 83 | </div>
|
---|
| 84 | </xsl:if>
|
---|
[19895] | 85 | </xsl:template>
|
---|
[18482] | 86 |
|
---|
| 87 |
|
---|
[19895] | 88 | <xsl:template name="noTextBar">
|
---|
| 89 | <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
|
---|
[18482] | 90 | </xsl:template>
|
---|
| 91 |
|
---|
| 92 |
|
---|
[19895] | 93 | <xsl:template name="poweredByGS3TextBar">
|
---|
[24007] | 94 | <span class="getTextFor gs3power">&nbsp;</span>
|
---|
[19895] | 95 | </xsl:template>
|
---|
| 96 |
|
---|
| 97 |
|
---|
| 98 | <!-- site home ...................................................... -->
|
---|
[18482] | 99 |
|
---|
[19895] | 100 | <xsl:template name="siteHomePageTitle">
|
---|
| 101 | <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
|
---|
[24007] | 102 | <span class="getTextFor gsdl">&nbsp;</span><xsl:text> </xsl:text>
|
---|
[19895] | 103 | </xsl:template>
|
---|
[18482] | 104 |
|
---|
| 105 |
|
---|
[19895] | 106 | <xsl:template name="selectACollectionTextBar">
|
---|
[24007] | 107 | <span class="getTextFor home.select_a_collection">&nbsp;</span>
|
---|
[18482] | 108 | </xsl:template>
|
---|
| 109 |
|
---|
| 110 |
|
---|
[19902] | 111 | <xsl:template name="crossCollectionQuickSearchForm">
|
---|
| 112 | <xsl:apply-templates select="serviceList/service[@name='TextQuery']" mode="quicksearch"/>
|
---|
[19895] | 113 | </xsl:template>
|
---|
| 114 |
|
---|
[19896] | 115 | <xsl:template match="service[@name='TextQuery']" mode="quicksearch">
|
---|
[19895] | 116 | <form name="QuickSearch" method="get" action="{$library_name}">
|
---|
| 117 | <input type="hidden" name="a" value="q"/>
|
---|
| 118 | <input type="hidden" name="rt" value="rd"/>
|
---|
| 119 | <input type="hidden" name="s" value="{@name}"/>
|
---|
| 120 | <input type="hidden" name="s1.collection" value="all"/>
|
---|
| 121 | <input type="text" name="s1.query" size="20"/>
|
---|
[24007] | 122 | <input type="submit" class="getTextFor null this.value.home.quick_search" />
|
---|
[19895] | 123 | </form>
|
---|
[18482] | 124 | </xsl:template>
|
---|
| 125 |
|
---|
| 126 |
|
---|
[19895] | 127 | <xsl:template name="collectionLinkWithImage">
|
---|
| 128 | <xsl:choose>
|
---|
| 129 | <xsl:when test="displayItem[@name='icon']">
|
---|
| 130 | <a href="{$library_name}?a=p&sa=about&c={@name}">
|
---|
| 131 | <img>
|
---|
| 132 | <xsl:attribute name="src">
|
---|
| 133 | <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>
|
---|
| 134 | </xsl:attribute>
|
---|
| 135 | <xsl:attribute name="alt">
|
---|
| 136 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
| 137 | </xsl:attribute>
|
---|
| 138 | </img>
|
---|
| 139 | </a>
|
---|
| 140 | </xsl:when>
|
---|
| 141 | <xsl:otherwise>
|
---|
| 142 | <a class="noimage" href="{$library_name}?a=p&sa=about&c={@name}">
|
---|
| 143 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
| 144 | </a>
|
---|
| 145 | </xsl:otherwise>
|
---|
| 146 | </xsl:choose>
|
---|
| 147 | </xsl:template>
|
---|
[18482] | 148 |
|
---|
| 149 |
|
---|
[19895] | 150 | <xsl:template name="serviceClusterList">
|
---|
| 151 | <xsl:apply-templates select="serviceClusterList"/>
|
---|
| 152 | </xsl:template>
|
---|
| 153 |
|
---|
| 154 | <xsl:template match="serviceClusterList">
|
---|
| 155 | <xsl:for-each select="serviceCluster">
|
---|
| 156 | <a href="{$library_name}?a=p&sa=about&c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
|
---|
| 157 | </xsl:for-each>
|
---|
| 158 | </xsl:template>
|
---|
[18482] | 159 |
|
---|
[19895] | 160 |
|
---|
| 161 | <xsl:template name="serviceLink">
|
---|
| 162 | <a href="{$library_name}?a=q&rt=d&s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/>
|
---|
| 163 | </xsl:template>
|
---|
[18482] | 164 |
|
---|
[19895] | 165 |
|
---|
| 166 | <xsl:template name="authenticationLink">
|
---|
[20291] | 167 | <a href="{$library_name}?a=g&rt=r&sa=authen&s={@name}&s1.aup=Login&s1.un=&s1.asn="><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/>
|
---|
[18482] | 168 | </xsl:template>
|
---|
| 169 |
|
---|
| 170 |
|
---|
[19895] | 171 | <xsl:template name="libraryInterfaceLink">
|
---|
[24007] | 172 | <li><a href="{$library_name}?a=p&sa=gli4gs3"><span class="getTextFor home.librarian_interface">&nbsp;</span></a></li>
|
---|
[18482] | 173 | </xsl:template>
|
---|
| 174 |
|
---|
[19895] | 175 | <!-- about page - collection home ......................... -->
|
---|
| 176 | <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
|
---|
| 177 | <xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
|
---|
| 178 | <xsl:param name="pageType"/>
|
---|
| 179 | <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
|
---|
| 180 | <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
|
---|
[18482] | 181 |
|
---|
[19895] | 182 | <xsl:template name="aboutCollectionPageTitle">
|
---|
| 183 | <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
|
---|
| 184 | <xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/><xsl:text> </xsl:text>
|
---|
| 185 | </xsl:template>
|
---|
[18482] | 186 |
|
---|
[19895] | 187 |
|
---|
| 188 | <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
|
---|
| 189 | <a href="{$library_name}?a=p&sa=about&c={$collName}">
|
---|
| 190 | <xsl:choose>
|
---|
| 191 | <xsl:when test="$this-element/displayItem[@name='icon']">
|
---|
[24007] | 192 | <img border="0" class="getTextFor null this.title.aboutpage">
|
---|
[19895] | 193 | <xsl:attribute name="src">
|
---|
| 194 | <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
|
---|
| 195 | </xsl:attribute>
|
---|
| 196 | <xsl:attribute name="alt">
|
---|
[18595] | 197 | <xsl:value-of select="$this-element/displayItem[@name='name']"/>
|
---|
[19895] | 198 | </xsl:attribute>
|
---|
| 199 | </img>
|
---|
| 200 | </xsl:when>
|
---|
| 201 | <xsl:otherwise>
|
---|
| 202 | <xsl:value-of select="$this-element/displayItem[@name='name']"/>
|
---|
| 203 | </xsl:otherwise>
|
---|
| 204 | </xsl:choose>
|
---|
| 205 | </a>
|
---|
| 206 | </xsl:template>
|
---|
[18482] | 207 |
|
---|
[18595] | 208 |
|
---|
[19895] | 209 | <xsl:template name="homeButtonTop">
|
---|
[24007] | 210 | <a href="{$library_name}?a=p&sa=home" class="getTextFor home_b this.title.home_tip">&nbsp;</a>
|
---|
[19895] | 211 | </xsl:template>
|
---|
[18595] | 212 |
|
---|
| 213 |
|
---|
[19895] | 214 | <xsl:template name="helpButtonTop">
|
---|
[18595] | 215 | <xsl:choose>
|
---|
| 216 | <xsl:when test="$pageType='help'">
|
---|
[24007] | 217 | <li><a class="getTextFor help_b"></a></li>
|
---|
[18595] | 218 | </xsl:when>
|
---|
| 219 | <xsl:otherwise>
|
---|
[24007] | 220 | <li><a href="{$library_name}?a=p&sa=help&c={$collName}" class="getTextFor help_b this.title.help_tip">&nbsp;</a></li>
|
---|
[18595] | 221 | </xsl:otherwise>
|
---|
| 222 | </xsl:choose>
|
---|
[19895] | 223 | </xsl:template>
|
---|
[18595] | 224 |
|
---|
| 225 |
|
---|
[19895] | 226 | <xsl:template name="preferencesButtonTop">
|
---|
[18595] | 227 | <xsl:choose>
|
---|
| 228 | <xsl:when test="$pageType='pref'">
|
---|
[24007] | 229 | <li><a class="getTextFor pref_b">&nbsp;</a></li>
|
---|
[18595] | 230 | </xsl:when>
|
---|
| 231 | <xsl:otherwise>
|
---|
[24007] | 232 | <li><a href="{$library_name}?a=p&sa=pref&c={$collName}" class="getTextFor pref_b this.title.pref_tip">&nbsp;</a></li>
|
---|
[18595] | 233 | </xsl:otherwise>
|
---|
| 234 | </xsl:choose>
|
---|
[19895] | 235 | </xsl:template>
|
---|
[18595] | 236 |
|
---|
[19895] | 237 | <xsl:template name="servicesNavigationBar">
|
---|
| 238 | <xsl:for-each select="$this-element/serviceList/service">
|
---|
| 239 | <xsl:variable name="action"><xsl:choose>
|
---|
[21282] | 240 | <xsl:when test="@hidden='true'">DO_NOT_DISPLAY</xsl:when>
|
---|
[19895] | 241 | <xsl:when test="@name=$this-service">CURRENT</xsl:when>
|
---|
| 242 | <xsl:when test="@type='query'">q</xsl:when>
|
---|
| 243 | <xsl:when test="@type='browse'">b</xsl:when>
|
---|
| 244 | <xsl:when test="@type='process'">pr</xsl:when>
|
---|
| 245 | <xsl:when test="@type='applet'">a</xsl:when>
|
---|
| 246 | <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
|
---|
| 247 | </xsl:choose></xsl:variable>
|
---|
| 248 | <xsl:choose>
|
---|
| 249 | <xsl:when test="$action='CURRENT'">
|
---|
| 250 | <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li>
|
---|
| 251 | </xsl:when>
|
---|
| 252 | <xsl:when test="$action !='DO_NOT_DISPLAY'">
|
---|
| 253 | <li><a href="{$library_name}?a={$action}&rt=d&s={@name}&c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a></li>
|
---|
| 254 | </xsl:when>
|
---|
| 255 | </xsl:choose>
|
---|
| 256 | </xsl:for-each>
|
---|
| 257 | </xsl:template>
|
---|
[18595] | 258 |
|
---|
| 259 |
|
---|
[19895] | 260 | <xsl:template name="collectionDescriptionTextAndServicesLinks">
|
---|
| 261 | <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
|
---|
| 262 | </xsl:template>
|
---|
[18595] | 263 |
|
---|
[19895] | 264 | <xsl:template match="collection|serviceCluster">
|
---|
| 265 | <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
|
---|
| 266 |
|
---|
| 267 | <xsl:apply-templates select="serviceList">
|
---|
| 268 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 269 | </xsl:apply-templates>
|
---|
| 270 | </xsl:template>
|
---|
[18595] | 271 |
|
---|
| 272 |
|
---|
[19895] | 273 | <xsl:template match="serviceList">
|
---|
[18595] | 274 | <xsl:param name="collName"/>
|
---|
[24007] | 275 | <h3 class="getTextFor about.services">&nbsp;</h3>
|
---|
[18595] | 276 | <xsl:choose>
|
---|
| 277 | <xsl:when test="service">
|
---|
[24007] | 278 | <span class="getTextFor about.servicehelp">&nbsp;</span>
|
---|
[18595] | 279 | </xsl:when>
|
---|
| 280 | <xsl:otherwise>
|
---|
[24007] | 281 | <span class="getTextFor about.noservices">&nbsp;</span>
|
---|
[18595] | 282 | </xsl:otherwise>
|
---|
| 283 | </xsl:choose>
|
---|
| 284 |
|
---|
[19895] | 285 |
|
---|
[18595] | 286 | <xsl:if test="service">
|
---|
| 287 | <ul id="servicelist">
|
---|
| 288 | <xsl:for-each select="service">
|
---|
| 289 | <xsl:variable name="action"><xsl:choose>
|
---|
[21282] | 290 | <xsl:when test="@hidden='true'">DO_NOT_DISPLAY</xsl:when>
|
---|
[18595] | 291 | <xsl:when test="@type='query'">q</xsl:when>
|
---|
| 292 | <xsl:when test="@type='browse'">b</xsl:when>
|
---|
| 293 | <xsl:when test="@type='process'">pr</xsl:when>
|
---|
| 294 | <xsl:when test="@type='applet'">a</xsl:when>
|
---|
| 295 | <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
|
---|
| 296 | </xsl:choose></xsl:variable>
|
---|
| 297 | <xsl:if test="$action !='DO_NOT_DISPLAY'">
|
---|
| 298 | <li><a href="{$library_name}?a={$action}&rt=d&s={@name}&c={$collName}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li>
|
---|
| 299 | </xsl:if>
|
---|
| 300 | </xsl:for-each>
|
---|
| 301 | </ul>
|
---|
| 302 | </xsl:if>
|
---|
| 303 | </xsl:template>
|
---|
| 304 |
|
---|
[19895] | 305 | </xsl:stylesheet>
|
---|