Changeset 29166

Show
Ignore:
Timestamp:
31.07.2014 12:06:06 (5 years ago)
Author:
kjdon
Message:

in metaTableCell, don't want to use disable-output-escaping=yes, as we want to see eg the html for the image link, rather than actually putting in a link to the image. Don't want to have to force dt=hierarchy when editing. removed that fro the edit content link. Then in documentContent, if we are editing, then do the wrappedTemplate type stuff, (but select the particular choice from wrappedDocument). Then we can do editing for a simple document without viewing the table of contents

Files:
1 modified

Legend:

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

    r28622 r29166  
    206206                            <tr> 
    207207                                <td class="metaTableCellName"><xsl:value-of select="@name"/></td> 
    208                                 <td class="metaTableCell"><xsl:value-of disable-output-escaping="yes" select="."/></td> 
     208                                <td class="metaTableCell"><xsl:value-of select="."/></td> 
    209209                            </tr> 
    210210                        </xsl:if> 
     
    232232    <!-- the page content --> 
    233233    <xsl:template match="/page/pageResponse/document"> 
    234         <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))"> 
     234      <xsl:variable name="canDoEditing"> 
     235        <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">true</xsl:if> 
     236      </xsl:variable> 
     237      <xsl:if test="$canDoEditing = 'true'"> 
    235238            <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script> 
    236239            <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_util.js"><xsl:text> </xsl:text></script> 
     
    296299                    </xsl:text> 
    297300                </script> 
     301            </xsl:when> 
     302            <!-- we want to do this stuff even if docType is simple or paged. Don't want to just set dt=hierarchy as that gives other unnecessary stuff--> 
     303            <!-- This is the first choice from wrappedDocument template--> 
     304            <xsl:when test="$canDoEditing = 'true' and /page/pageRequest/paramList/param[@name='docEdit']/@value = '1'"> 
     305                <div id="gs-document"> 
     306                  <xsl:call-template name="documentPre"/> 
     307                  <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** --> 
     308                    <xsl:for-each select="documentNode"> 
     309                      <xsl:call-template name="wrapDocumentNodes"/> 
     310                    </xsl:for-each> 
     311                  </div> 
     312                </div> 
    298313            </xsl:when> 
    299314            <xsl:when test="@docType='simple'"> 
     
    410425                                </xsl:choose> 
    411426                                <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')"> 
    412                                     <xsl:text>?ed=1&amp;docEdit=1&amp;dt=hierarchy</xsl:text> 
     427                                    <xsl:text>?ed=1&amp;docEdit=1</xsl:text> 
    413428                                </xsl:if> 
    414429                            </xsl:attribute>