Changeset 18387


Ignore:
Timestamp:
01/15/09 14:51:55 (12 years ago)
Author:
kjdon
Message:

moved all icon templates into new icons.xsl so gs2 interface can share them. added direction template

File:
1 edited

Legend:

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

    r18332 r18387  
    77  exclude-result-prefixes="java util">
    88
     9  <xsl:include href="icons.xsl"/>
     10
    911  <!-- some global parameters - these are set by whoever is invoking the transformation -->
    1012  <xsl:param name="interface_name"/>
    1113  <xsl:param name="library_name"/>
     14
    1215  <!-- global style info goes here  -->
    1316  <xsl:template name="globalStyle">
     
    174177  </xsl:template>
    175178
    176   <!-- Display the appropriate image, depending on the node type -->
    177   <xsl:template match="documentNode" mode="displayNodeIcon">
    178    
    179     <!-- Root node: book icon (open or closed) -->
    180     <xsl:choose>
    181       <xsl:when test="@nodeType='root'">
    182     <xsl:choose>
    183       <xsl:when test="documentNode">
    184         <xsl:call-template name="openbookimg">
    185           <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param>
    186         </xsl:call-template>
    187       </xsl:when>
    188       <xsl:otherwise>
    189         <xsl:call-template name="closedbookimg">
    190           <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_book')"/></xsl:with-param>
    191         </xsl:call-template>
    192       </xsl:otherwise>
    193     </xsl:choose>
    194       </xsl:when>
    195      
    196       <!-- Internal node: folder icon (open or closed) -->
    197       <xsl:when test="@nodeType='internal'">
    198     <xsl:choose>
    199       <xsl:when test="documentNode">
    200         <xsl:call-template name="openfolderimg">
    201           <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_folder')"/></xsl:with-param>
    202         </xsl:call-template>
    203       </xsl:when>
    204       <xsl:otherwise>
    205         <xsl:call-template name="closedfolderimg">
    206           <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'open_folder')"/></xsl:with-param>
    207         </xsl:call-template>
    208       </xsl:otherwise>
    209     </xsl:choose>
    210       </xsl:when>
    211      
    212       <!-- Leaf node: page icon, and this is the default -->
    213       <xsl:otherwise>
    214     <xsl:call-template name="textpageimg">
    215       <xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'view_document')"/></xsl:with-param>
    216     </xsl:call-template>
    217       </xsl:otherwise>
    218     </xsl:choose>
     179
     180  <xsl:template name="direction">
     181    <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>
    219182  </xsl:template>
    220183
    221   <xsl:template name="openbookimg">
    222     <xsl:param name="alt"/>
    223     <xsl:param name="title"/>
    224     <img  border="0" width="28" height="23"
    225       src="interfaces/default/images/openbook.gif"
    226       alt="{$alt}" title="{$title}"/>
    227   </xsl:template>
    228 
    229   <xsl:template name="closedbookimg">
    230     <xsl:param name="alt"/>
    231     <xsl:param name="title"/>
    232     <img border="0" width="18" height="11"
    233       src="interfaces/default/images/book.gif"
    234       alt="{$alt}" title="{$title}"/>
    235   </xsl:template>
    236 
    237   <xsl:template name="openfolderimg">
    238     <xsl:param name="alt"/>
    239     <xsl:param name="title"/>
    240     <img border="0" width="23" height="15"
    241       src="interfaces/default/images/openfldr.gif"
    242       alt="{$alt}" title="{$title}"/>
    243   </xsl:template>
    244 
    245   <xsl:template name="closedfolderimg">
    246     <xsl:param name="alt"/>
    247     <xsl:param name="title"/>
    248     <img  border="0" width="23" height="15"
    249       src="interfaces/default/images/clsdfldr.gif"
    250       alt="{$alt}" title="{$title}"/>
    251   </xsl:template>
    252 
    253   <xsl:template name="textpageimg">
    254     <xsl:param name="alt"/>
    255     <xsl:param name="title"/>
    256     <img  border="0" width="16" height="21"
    257       src="interfaces/default/images/itext.gif"
    258       alt="{$alt}" title="{$title}"/>
    259   </xsl:template>
    260 
    261   <xsl:template name="bookshelfimg">
    262     <xsl:param name="alt"/>
    263     <xsl:param name="title"/>
    264     <img  border="0" width="20" height="16"
    265       src="interfaces/default/images/bshelf.gif" 
    266       alt="{$alt}" title="{$title}"/>
    267   </xsl:template>
    268184</xsl:stylesheet> 
    269185
Note: See TracChangeset for help on using the changeset viewer.