Changeset 25752

Show
Ignore:
Timestamp:
05.06.2012 15:44:56 (7 years ago)
Author:
ak19
Message:

Renamed recently-introduced gsf:displayText template to gsf:displayItem, and created a new template by name gsf:displayText, which will lookup the requested string in the collectionConfig.xml first (where it may be a displayItem) or else in the interface dictionary for the current language. If neither has a value for the requested string, it will return the string itself.

Files:
1 modified

Legend:

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

    r25732 r25752  
    122122    </xsl:template> 
    123123 
     124    <!-- A GLI user can use a gsf:displayText element in GS3's Format Features to retrieve 
     125      a string defined in either collectionConfig.xml or else the interface dictionaries.  
     126      If the requested string occurs in neither, the request string itself will be output. --> 
    124127    <xsl:template match="gsf:displayText"> 
     128      <xslt:variable name="displaytext"> 
     129        <xsl:call-template name="gsf:displayItem"/> 
     130      </xslt:variable> 
     131 
     132      <xslt:choose> 
     133        <xslt:when test="$displaytext != ''"> 
     134          <xslt:value-of disable-output-escaping="yes" select="$displaytext"/>         
     135        </xslt:when> 
     136        <xslt:otherwise> 
     137          <xslt:variable name="interfacetxt"> 
     138        <xsl:call-template name="gsf:interfaceText"/> 
     139          </xslt:variable> 
     140 
     141          <xslt:choose> 
     142        <xslt:when test="$interfacetxt != ''"> 
     143          <xslt:value-of disable-output-escaping="yes" select="$interfacetxt"/> 
     144        </xslt:when> 
     145        <xslt:otherwise> 
     146          <xslt:value-of disable-output-escaping="yes" select="'{@name}'"/> 
     147        </xslt:otherwise> 
     148          </xslt:choose> 
     149        </xslt:otherwise> 
     150      </xslt:choose> 
     151    </xsl:template> 
     152 
     153    <!-- With gsf:displayItem, a user can request a displayItem from collectionConfig.xml --> 
     154    <xsl:template match="gsf:displayItem" name="gsf:displayItem"> 
    125155      <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItem[@name='{@name}']"/> 
    126156    </xsl:template> 
    127157 
    128     <xsl:template match="gsf:interfaceText"> 
     158    <!-- With gsf:interfaceText, a user can request a string from the interface dictionaries in the current lang --> 
     159    <xsl:template match="gsf:interfaceText" name="gsf:interfaceText"> 
    129160      <xslt:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, '{@name}')"/> 
    130161    </xsl:template>