Changeset 14419 for greenstone3


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.

Location:
greenstone3/trunk/web/interfaces/classic
Files:
3 edited

Legend:

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

    r14392 r14419  
    251251  border:none;
    252252}
     253
     254img.lessarrowrtl{
     255  float:right;
     256  border: none; 
     257}
     258
     259img.morearrowrtl{
     260  float:left;
     261  border:none;
     262}
  • greenstone3/trunk/web/interfaces/classic/transform/document.xsl

    r14391 r14419  
    1818      <xsl:call-template name="pageHead"/>
    1919      <body>
     20        <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
    2021        <div id="page">
    2122           <xsl:apply-templates select="pageResponse"/>
     
    8182  <xsl:template name="documentArrows">
    8283    <xsl:param name="collName"/>
     84    <xsl:variable name="dir"><xsl:call-template name="direction"/></xsl:variable>   
     85    <xsl:variable name="firstDir"><xsl:choose><xsl:when test="$dir='rtl'">forward</xsl:when><xsl:otherwise>back</xsl:otherwise></xsl:choose></xsl:variable>
     86    <xsl:variable name="secondDir"><xsl:choose><xsl:when test="$dir='rtl'">back</xsl:when><xsl:otherwise>forward</xsl:otherwise></xsl:choose></xsl:variable>
     87   
    8388    <div class="documentarrows">
    8489       <xsl:call-template name="documentArrow">
    8590        <xsl:with-param name="collName" select="$collName"/>
    86        <xsl:with-param name="direction">back</xsl:with-param>
     91        <xsl:with-param name="direction" select="$firstDir"/>
     92        <xsl:with-param name="pageDir" select="$dir"/>
    8793     </xsl:call-template>
    8894    <xsl:call-template name="documentArrow">
    8995      <xsl:with-param name="collName" select="$collName"/>
    90       <xsl:with-param name="direction">forward</xsl:with-param>
     96      <xsl:with-param name="direction" select="$secondDir"/>
     97      <xsl:with-param name="pageDir" select="$dir"/>
    9198    </xsl:call-template>
    9299    </div>   
     
    96103    <xsl:param name="collName"/>
    97104    <xsl:param name="direction"/>
     105    <xsl:param name="pageDir"/>
     106           
    98107    <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
    99108    <xsl:if test='$request-params/param[@name="dt"]/@value != "simple"'> 
    100     <a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="$collName"/>&amp;d=<xsl:value-of select="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose><xsl:when test="$direction='back'"><img class="lessarrow" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow" src="interfaces/default/images/more.gif"  /></xsl:otherwise></xsl:choose></a>
    101     </xsl:if>
     109    <a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="$collName"/>&amp;d=<xsl:value-of select="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose>
     110    <xsl:when test="$direction='back'"><img class="lessarrow{$pageDir}" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow{$pageDir}" src="interfaces/default/images/more.gif"  /></xsl:otherwise></xsl:choose></a>
     111    </xsl:if>
    102112  </xsl:template>
    103113         
  • 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.