- Timestamp:
- 2009-07-14T09:09:40+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/web/interfaces/oran/transform/util.xsl
r19856 r19988 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <xsl:stylesheet version="1.0" 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 2 <xsl:stylesheet version="1.0" 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 4 xmlns:gslib="http://www.greenstone.org/XSL/Library" 5 5 xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil" … … 9 9 <xsl:param name="interface_name"/> 10 10 <xsl:param name="library_name"/> 11 11 12 12 <!-- every pages ....................................................................... --> 13 13 <xsl:template name="siteName"><xsl:value-of select="/page/pageResponse/metadataList/metadata[@name='siteName']"/></xsl:template> 14 <xsl:template name="siteLink"><a href="./"><xsl:call-template name="siteName"/></a></xsl:template> 15 14 16 <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/> </xsl:variable> 15 17 <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/> … … 18 20 <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/> 19 21 20 22 <!-- template to get the name of the current collection --> 23 <xsl:template name="collectionName"> 24 <xsl:choose> 25 <xsl:when test="/page/pageResponse/collection"><xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/></xsl:when> 26 <xsl:otherwise>All Collections</xsl:otherwise> 27 </xsl:choose> 28 </xsl:template> 29 30 <xsl:template name="collectionNameShort"> 31 <xsl:value-of select="/page/pageResponse/collection/@name"/> 32 </xsl:template> 33 34 <xsl:template name="collectionNameLinked"> 35 <xsl:choose> 36 <xsl:when test="/page/pageResponse/collection"> 37 <a> 38 <xsl:attribute name="href"><xsl:call-template name="siteURL"/><xsl:value-of select="$library_name"/>?a=p&sa=about&c=<xsl:call-template name="collectionNameShort"/></xsl:attribute> 39 <xsl:call-template name="collectionName"/> 40 </a> 41 </xsl:when> 42 <xsl:otherwise> 43 <a> 44 <xsl:attribute name="href"><xsl:call-template name="siteURL"/></xsl:attribute> 45 All Collections 46 </a> 47 </xsl:otherwise> 48 </xsl:choose> 49 </xsl:template> 50 51 <!-- text to get the name of the current service ("Browse","Search" etc) --> 52 <xsl:template name="serviceName"> 53 <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/> 54 </xsl:template> 55 21 56 <xsl:template name="textDirectionAttribute"> 22 57 <xsl:attribute name="dir"> … … 24 59 <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> 25 60 <xsl:otherwise>ltr</xsl:otherwise> 26 </xsl:choose> 61 </xsl:choose> 27 62 </xsl:attribute> 28 </xsl:template> 29 63 </xsl:template> 64 65 <xsl:template name="actionClass"> 66 <xsl:attribute name="class"><xsl:value-of select="/page/pageRequest/@action"/>Action <xsl:if test="/page/pageRequest/@subaction"><xsl:value-of select="/page/pageRequest/@subaction"/>Subaction</xsl:if></xsl:attribute> 67 </xsl:template> 68 69 <!-- username, if logged in --> 70 <!-- 71 <xsl:template name="username"> 72 <xsl:if test="$un_s!=''"> 73 <xsl:if test="$asn!='' and $asn!='0'"> 74 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.username')"/> : <xsl:value-of select="$un_s"/> 75 </xsl:if> 76 </xsl:if> 77 </xsl:template> 78 --> 79 30 80 <xsl:template name="defaultDividerBar"> 31 81 <xsl:param name='text'/> … … 37 87 <div class="divbar"><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></div> 38 88 </xsl:otherwise> 39 </xsl:choose> 89 </xsl:choose> 40 90 </xsl:template> 41 42 91 92 43 93 <xsl:template match="error"> 44 94 Error: <xsl:value-of select="."/> 45 95 </xsl:template> 46 47 96 97 48 98 <xsl:template name="displayErrorsIfAny"> 49 99 <xsl:if test="descendant::error"> … … 67 117 removeAllChildren(hide_link); 68 118 hide_link.appendChild(document.createTextNode("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'show_error')"/><xsl:text disable-output-escaping="yes">")); 69 } 119 } 70 120 } 71 121 </xsl:text> … … 85 135 86 136 <xsl:template name="poweredByGS3TextBar"> 87 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 88 </xsl:template> 89 90 137 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/> 138 </xsl:template> 139 140 <xsl:template name="rightArrow"><xsl:text disable-output-escaping="yes"> &raquo; </xsl:text></xsl:template> 141 142 143 91 144 <!-- site home ....................................................................... --> 92 145 … … 100 153 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.select_a_collection')"/> 101 154 </xsl:template> 102 103 104 155 <xsl:template name="crossCollectionQuickSearchForm"> 105 156 <xsl:apply-templates select="serviceList/service[@name='TextQuery']"/> 106 </xsl:template> 157 </xsl:template> 107 158 108 159 <xsl:template match="service[@name='TextQuery']"> … … 127 178 </xsl:when> 128 179 <xsl:otherwise> 129 <a href="{$library_name}?a=p&sa=about&c={@name}"> 180 <a href="{$library_name}?a=p&sa=about&c={@name}"> 130 181 <xsl:value-of select="displayItem[@name='name']"/> 131 182 </a> 132 183 </xsl:otherwise> 133 </xsl:choose> 184 </xsl:choose> 134 185 </xsl:template> 135 186 … … 137 188 <xsl:template name="serviceClusterList"> 138 189 <xsl:apply-templates select="serviceClusterList"/> 139 </xsl:template> 190 </xsl:template> 140 191 141 192 <xsl:template match="serviceClusterList"> 142 <xsl:for-each select="serviceCluster"> 193 <xsl:for-each select="serviceCluster"> 143 194 <a href="{$library_name}?a=p&sa=about&c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a> 144 195 </xsl:for-each> 145 196 </xsl:template> 146 197 147 148 <xsl:template name="serviceLink"> 149 <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']"/> 150 </xsl:template> 151 152 198 199 <xsl:template name="serviceLink"> 200 <div class="paramLabel"><a href="{$library_name}?a=q&rt=d&s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></div> 201 <div class="paramValue"><xsl:value-of select="displayItem[@name='description']"/></div> 202 <br class="clear"/> 203 </xsl:template> 204 205 153 206 <xsl:template name="authenticationLink"> 154 207 <xsl:for-each select="serviceList/service[@type='authen']"> 155 208 <li><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']"/></li></xsl:for-each> 156 </xsl:template> 157 158 209 </xsl:template> 159 210 <xsl:template name="libraryInterfaceLink"> 160 211 <li><a href="{$library_name}?a=p&sa=gli4gs3"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.librarian_interface')"/></a></li> 161 </xsl:template> 162 163 212 </xsl:template> 164 213 <xsl:template name="greenstoneLogoAlternateText"> 165 214 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/> … … 224 273 225 274 226 <xsl:template name="preferencesButtonTop"> 227 <xsl:choose> 228 <xsl:when test="$pageType='pref'"> 229 <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li> 230 </xsl:when> 231 <xsl:otherwise> 232 <li><a href="{$library_name}?a=p&sa=pref&c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute> 233 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/> 234 </a></li> 235 </xsl:otherwise> 236 </xsl:choose> 237 </xsl:template> 238 239 <xsl:template name="servicesNavigationBar"> 240 <xsl:for-each select="$this-element/serviceList/service"> 241 <xsl:variable name="action"><xsl:choose> 242 <xsl:when test="@name=$this-service">CURRENT</xsl:when> 243 <xsl:when test="@type='query'">q</xsl:when> 244 <xsl:when test="@type='browse'">b</xsl:when> 245 <xsl:when test="@type='process'">pr</xsl:when> 246 <xsl:when test="@type='applet'">a</xsl:when> 247 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise> 248 </xsl:choose></xsl:variable> 249 <xsl:choose> 250 <xsl:when test="$action='CURRENT'"> 251 <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li> 252 </xsl:when> 253 <xsl:when test="$action !='DO_NOT_DISPLAY'"> 254 <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> 255 </xsl:when> 256 </xsl:choose> 257 </xsl:for-each> 258 </xsl:template> 259 260 261 <xsl:template name="collectionDescriptionTextAndServicesLinks"> 262 <xsl:apply-templates select="pageResponse/collection|serviceCluster"/> 263 </xsl:template> 264 265 <xsl:template match="collection|serviceCluster"> 266 <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/> 267 268 <xsl:apply-templates select="serviceList"> 269 <xsl:with-param name="collName" select="$collName"/> 270 </xsl:apply-templates> 271 </xsl:template> 272 273 274 <xsl:template match="serviceList"> 275 <xsl:param name="collName"/> 276 <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3> 277 <xsl:choose> 278 <xsl:when test="service"> 279 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/> 280 </xsl:when> 281 <xsl:otherwise> 282 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/> 283 </xsl:otherwise> 284 </xsl:choose> 285 286 287 <xsl:if test="service"> 288 <ul id="servicelist"> 289 <xsl:for-each select="service"> 290 <xsl:variable name="action"><xsl:choose> 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> 275 <xsl:template name="preferencesButtonTop"> 276 <xsl:choose> 277 <xsl:when test="$pageType='pref'"> 278 <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li> 279 </xsl:when> 280 <xsl:otherwise> 281 <li><a href="{$library_name}?a=p&sa=pref&c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute> 282 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/> 283 </a></li> 284 </xsl:otherwise> 285 </xsl:choose> 286 </xsl:template> 287 288 <xsl:template name="servicesNavigationBar"> 289 <xsl:for-each select="$this-element/serviceList/service"> 290 <xsl:variable name="action"><xsl:choose> 291 <xsl:when test="@name=$this-service">CURRENT</xsl:when> 292 <xsl:when test="@type='query'">q</xsl:when> 293 <xsl:when test="@type='browse'">b</xsl:when> 294 <xsl:when test="@type='process'">pr</xsl:when> 295 <xsl:when test="@type='applet'">a</xsl:when> 296 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise> 297 </xsl:choose></xsl:variable> 298 <xsl:choose> 299 <xsl:when test="$action='CURRENT'"> 300 <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li> 301 </xsl:when> 302 <xsl:when test="$action !='DO_NOT_DISPLAY'"> 303 <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> 304 </xsl:when> 305 </xsl:choose> 306 </xsl:for-each> 307 </xsl:template> 308 309 310 <xsl:template name="collectionDescriptionTextAndServicesLinks"> 311 <xsl:apply-templates select="pageResponse/collection|serviceCluster"/> 312 </xsl:template> 313 314 <xsl:template match="collection|serviceCluster"> 315 <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/> 316 <xsl:apply-templates select="serviceList"> 317 <xsl:with-param name="collName" select="$collName"/> 318 </xsl:apply-templates> 319 </xsl:template> 320 321 322 <xsl:template match="serviceList"> 323 <xsl:param name="collName"/> 324 <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3> 325 <p> 326 <xsl:choose> 327 <xsl:when test="service"> 328 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/> 329 </xsl:when> 330 <xsl:otherwise> 331 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/> 332 </xsl:otherwise> 333 </xsl:choose> 334 </p> 335 336 <xsl:if test="service"> 337 <div id="servicelist"> 338 <xsl:for-each select="service"> 339 <xsl:sort select="position()" order="descending" data-type="number"/> 340 341 <xsl:variable name="action"><xsl:choose> 342 <xsl:when test="@type='query'">q</xsl:when> 343 <xsl:when test="@type='browse'">b</xsl:when> 344 <xsl:when test="@type='process'">pr</xsl:when> 345 <xsl:when test="@type='applet'">a</xsl:when> 346 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise> 347 </xsl:choose></xsl:variable> 348 <xsl:if test="$action != 'DO_NOT_DISPLAY'"> 349 <div class="paramLabel"><a href="{$library_name}?a={$action}&rt=d&s={@name}&c={$collName}"><xsl:value-of select="displayItem[@name='name']"/></a></div> 350 <div class="paramLabel"><xsl:value-of select="displayItem[@name='description']"/></div> 351 <br class="clear"/> 352 </xsl:if> 353 </xsl:for-each> 354 </div> 355 </xsl:if> 356 </xsl:template> 304 357 305 358 306 359 307 360 <!-- classifier page ............................................................................ --> 308 <xsl:template name="collectionName"> 309 <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/> 310 </xsl:template> 311 312 <xsl:template name="collectionShortName"> 313 <xsl:value-of select="/page/pageResponse/collection/@name"/> 314 </xsl:template> 361 315 362 316 363 <xsl:template name="navigationTab"> … … 351 398 </xsl:template> 352 399 400 <!-- query page ............................................................................ --> 401 402 <xsl:template name="indexName"> 403 <xsl:value-of select="/page/pageResponse/service/displayItem[@name='name']"/> 404 </xsl:template> 405 406 <xsl:template name="queryPageCollectionName"> 407 <xsl:choose><xsl:when test="/page/pageResponse/collection"><gslib:aboutCollectionPageTitle/></xsl:when><xsl:otherwise>Cross-Collection</xsl:otherwise></xsl:choose> 408 </xsl:template> 409 410 411 412 413 353 414 <!-- 354 415 BERRY BASKET TEMPLATES … … 382 443 <script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDOnTop.js"><xsl:text> </xsl:text></script> 383 444 <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket.js"><xsl:text> </xsl:text></script> 384 <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/> 445 <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/> 385 446 </xsl:template> 386 447 … … 445 506 446 507 447 448 508 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.