Ignore:
Timestamp:
2007-09-05T16:28:14+12:00 (17 years ago)
Author:
anna
Message:

Added the right-to-left direction display for Arabic etc. language.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/interfaces/classic/transform/style.xsl

    r14377 r14419  
    1616      <xsl:call-template name="pageHead"/>
    1717      <body class="bgimage">
     18    <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
    1819    <div id="page">
    1920       <xsl:apply-templates select="pageResponse"/>
     
    2324    </html>
    2425  </xsl:template>
    25 
    2626 
    2727  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
     
    165165    <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
    166166    <xsl:variable name="classifiers" select="$this-element/serviceList/service[@name='ClassifierBrowse']/classifierList[1]"/>
    167      <div class="navbar">
     167
     168    <!-- display order, for Arabic etc. languages, display right to left -->
     169    <xsl:variable name="dir"><xsl:call-template name="direction"/></xsl:variable>
     170    <xsl:variable name="sort_order"><xsl:choose><xsl:when test="$dir='rtl'">descending</xsl:when><xsl:otherwise>ascending</xsl:otherwise></xsl:choose></xsl:variable>       
     171
     172    <div class="navbar">
    168173       <p class="navbar">
     174     <xsl:choose>
     175     <xsl:when test="not($dir='rtl')">
    169176     <xsl:if test="$this-element/serviceList/service[@type='query']">
    170177       <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
    171178     </xsl:if>
    172    
     179     </xsl:when>
     180     <xsl:otherwise>
     181      <xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
     182      <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
     183      </xsl:if>
     184     </xsl:otherwise>
     185    </xsl:choose>
     186
    173187    <xsl:for-each select="$classifiers/classifier">
     188      <xsl:sort order="{$sort_order}" select="position()" />
    174189      <xsl:apply-templates select="." mode="navbar">
    175190        <xsl:with-param name="collName" select="$collName"/>
     
    177192      </xsl:apply-templates>
    178193    </xsl:for-each>
    179    
     194       
     195    <xsl:choose>   
     196    <xsl:when test="$dir='rtl'">
     197    <xsl:if test="$this-element/serviceList/service[@type='query']">
     198       <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
     199    </xsl:if>
     200    </xsl:when>
     201    <xsl:otherwise>
    180202    <xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
    181203      <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
    182204    </xsl:if>
     205    </xsl:otherwise>
     206    </xsl:choose>
    183207       </p>
    184208      </div>
     
    366390  </xsl:template>
    367391
     392  <xsl:template name="direction">
     393    <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>
     394  </xsl:template>
     395
    368396</xsl:stylesheet> 
Note: See TracChangeset for help on using the changeset viewer.