Changeset 37084


Ignore:
Timestamp:
2023-01-02T00:13:12+13:00 (5 weeks ago)
Author:
davidb
Message:

Templates and vars move into their '-core.xsl' counterparts

Location:
main/trunk/greenstone3/web/interfaces/default/transform
Files:
2 edited

Legend:

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

    r37078 r37084  
    1212  <xsl:include href="../javascript-global-setup.xsl"/>
    1313
     14  <xsl:include href="../javascript-global-setup.xsl"/>
     15
     16  <xsl:include href="header-core.xsl"/>
     17 
     18
    1419  <xsl:param name="cookie_consent"/>
    1520 
    16   <!-- If the c parameter is empty then use the p.c parameter for the collection name-->
    17   <xsl:variable name="collNameChecked">
    18     <xsl:choose>
    19       <xsl:when test="$collName = '' and /page/pageRequest/paramList/param[@name='p.c']/@value">
    20     <xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/>
    21       </xsl:when>
    22       <xsl:otherwise>
    23     <xsl:value-of select="$collName"/>
    24       </xsl:otherwise>
    25     </xsl:choose>
    26   </xsl:variable>
    27 
     21 
    2822  <!-- does this collection have editing allowed? it's turned on by default, can turn off in config file-->
    2923  <xsl:variable name="isEditingAllowed">
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl

    r37069 r37084  
    1616    <xsl:import href="layouts/usercomments.xsl"/>
    1717
    18     <!-- We technically need this include. However, it is imported with toc.xsl -->
     18    <!-- We technically need this include. However, it is already imported with toc.xsl -->
    1919    <!-- <xsl:include href="document-shared.xsl" /> -->
    2020
    21     <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
     21    <xsl:include href="pages/document-core.xsl" />
     22   
    2223
    2324    <!--
     
    8889        </xsl:choose>
    8990    </xsl:template>
    90    
    91     <xsl:template name="documentHeading">
    92       <span style="font-weight:bold; font-size: 120%;">
    93         <xsl:call-template name="choose-title"/>
    94       </span>
    95     </xsl:template>
    96 
    97     <!-- content of a simple document. Will not be used for editing mode -->
    98     <xsl:template name="documentContent">
    99       <div id="gs-document">
    100         <xsl:call-template name="documentPre"/>
    101         <xsl:call-template name="wrappedSectionImage"/>
    102         <div id="gs-document-text">
    103           <xsl:call-template name="documentNodeText"/>
    104         </div>
    105         <xsl:call-template name="documentPost"/>
    106       </div>
    107     </xsl:template>
    108 
    109     <!-- For symmetry reasons, companion template to wrappedDocumentTopLevel -->
    110     <xsl:template name="documentContentTopLevel">
    111       <xsl:call-template name="documentContent"/>
    112     </xsl:template>
    113    
    114     <xsl:template name="topLevelSectionContent">
    115         <xsl:call-template name="wrappedSectionImage"/>
    116         <xsl:call-template name="wrappedSectionText"/>
    117     </xsl:template>
    118    
    119     <xsl:template name="sectionContent">
    120         <xsl:call-template name="wrappedSectionImage"/>
    121         <xsl:call-template name="wrappedSectionText"/>
    122     </xsl:template>
     91
     92    <!-- **** Rules for document-core.xsl taken from here -->
    12393    <xsl:template name="sectionContentForEditing">
    12494        <xsl:call-template name="wrappedSectionImage"/>
     
    136106    </xsl:template>
    137107
    138     <xsl:template name="wrappedSectionText">
    139       <!-- <br /><br /> --> <!-- **** better to do with CSS .setionText -->
    140      
    141         <div id="text{@nodeID}" class="sectionText"><!-- *** -->
    142             <xsl:attribute name="style">
    143                 <xsl:choose>
    144                     <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
    145                         <xsl:text>display:none;</xsl:text>
    146                     </xsl:when>
    147                     <xsl:otherwise>
    148                         <xsl:text>display:block;</xsl:text>
    149                     </xsl:otherwise>
    150                 </xsl:choose>
    151             </xsl:attribute>
    152             <xsl:call-template name="documentNodeText"/>
    153         </div>
    154     </xsl:template>
    155    
    156     <xsl:template name="sectionImage">
    157         <gsf:image type="screen"/>
    158     </xsl:template>
    159    
    160108    <!-- Used to make sure that regardless what the collection designer uses for the title and content we can wrap it properly -->
    161109    <!-- If editing, be aware that the Document Basket looks for specific classes that this template bakes in (key points marked with ***) -->
Note: See TracChangeset for help on using the changeset viewer.