Changeset 18595
- Timestamp:
- 2009-02-25T15:58:23+13:00 (15 years ago)
- Location:
- greenstone3/trunk/web/interfaces/default/transform
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/web/interfaces/default/transform/about.xsl
r18388 r18595 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 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 extension-element-prefixes="java util" 7 exclude-result-prefixes="java util"> 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 xmlns:java="http://xml.apache.org/xslt/java" 5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil" 6 xmlns:gslib="http://www.greenstone.org/skinning" 7 extension-element-prefixes="java util" 8 exclude-result-prefixes="java util"> 9 10 11 <xsl:template match="page"> 8 12 9 <!-- style includes global params interface_name, library_name --> 10 <xsl:include href="style.xsl"/> 11 12 <xsl:output method="html"/> 13 14 <!-- the main page layout template is here --> 15 <xsl:template match="page"> 16 <html> 17 <head> 18 <title> 19 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title--> 20 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text> 21 </title> 22 <xsl:call-template name="globalStyle"/> 23 <xsl:call-template name="pageStyle"/> 24 </head> 25 <body> 26 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute> 13 <!-- the page layout template is here --> 14 <html> 15 <head> 16 <title> 17 <gslib:aboutCollectionPageTitle/> 18 </title> 19 <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/> 20 </head> 21 22 <body><gslib:textDirectionAttribute/> 23 27 24 <div id="page-wrapper"> 28 <xsl:call-template name="response" /> 29 <xsl:call-template name="greenstoneFooter"/> 25 <gslib:displayErrorsIfAny/> 26 27 <div id="banner"> 28 <p> 29 <gslib:collectionHomeLinkWithLogoIfAvailable/> 30 </p> 31 <ul id="bannerlist"> 32 <li><gslib:homeButtonTop/></li> 33 <li><gslib:helpButtonTop/></li> 34 <li><gslib:preferencesButtonTop/></li> 35 </ul> 36 </div> 37 38 <!--If some services are available for the current collection display the navigation bar--> 39 <xsl:choose> 40 <xsl:when test="$this-element/serviceList/service"> 41 <div id="navbar"> 42 <ul id="navbarlist"> 43 <gslib:servicesNavigationBar/> 44 </ul> 45 </div> 46 </xsl:when> 47 <!--Otherwise simply display a blank divider bar--> 48 <xsl:otherwise> 49 <div class="divbar"><gslib:noTextBar/></div> 50 </xsl:otherwise> 51 </xsl:choose> 52 53 <div id="content"> 54 <!--Display the description text of the current collection, 55 and if some services are available then create a list 56 of links for each service within a <ul id="servicelist"> element.--> 57 <gslib:collectionDescriptionTextAndServicesLinks/> 58 </div> 59 60 <div id="footer"> 61 <div class="divbar"><gslib:poweredByGS3TextBar/></div> 62 </div> 30 63 </div> 31 32 33 64 </body> 65 </html> 66 </xsl:template> 34 67 35 <xsl:template name="pageTitle">36 <xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/>37 </xsl:template>38 39 <!-- page specific style goes here -->40 <xsl:template name="pageStyle"/>41 42 <xsl:template match="pageResponse">43 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>44 <xsl:apply-templates select="collection|serviceCluster"><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>45 </xsl:template>46 47 <xsl:template match="collection|serviceCluster">48 <xsl:param name="collName"/>49 <xsl:call-template name="standardPageBanner">50 <xsl:with-param name="collName" select="$collName"/>51 </xsl:call-template>52 <xsl:call-template name="navigationBar">53 <xsl:with-param name="collName" select="$collName"/>54 </xsl:call-template>55 <div id="content">56 <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>57 <xsl:apply-templates select="serviceList">58 <xsl:with-param name="collName" select="$collName"/>59 </xsl:apply-templates>60 </div>61 </xsl:template>62 63 64 <xsl:template match="serviceList">65 <xsl:param name="collName"/>66 <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3>67 <xsl:choose>68 <xsl:when test="service">69 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>70 </xsl:when>71 <xsl:otherwise>72 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>73 </xsl:otherwise>74 </xsl:choose>75 76 <xsl:if test="service">77 <ul id="servicelist">78 <xsl:for-each select="service">79 <xsl:variable name="action"><xsl:choose>80 <xsl:when test="@type='query'">q</xsl:when>81 <xsl:when test="@type='browse'">b</xsl:when>82 <xsl:when test="@type='process'">pr</xsl:when>83 <xsl:when test="@type='applet'">a</xsl:when>84 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>85 </xsl:choose></xsl:variable>86 <xsl:if test="$action !='DO_NOT_DISPLAY'">87 <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>88 </xsl:if>89 </xsl:for-each>90 </ul>91 </xsl:if>92 </xsl:template>93 68 94 69 </xsl:stylesheet> -
greenstone3/trunk/web/interfaces/default/transform/util.xsl
r18482 r18595 16 16 17 17 18 <xsl:template name="textDirectionAttribute"> 19 <xsl:attribute name="dir"><xsl:if 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:if></xsl:attribute> 20 </xsl:template> 21 22 23 <xsl:template name="defaultDividerBar"> 18 <xsl:template name="textDirectionAttribute"> 19 <xsl:attribute name="dir"> 20 <xsl:choose> 21 <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> 22 <xsl:otherwise>ltr</xsl:otherwise> 23 </xsl:choose> 24 </xsl:attribute> 25 </xsl:template> 26 27 28 <xsl:template name="defaultDividerBar"> 24 29 <xsl:param name='text'/> 25 30 <xsl:choose> … … 31 36 </xsl:otherwise> 32 37 </xsl:choose> 33 34 35 36 38 </xsl:template> 39 40 41 <xsl:template match="error"> 37 42 Error: <xsl:value-of select="."/> 38 43 </xsl:template> 39 44 40 45 … … 84 89 <!-- site home ....................................................................... --> 85 90 86 <xsl:template name=" homePageTitle">91 <xsl:template name="siteHomePageTitle"> 87 92 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title--> 88 93 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text> … … 166 171 167 172 <!-- about page - collection home ....................................................................... --> 168 173 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/> 174 <xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/> 175 <xsl:param name="pageType"/> 176 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/> 177 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/> 178 179 180 <xsl:template name="aboutCollectionPageTitle"> 181 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title--> 182 <xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/><xsl:text> </xsl:text> 183 </xsl:template> 184 185 186 <xsl:template name="collectionHomeLinkWithLogoIfAvailable"> 187 <a href="{$library_name}?a=p&sa=about&c={$collName}"> 188 <xsl:choose> 189 <xsl:when test="$this-element/displayItem[@name='icon']"> 190 <img border="0"> 191 <xsl:attribute name="src"> 192 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/> 193 </xsl:attribute> 194 <xsl:attribute name="alt"> 195 <xsl:value-of select="$this-element/displayItem[@name='name']"/> 196 </xsl:attribute> 197 <xsl:attribute name="title"> 198 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/> 199 </xsl:attribute> 200 </img> 201 </xsl:when> 202 <xsl:otherwise> 203 <xsl:value-of select="$this-element/displayItem[@name='name']"/> 204 </xsl:otherwise> 205 </xsl:choose> 206 </a> 207 </xsl:template> 208 209 210 <xsl:template name="homeButtonTop"> 211 <a href="{$library_name}?a=p&sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute> 212 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></a> 213 </xsl:template> 214 215 216 <xsl:template name="helpButtonTop"> 217 <xsl:choose> 218 <xsl:when test="$pageType='help'"> 219 <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a></li> 220 </xsl:when> 221 <xsl:otherwise> 222 <li><a href="{$library_name}?a=p&sa=help&c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute> 223 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/> 224 </a></li> 225 </xsl:otherwise> 226 </xsl:choose> 227 </xsl:template> 228 229 230 <xsl:template name="preferencesButtonTop"> 231 <xsl:choose> 232 <xsl:when test="$pageType='pref'"> 233 <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li> 234 </xsl:when> 235 <xsl:otherwise> 236 <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> 237 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/> 238 </a></li> 239 </xsl:otherwise> 240 </xsl:choose> 241 </xsl:template> 242 243 <xsl:template name="servicesNavigationBar"> 244 <xsl:for-each select="$this-element/serviceList/service"> 245 <xsl:variable name="action"><xsl:choose> 246 <xsl:when test="@name=$this-service">CURRENT</xsl:when> 247 <xsl:when test="@type='query'">q</xsl:when> 248 <xsl:when test="@type='browse'">b</xsl:when> 249 <xsl:when test="@type='process'">pr</xsl:when> 250 <xsl:when test="@type='applet'">a</xsl:when> 251 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise> 252 </xsl:choose></xsl:variable> 253 <xsl:choose> 254 <xsl:when test="$action='CURRENT'"> 255 <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li> 256 </xsl:when> 257 <xsl:when test="$action !='DO_NOT_DISPLAY'"> 258 <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> 259 </xsl:when> 260 </xsl:choose> 261 </xsl:for-each> 262 </xsl:template> 263 264 265 <xsl:template name="collectionDescriptionTextAndServicesLinks"> 266 <xsl:apply-templates select="pageResponse/collection|serviceCluster"/> 267 </xsl:template> 268 269 <xsl:template match="collection|serviceCluster"> 270 <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/> 271 272 <xsl:apply-templates select="serviceList"> 273 <xsl:with-param name="collName" select="$collName"/> 274 </xsl:apply-templates> 275 </xsl:template> 276 277 278 <xsl:template match="serviceList"> 279 <xsl:param name="collName"/> 280 <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3> 281 <xsl:choose> 282 <xsl:when test="service"> 283 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/> 284 </xsl:when> 285 <xsl:otherwise> 286 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/> 287 </xsl:otherwise> 288 </xsl:choose> 289 290 291 <xsl:if test="service"> 292 <ul id="servicelist"> 293 <xsl:for-each select="service"> 294 <xsl:variable name="action"><xsl:choose> 295 <xsl:when test="@type='query'">q</xsl:when> 296 <xsl:when test="@type='browse'">b</xsl:when> 297 <xsl:when test="@type='process'">pr</xsl:when> 298 <xsl:when test="@type='applet'">a</xsl:when> 299 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise> 300 </xsl:choose></xsl:variable> 301 <xsl:if test="$action !='DO_NOT_DISPLAY'"> 302 <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> 303 </xsl:if> 304 </xsl:for-each> 305 </ul> 306 </xsl:if> 307 </xsl:template> 169 308 170 309
Note:
See TracChangeset
for help on using the changeset viewer.