Ignore:
Timestamp:
2017-03-23T12:20:18+13:00 (7 years ago)
Author:
kjdon
Message:

removed unused stuff. no longer test on nodeContent when working out what node image to use in toc, as there will be no nodeContent as we use ec=1 for toc. expand and contract document links now in their own div, own template

File:
1 edited

Legend:

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

    r31523 r31535  
    7777                    <div id="contentsArea">
    7878                        <!-- show the berry basket if it's turned on -->
    79                         <gslib:berryBasket/>
    80 
    81                         <!-- the contents (if enabled) -->
     79                        <xsl:call-template name="berryBasket"/>
     80                        <!-- add in expand and contract document links -->
     81                        <xsl:call-template name="expandContractDocumentLinks"/>
     82                        <!-- dynamically get the contents (if enabled) -->
    8283                        <xsl:choose>
    8384                            <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
     
    9394                                    </xsl:text>
    9495                                </script>
     96                               
    9597                                <div id="tableOfContents"><xsl:text> </xsl:text></div>
    9698                                <div id="tocLoadingImage" style="text-align:center;">
     
    101103                                  <a href="javascript:extractFilteredPagesToOwnDocument();"><button id="extractDocButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.extract_pages')"/></button></a>
    102104                                </xsl:if>
    103                                  
    104                             <!--    <table style="width:100%;"><tbody><tr>
    105                                     <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.filter_pages')"/><xsl:text>: </xsl:text><input id="filterText" type="text"/></td>
    106                                 </tr>
    107                                 <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true'">
    108                                     <tr><td><a href="javascript:extractFilteredPagesToOwnDocument();"><button id="extractDocButton">Extract these pages to document</button></a></td></tr>
    109                                 </xsl:if>
    110                                 </tbody></table>-->
    111105                            </xsl:when>
    112106                            <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageRequest/paramList/param[@name = 'ec']/@value = '1')">
     
    126120                            </xsl:when>
    127121                            <xsl:otherwise>
    128                               <xsl:variable name="doc_url"><xsl:value-of select='$library_name'/>/collection/<xsl:value-of select='/page/pageResponse/collection/@name'/>/document/<xsl:value-of select='/page/pageResponse/document/documentNode/@nodeID'/>?<xsl:if test="/page/pageRequest/paramList/param[@name='p.s']">p.s=<xsl:value-of select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>&amp;</xsl:if></xsl:variable>
     122                             
    129123                                <div id="tableOfContents">
    130                                     <xsl:attribute name="class">
     124                                  <!-- if ed=1 or ec=1 then we have the complete section hierarchy in the page xml source, so we don't need an ajax call to get the table of contents, we just generate it from the list of nodes -->
     125                                    <xsl:attribute name="class"> <!-- do we ever need this ?? -->
    131126                                        <xsl:choose>
    132127                                            <xsl:when test="count(//documentNode) > 1">visible</xsl:when>
     
    134129                                        </xsl:choose>
    135130                                    </xsl:attribute>
    136                                     <table style="width:100%; text-align:center;"><tr><td><a href="{$doc_url}ed=1"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc')"/></a></td><td><a href="{$doc_url}ed=0"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.collapse_doc')"/></a></td></tr></table>
    137131                                    <xsl:for-each select="documentNode">
    138132                                        <xsl:call-template name="documentNodeTOC"/>
     
    150144    <!-- This template is used to display the table of contents -->
    151145    <xsl:template name="documentNodeTOC">
    152 
    153         <!-- check if this is the currently selected table of contents item -->
    154         <xsl:variable name="isCurrent" select="nodeContent"/>
    155 
    156         <!-- formulate the link -->
    157         <xsl:variable name="contentsLink">
    158             <xsl:value-of select='$library_name'/>?a=d&amp;c=<gslib:collectionNameShort/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1
    159         </xsl:variable>
    160 
    161146        <ul>
    162147            <table><tr>
     
    165150                    <td>
    166151                        <xsl:choose>
    167                             <xsl:when test="not(nodeContent and not(documentNode))">
     152                            <xsl:when test="documentNode">
    168153                                <img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
    169154                                    <xsl:attribute name="src">
     
    189174                <td>
    190175                    <img>
    191                         <xsl:if test="nodeContent and not(documentNode)">
     176                        <xsl:if test="not(documentNode)">
    192177                            <xsl:attribute name="class">leafNode</xsl:attribute>
    193178                        </xsl:if>
     
    195180                        <xsl:attribute name="src">
    196181                            <xsl:choose>
    197                                 <xsl:when test="nodeContent and not(documentNode)">
     182                                <xsl:when test="not(documentNode)">
    198183                                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/>
    199184                                </xsl:when>
Note: See TracChangeset for help on using the changeset viewer.