Changeset 26501 for main


Ignore:
Timestamp:
2012-11-23T00:19:31+13:00 (11 years ago)
Author:
davidb
Message:

A move towards easier migration of Greenstone2 collections to Greenstone3. This mod makes it easier to establishe XSLT variables and Javascript variables that have the same name Greenstone2 macros such as _httpimages_ etc.

File:
1 edited

Legend:

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

    r26488 r26501  
    294294  <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
    295295  <xsl:variable name="this-service" select="/page/pageRequest/paramList/param[@name = 's']/@value"/>
    296  
     296
     297<!-- 
     298_httpimages_ {_httpweb_/images}
     299_httpscript_ {_httpweb_/script}
     300_httpstyle_ {_httpweb_/style}
     301_httpflash_ {_httpweb_/flash}
     302_httpjava_ {_httpweb_/java}
     303-->
     304
     305
     306  <xsl:template name="define-js-variable">
     307    <xsl:param name="name"/>
     308    <xsl:param name="value"/>
     309    <script type="text/javascript">
     310      gs.variables[<xslt:text disable-output-escaping="yes">"</xslt:text><xsl:value-of select="$name"/><xslt:text disable-output-escaping="yes">"</xslt:text>]
     311      <xslt:text disable-output-escaping="yes"> = "</xslt:text>
     312      <xsl:value-of select="$value"/>
     313      <xslt:text disable-output-escaping="yes">";</xslt:text>
     314    </script>
     315  </xsl:template>
     316
     317  <xsl:variable name="_httpcollection_" select="$httpPath"/>
     318  <xsl:variable name="_httpbrowse_"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/browse</xsl:variable>
     319  <xsl:variable name="_httpquery_"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/search</xsl:variable>
     320
     321  <xsl:template name="define-js-macro-variables">
     322
     323    <xsl:call-template name="define-js-variable">
     324      <xsl:with-param name="name"  select="'_httpbrowse_'"/>
     325      <xsl:with-param name="value" select="$_httpbrowse_"/>
     326    </xsl:call-template>
     327
     328    <xsl:call-template name="define-js-variable">
     329      <xsl:with-param name="name"  select="'_httpquery_'"/>
     330      <xsl:with-param name="value" select="$_httpquery_"/>
     331    </xsl:call-template>
     332
     333  </xsl:template>
     334
     335
    297336  <xsl:template name="aboutCollectionPageTitle">
    298337    <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
Note: See TracChangeset for help on using the changeset viewer.