Changeset 25144

Show
Ignore:
Timestamp:
24.02.2012 13:50:39 (8 years ago)
Author:
sjm84
Message:

The document editor functionality can no longer be used if you are not authorised to use it

Location:
main/trunk/greenstone3/web/interfaces/oran/transform
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/oran/transform/pages/classifier.xsl

    r24997 r25144  
    2727         
    2828        <!-- this right sidebar --> 
    29         <xsl:if test="$berryBasketOn or $documentBasketOn"> 
     29        <xsl:if test="$berryBasketOn or ($documentBasketOn 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)))"> 
    3030            <div id="rightSidebar"> 
    3131                <xsl:if test="$berryBasketOn"> 
  • main/trunk/greenstone3/web/interfaces/oran/transform/pages/document.xsl

    r25143 r25144  
    100100             
    101101            <div id="doc{@nodeID}" class="sectionContainer"><!-- *** --> 
    102                 <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on'"> 
     102                <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on' and /page/pageRequest/userInformation 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))"> 
    103103                    <table id="meta{@nodeID}"> 
    104104                        <xsl:attribute name="style"> 
     
    137137    <!-- the page content --> 
    138138    <xsl:template match="/page/pageResponse/document"> 
    139         <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on'"> 
     139        <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on' and /page/pageRequest/userInformation 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))"> 
    140140            <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script> 
    141141            <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_util.js"><xsl:text> </xsl:text></script> 
    142         </xsl:if> 
    143          
    144         <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on'"> 
    145142            <gsf:metadata name="all"/> 
    146143        </xsl:if> 
     
    165162            <xsl:call-template name="documentBerryForDocumentPage"/> 
    166163             
    167             <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on'"> 
     164            <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on' and /page/pageRequest/userInformation 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))"> 
    168165                <table style="width:100%"><tr> 
    169166                    <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td> 
  • main/trunk/greenstone3/web/interfaces/oran/transform/pages/documentbasket.xsl

    r25142 r25144  
    2121    <!-- the page content --> 
    2222    <xsl:template match="/page"> 
    23         <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script> 
    24         <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_dd.js"><xsl:text> </xsl:text></script> 
    25         <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_util.js"><xsl:text> </xsl:text></script> 
    26         <script type="text/javascript">YAHOO.util.Event.onDOMReady(initDocumentMaker);</script> 
     23        <!-- Make sure the user is allowed to use this functionality --> 
     24        <xsl:if test="/page/pageRequest/userInformation 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))"> 
     25            <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script> 
     26            <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_dd.js"><xsl:text> </xsl:text></script> 
     27            <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_util.js"><xsl:text> </xsl:text></script> 
     28            <script type="text/javascript">YAHOO.util.Event.onDOMReady(initDocumentMaker);</script> 
    2729 
    28         <link src="interfaces/{$interface_name}/style/documentbasket.js"/> 
    29         <xsl:for-each select="//item"> 
    30             <a class="dbdoc"> 
    31                 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;dt=hierarchy&amp;d=<xsl:value-of select="@name"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;ed=1</xsl:attribute> 
    32                 <xsl:value-of select="@title"/> 
    33             </a> 
    34         </xsl:for-each> 
     30            <link src="interfaces/{$interface_name}/style/documentbasket.js"/> 
     31            <xsl:for-each select="//item"> 
     32                <a class="dbdoc"> 
     33                    <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;dt=hierarchy&amp;d=<xsl:value-of select="@name"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;ed=1</xsl:attribute> 
     34                    <xsl:value-of select="@title"/> 
     35                </a> 
     36            </xsl:for-each> 
     37        <xsl:if> 
    3538    </xsl:template> 
    3639 
  • main/trunk/greenstone3/web/interfaces/oran/transform/pages/pref.xsl

    r25123 r25144  
    180180                 
    181181                <!-- document maker --> 
    182                 <div id="documentmakerprefs"> 
    183                     <xsl:variable name="documentbasket"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='documentbasket']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='documentbasket']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable> 
    184                     <div class="paramLabel">Document basket</div> 
    185                     <div class="paramValue"> 
    186                         <select name="documentbasket"> 
    187                             <option value="on"><xsl:if test="$documentbasket='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option>  
    188                             <option value="off"><xsl:if test="$documentbasket='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option> 
    189                         </select> 
    190                     </div> 
    191                     <br class="clear"/> 
    192                 </div> 
     182                <xsl:if test="/page/pageRequest/userInformation 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))"> 
     183                    <div id="documentmakerprefs"> 
     184                        <xsl:variable name="documentbasket"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='documentbasket']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='documentbasket']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable> 
     185                        <div class="paramLabel">Document basket</div> 
     186                        <div class="paramValue"> 
     187                            <select name="documentbasket"> 
     188                                <option value="on"><xsl:if test="$documentbasket='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option>  
     189                                <option value="off"><xsl:if test="$documentbasket='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option> 
     190                            </select> 
     191                        </div> 
     192                        <br class="clear"/> 
     193                    </div> 
     194                </xsl:if> 
    193195 
    194196                <!-- tidy (?) --> 
  • main/trunk/greenstone3/web/interfaces/oran/transform/util.xsl

    r25071 r25144  
    2929  <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/> 
    3030  <xsl:variable name="documentBasketOn" select="/page/pageRequest/paramList/param[@name='documentbasket' and @value='on']"/> 
     31   
     32    <xsl:variable name="thisCollectionEditor"> 
     33        <xsl:value-of select="/page/pageRequest/paramList/param[@name = 'c']/@value"/> 
     34        <xsl:text>-collection-editor</xsl:text> 
     35    </xsl:variable> 
    3136   
    3237  <!-- template to get the name of the current collection --> 
     
    543548    <!-- put the drag&drop document basket on the page --> 
    544549    <xsl:template name="documentBasket"> 
    545         <xsl:if test="$documentBasketOn"> 
     550        <xsl:if test="$documentBasketOn and /page/pageRequest/userInformation 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))"> 
    546551            <div id="documentbasket" class="hide"> 
    547552                <span>Document Basket</span>