Changeset 30559

Show
Ignore:
Timestamp:
02.06.2016 14:33:04 (3 years ago)
Author:
kjdon
Message:

handling to add navigationTabs into the navigation bar

Files:
1 modified

Legend:

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

    r30478 r30559  
    156156    </xsl:template> 
    157157     
     158    <xsl:template name="additionalNavTabs"> 
     159      <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/extraInfo/navigationTab"> 
     160        <li> 
     161          <xsl:choose> 
     162        <!-- if we are in frame type and this is the current page, colour it differently--> 
     163        <xsl:when test="@type='frame' and /page/pageRequest[@subaction='html'] and /page/pageRequest/paramList/param[@name='url']/@value = @url"> 
     164          <xsl:attribute name='class'>ui-state-default ui-corner-top ui-tabs-selected ui-state-active</xsl:attribute> 
     165        </xsl:when> 
     166        <xsl:otherwise> 
     167          <xsl:attribute name="class">ui-state-default ui-corner-top</xsl:attribute> 
     168        </xsl:otherwise> 
     169          </xsl:choose> 
     170          <a> 
     171        <xsl:if test="displayItem[@name='description']"> 
     172          <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute> 
     173        </xsl:if> 
     174        <xsl:choose> 
     175          <xsl:when test="@type='external-link'"> 
     176            <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute> 
     177          </xsl:when> 
     178          <xsl:when test="@type='frame'"> 
     179            <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/page/html?url=<xsl:value-of select="@url"/></xsl:attribute> 
     180          </xsl:when> 
     181        </xsl:choose> 
     182        <xsl:choose> 
     183          <xsl:when test="displayItem[@name='name']"> 
     184            <xsl:value-of select="displayItem[@name='name']"/> 
     185          </xsl:when> 
     186          <xsl:otherwise>link</xsl:otherwise> 
     187        </xsl:choose> 
     188          </a> 
     189        </li> 
     190      </xsl:for-each> 
     191       
     192    </xsl:template> 
    158193    <!-- ***** BROWSING TABS ***** --> 
    159194    <xsl:template name="browsing-tabs"> 
    160         <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service"> 
     195        <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service or /page/pageResponse/collection[@name=$collNameChecked]/extraInfo/navigationTab"> 
    161196            <ul id="gs-nav"> 
     197              <!-- if this collection has additional tabs, add them here --> 
     198              <xsl:call-template name="additionalNavTabs"/> 
    162199                <!-- If this collection has a ClassifierBrowse service then add a tab for each classifier--> 
    163200                <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='browse' and @name='ClassifierBrowse']">