Ignore:
Timestamp:
2003-09-01T09:55:05+12:00 (21 years ago)
Author:
kjdon
Message:

quite a olt of changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/web/interfaces/nzdl/transform/style.xsl

    r5120 r5388  
    1010  <xsl:param name="interface_name"/>
    1111  <xsl:param name="library_name"/>
     12
     13  <!-- some global variables -->
     14  <xsl:variable name="colour-button-text">#345437</xsl:variable>
     15  <xsl:variable name="colour-navbar-link-text">#345437</xsl:variable>
     16  <xsl:variable name="colour-navbar-selected-text">#c6aa69</xsl:variable>
    1217
    1318  <!-- the main page layout template is here -->
     
    3540  </xsl:template>
    3641
     42  <!-- any global java script should go in here -->
     43  <xsl:template name="headScript">
     44  </xsl:template>
     45 
     46  <!-- the old javascript for rollover images -->
     47  <!--
    3748  <xsl:template name="headScript">
    3849    <script>
    3950      <xsl:text disable-output-escaping="yes">
    40     &lt;!--
     51    &lt;!
    4152    var loaded = new Array();
    4253    function gbutton (image, onimage) {
     
    5970    }
    6071    }
    61     //--&gt;
     72    //&gt;
    6273     </xsl:text>
    6374     
    6475    </script>
    6576  </xsl:template>
    66 
     77-->
     78 
    6779  <xsl:template name="genericPageBanner">
    6880    <xsl:variable name="lang" select="/page/@lang"/>
     
    7183    <tr><td align="left"></td>
    7284      <td align="right">
    73         <a href="{$library_name}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
     85        <table>
     86          <tr><td xsl:use-attribute-sets="td-brownbutton">
     87          <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=home">
     88            <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b>
     89          </a>
     90        </td></tr></table>
    7491      </td>
    7592    </tr>
     
    7996  </xsl:template>
    8097 
    81 
    82   <!-- just pass in collname cos use it everywhere - saves working it out lots of times -->
    8398  <xsl:template name="standardPageBanner">
    8499    <xsl:param name="collName"/>
    85100    <xsl:param name="pageType"/>
    86     <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
    87     <xsl:variable name="colIcon" select="/page/pageResponse/collection/displayItem[@name='icon']"/>
    88     <xsl:variable name="lang" select="/page/@lang"/>
    89     <table width="537">
     101    <xsl:param name="clTop"/>
     102    <xsl:variable name="this-element" select="/page/pageResponse/collection"/>
     103    <table width="100%">
    90104      <tr>
    91105    <td align="left" rowspan="2">
    92106      <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
    93         <img border="1" src="{$httpPath}/images/{$colIcon}">
    94           <xsl:attribute name="alt">
    95         <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
    96           </xsl:attribute>
    97         </img>
     107        <xsl:choose>
     108          <xsl:when test="$this-element/displayItem[@name='icon']">
     109        <img border="0">
     110          <xsl:attribute name="src">
     111            <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
     112          </xsl:attribute> 
     113          <xsl:attribute name="alt">
     114            <xsl:value-of select="$this-element/displayItem[@name='name']"/>
     115          </xsl:attribute>
     116          <xsl:attribute name="title">
     117            <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
     118          </xsl:attribute>
     119        </img>
     120          </xsl:when>
     121          <xsl:otherwise>
     122        <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
     123          </xsl:otherwise>
     124        </xsl:choose>
    98125      </a>
    99126    </td>
    100127    <td align="right">
    101       <a href="{$library_name}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
    102       <a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}" onMouseover="roll('help',1);" onMouseOut="roll('help',0);"><img name="help" src="interfaces/nzdl/images/{$lang}/chelpof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chelpon.gif');" border="0" alt="Help page"/></a>
    103       <a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}" onMouseover="roll('pref',1);" onMouseOut="roll('pref',0);"><img name="pref" src="interfaces/nzdl/images/{$lang}/cprefof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/cprefon.gif');" border="0" alt="Preferences page"/></a>
     128      <table cellspacing='4'>
     129        <tr>
     130          <td xsl:use-attribute-sets="td-brownbutton">
     131        <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=home">
     132          <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b>
     133        </a>
     134          </td>
     135          <xsl:choose>
     136        <xsl:when test="$pageType='help'">
     137          <td xsl:use-attribute-sets="td-brownbutton-off">
     138            <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
     139          </td>
     140        </xsl:when>
     141        <xsl:otherwise>
     142          <td xsl:use-attribute-sets="td-brownbutton">
     143            <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}">
     144              <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
     145            </a>
     146          </td>
     147        </xsl:otherwise>
     148          </xsl:choose>
     149          <xsl:choose>
     150        <xsl:when test="$pageType='pref'">
     151          <td  xsl:use-attribute-sets="td-brownbutton-off">
     152            <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
     153          </td>
     154        </xsl:when>
     155        <xsl:otherwise>
     156          <td xsl:use-attribute-sets="td-brownbutton">
     157            <a title="xxpref" style="text-decoration:none" href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}">
     158              <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
     159            </a>
     160          </td>
     161        </xsl:otherwise>
     162          </xsl:choose>
     163        </tr>
     164      </table>
    104165    </td>
    105166      </tr>
     167      <xsl:if test="not(/page/pageRequest/@action='d')">
     168    <xsl:variable name="text">
     169      <xsl:choose>
     170        <xsl:when test="$pageType='browse'">
     171          <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier[@name=$clTop]/displayItem[@name='name']"/>
     172        </xsl:when>
     173        <xsl:otherwise>
     174          <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, concat($pageType, '_t'))"/>
     175        </xsl:otherwise>
     176      </xsl:choose>
     177    </xsl:variable>
     178    <tr>
     179      <td align='right' width="200" height="57" background='interfaces/nzdl/images/titleicon.gif'><font size="+2" color='black'><xsl:value-of select="$text"/>&#160;&#160;</font></td>
     180    </tr>
     181      </xsl:if>
     182    </table>
     183    <p/>
     184  </xsl:template>
     185
     186
     187  <xsl:template name="navigationBar">
     188    <xsl:param name="collName"/>
     189    <xsl:param name="clTop"/>
     190    <xsl:variable name="this-element" select="/page/pageResponse/collection"/>
     191    <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
     192    <xsl:variable name="classifiers" select="$this-element/serviceList/service[@name='ClassifierBrowse']/classifierList"/>
     193    <table border='0' cellspacing='0' width='100%'>
    106194      <tr>
    107     <td align='right'><xsl:if test="$pageType"><img src="interfaces/nzdl/images/{$lang}/h_{$pageType}.gif"  width="200" height="57"/></xsl:if></td>
    108       </tr>
    109      
    110       <tr>
    111     <td colspan='2'></td>
     195    <xsl:if test="$this-element/serviceList/service[@type='query']">
     196      <td xsl:use-attribute-sets="td-navbar">       
     197        <xsl:call-template name="navbar-search"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
     198      </td>
     199    </xsl:if>
     200   
     201    <xsl:for-each select="$classifiers/classifier">
     202      <td xsl:use-attribute-sets="td-navbar">
     203        <xsl:apply-templates select="." mode="navbar">
     204          <xsl:with-param name="collName" select="$collName"/>
     205          <xsl:with-param name="clTop" select="$clTop"/>
     206        </xsl:apply-templates>
     207      </td>
     208    </xsl:for-each>
     209   
     210    <xsl:if test="$this-element/serviceList/service[@name='PhindApplet']">
     211      <td xsl:use-attribute-sets="td-navbar">
     212        <xsl:call-template name="navbar-phind"><xsl:with-param name="collName" select="$collName"/></xsl:call-template>
     213      </td>
     214    </xsl:if>
    112215      </tr>
    113216    </table>
    114    
    115     <xsl:call-template name="navigationBar">
    116       <xsl:with-param name="collName" select="$collName"/>
    117     </xsl:call-template>
    118   </xsl:template>
    119 
    120   <xsl:template name="navigationBar">
    121     <xsl:param name="collName"/>
    122     <xsl:variable name="classifiers" select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList"/>
    123     <xsl:variable name="action" select="/page/pageRequest/@action"/>
    124     <xsl:variable name="classifier"><xsl:if test="$action='b'"><xsl:value-of select="/page/pageRequest/paramList/param[@name='cl']/@value"/></xsl:if></xsl:variable>
    125     <xsl:variable name="lang" select="/page/@lang"/>
    126     <!--action=<xsl:value-of select="$action"/>, classifier=<xsl:value-of select="$classifier"/>-->
    127     <xsl:text disable-output-escaping='yes'>
    128       &lt;!-- Navigation Bar --&gt;
    129     </xsl:text>
    130     <nobr>
    131       <xsl:call-template name="nbSearch">
    132     <xsl:with-param name="collName" select="$collName"/>
    133     <xsl:with-param name="action" select="$action"/>
    134       </xsl:call-template>
    135      
    136       <xsl:for-each select="$classifiers/classifier">
    137     <xsl:apply-templates select="." mode="nav-bar-button">
    138       <xsl:with-param name="collName" select="$collName"/>
    139       <xsl:with-param name="classifier" select="$classifier"/>
    140     </xsl:apply-templates>
    141       </xsl:for-each>
    142       <xsl:call-template name="nbPhrase"> <!-- this may be nothing if there is no phrase browsing for a collection -->
    143     <xsl:with-param name="collName" select="$collName"/>
    144     <xsl:with-param name="action" select="$action"/>
    145       </xsl:call-template> 
    146     </nobr>
    147     <xsl:text disable-output-escaping='yes'>
    148       &lt;!-- End of Navigation Bar --&gt;
    149     </xsl:text>
    150   </xsl:template>
    151 
    152   <xsl:template name="dividerBar">
    153     <xsl:param name='text'/>
    154     <br/><table width='537' border="0" cellpadding="0" cellspacing="0">
    155       <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b>&#160;<xsl:value-of select='$text'/></b></font></td></tr></table><br/>
    156   </xsl:template>
    157 
    158   <xsl:template name="navBarImage">
    159     <xsl:param name="url"/>
    160     <xsl:param name="name"/>
    161     <xsl:param name="alt"/>
    162     <xsl:variable name="lang" select="/page/@lang"/>
    163     <a href="{$url}" onMouseOver="roll('{$name}', 1);" onMouseOut="roll('{$name}', 0);"><img name="{$name}" src="interfaces/nzdl/images/{$lang}/t{$name}of.gif" onLoad="gbutton(this,'interfaces/nzdl/images/{$lang}/t{$name}on.gif');" border='0' alt="{$alt}" title="{alt}"/></a>
    164   </xsl:template>
    165  
    166   <xsl:template name="nbSearch">
    167     <xsl:param name="collName"/>
    168     <xsl:param name="action"/>
    169     <xsl:variable name="lang" select="/page/@lang"/>
    170     <xsl:choose>
    171       <xsl:when test="$action='q'">
    172     <img src="interfaces/nzdl/images/{$lang}/tSearchgr.gif" border='0' alt="Search" title="Search"/>
    173       </xsl:when>
    174       <xsl:otherwise>
    175     <!-- need to check for form search -->
    176     <xsl:variable name="query-service">
     217    <br/>
     218  </xsl:template>
     219
     220  <xsl:template name="navbar-search">
     221    <xsl:param name="collName"/>
     222    <xsl:choose>
     223      <xsl:when test="/page/pageRequest/@action='q'"><b><nobr><font size='+1' color='{$colour-navbar-selected-text}'>search</font></nobr></b></xsl:when>
     224      <xsl:otherwise>
     225    <xsl:variable name="service">
    177226      <xsl:choose>
    178227        <xsl:when test="not(/page/pageRequest/paramList/param[@name='ct'])">TextQuery</xsl:when>
     
    182231      </xsl:choose>
    183232    </xsl:variable>
    184     <xsl:call-template name="navBarImage">
    185       <xsl:with-param name="url">nzdl?a=q&amp;rt=d&amp;s=<xsl:value-of select="$query-service"/>&amp;c=<xsl:value-of select="$collName"/></xsl:with-param>
    186       <xsl:with-param name="name">Search</xsl:with-param>
    187       <xsl:with-param name="alt">Search</xsl:with-param>
    188     </xsl:call-template>
    189       </xsl:otherwise>
    190     </xsl:choose>
    191   </xsl:template>
    192  
    193   <xsl:template name="nbPhrase">
    194     <xsl:param name="collName"/>
    195     <xsl:param name="action"/>
    196     <xsl:variable name="lang" select="/page/@lang"/>
    197     <xsl:if test="/page/pageResponse/collection/serviceList/service[@name='PhindApplet']">
    198       <xsl:choose>
    199     <xsl:when test="$action='a'"><!-- note, this assumes that the phind applet is the only applet -->
    200       <img src="interfaces/nzdl/images/{$lang}/tPhrasegr.gif" border='0' alt="Phrase Browse" title="Phrase Browse"/>
    201     </xsl:when>
    202     <xsl:otherwise>
    203       <xsl:call-template name="navBarImage">
    204         <xsl:with-param name="url">nzdl?a=a&amp;rt=d&amp;s=PhindApplet&amp;c=<xsl:value-of select="$collName"/></xsl:with-param>
    205         <xsl:with-param name="name">Phrase</xsl:with-param>
    206         <xsl:with-param name="alt">Phrase Browse</xsl:with-param>
    207       </xsl:call-template>
    208     </xsl:otherwise>
    209       </xsl:choose>
    210     </xsl:if>
    211   </xsl:template>
    212  
    213   <xsl:template match="classifier" mode="nav-bar-button">
    214     <xsl:param name="collName"/>
    215     <xsl:param name="classifier"/>
    216     <xsl:variable name="buttonname"><xsl:choose><xsl:when test="@buttonname"><xsl:value-of select="@buttonname"/></xsl:when><xsl:otherwise><xsl:value-of select="@content"/></xsl:otherwise></xsl:choose></xsl:variable>
    217     <xsl:variable name="lang" select="/page/@lang"/>
    218     <xsl:choose>
    219       <xsl:when test="starts-with($classifier, @name)">
    220     <img src="interfaces/nzdl/images/{$lang}/t{$buttonname}gr.gif" border='0' alt="{$buttonname}" title="{$buttonname}"/>
    221       </xsl:when>
    222       <xsl:otherwise>
    223     <xsl:call-template name="navBarImage">
    224       <xsl:with-param name="url">nzdl?a=b&amp;rt=r&amp;s=ClassifierBrowse&amp;c=<xsl:value-of select="$collName"/>&amp;cl=<xsl:value-of select="@name"/></xsl:with-param>
    225       <xsl:with-param name="name" select="$buttonname"/>
    226       <xsl:with-param name="alt" select="$buttonname"/>
    227     </xsl:call-template>
    228       </xsl:otherwise>
    229     </xsl:choose>
    230   </xsl:template>
    231    
     233   
     234    <a style="text-decoration:none" href="{$library_name}?a=q&amp;rt=d&amp;s={$service}&amp;c={$collName}"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name=$service]/displayItem[@name='description']"/></xsl:attribute><b><nobr><font size='+1' color='{$colour-navbar-link-text}'>search</font></nobr></b></a>
     235      </xsl:otherwise>
     236    </xsl:choose>
     237  </xsl:template>
     238 
     239  <xsl:template name="navbar-phind">
     240    <xsl:param name="collName"/>
     241    <xsl:choose>
     242      <xsl:when test="/page/pageRequest/paramList/param[@name='s']/@value='PhindApplet'"><b><nobr><font size='+1' color='{$colour-navbar-selected-text}'>phrases</font></nobr></b></xsl:when>
     243      <xsl:otherwise>
     244    <a style="text-decoration:none" href="{$library_name}?a=a&amp;rt=d&amp;s=PhindApplet&amp;c={$collName}"><xsl:if test="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="/page/pageResponse/collection/service[@name='PhindApplet']/displayItem[@name='description']"/></xsl:attribute></xsl:if><b><nobr><font size='+1' color='{$colour-navbar-link-text}'>phrases</font></nobr></b></a>
     245      </xsl:otherwise>
     246    </xsl:choose>
     247  </xsl:template>
     248
     249  <xsl:template match="classifier" mode="navbar">
     250    <xsl:param name="collName"/>
     251    <xsl:param name="clTop"/>
     252    <xsl:choose>
     253      <xsl:when test="/page/pageRequest/@action='b' and $clTop=@name">
     254    <b><nobr><font size='+1' color='{$colour-navbar-selected-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></xsl:when>
     255      <xsl:otherwise>
     256    <a style="text-decoration:none" href="{$library_name}?a=b&amp;rt=r&amp;s=ClassifierBrowse&amp;c={$collName}&amp;cl={@name}"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute><b><nobr><font size='+1' color='{$colour-navbar-link-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></a>
     257      </xsl:otherwise>
     258    </xsl:choose>
     259  </xsl:template>
     260
     261  <xsl:template name="dividerBar">
     262    <xsl:param name='text'/>
     263    <br/><table width='537' border="0" cellpadding="0" cellspacing="0">
     264      <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b>&#160;<xsl:value-of select='$text'/></b></font></td></tr></table><br/>
     265  </xsl:template>
     266 
    232267  <xsl:attribute-set name="body-style">
    233268    <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
     
    238273    <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute>
    239274  </xsl:attribute-set>
    240    
    241   <!-- this should probably use a greenstone image rather than nzdl image -->
     275
     276  <xsl:attribute-set name="td-brownbutton">
     277    <xsl:attribute name='background'>interfaces/default/images/brownbutton.gif</xsl:attribute>
     278    <xsl:attribute name='height'>20</xsl:attribute>
     279    <xsl:attribute name='align'>center</xsl:attribute>
     280  </xsl:attribute-set>
     281 
     282  <xsl:attribute-set name="td-brownbutton-off">
     283    <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute>
     284    <xsl:attribute name='height'>20</xsl:attribute>
     285    <xsl:attribute name='align'>center</xsl:attribute>
     286  </xsl:attribute-set>
     287 
     288  <xsl:attribute-set name="td-navbar">
     289    <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute>
     290    <xsl:attribute name='height'>20</xsl:attribute>
     291    <xsl:attribute name='align'>center</xsl:attribute>
     292  </xsl:attribute-set>
     293
    242294  <xsl:template name="nzdlPageBanner">
    243295    <center>
     
    257309      </table>
    258310    </center>
    259    
    260     <!-- end of page banner -->
    261    
     311    <!-- end of page banner --> 
    262312  </xsl:template>
    263313
     
    269319  </xsl:template>
    270320 
    271 
    272   <xsl:template name="iconblankbar">
    273     <p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>
    274   </xsl:template>
    275  
    276321  <xsl:template name="imagegreenstone">
    277322    <img src="interfaces/nzdl/images/gsdl.gif" width="140" height="77" border="0" hspace='0'><xsl:attribute name='alt'><xsl:call-template name='textimagegreenstone'/></xsl:attribute></img>
    278323  </xsl:template>
    279324 
    280 
    281325  <!-- Display the appropriate image, depending on the node type -->
    282326  <xsl:template match="documentNode" mode="displayNodeIcon">
Note: See TracChangeset for help on using the changeset viewer.