Changeset 37469
- Timestamp:
- 2023-03-13T10:08:53+13:00 (11 days ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default/transform
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/gslib.xsl
r37410 r37469 419 419 <xsl:template name="webswingGLILink"> 420 420 <div class="paramLabel"> 421 <a href=" /webswing-server/gli"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'webswinggli.title')"/></a>421 <a href="{$library_name}/page/gli"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'webswinggli.title')"/></a> 422 422 </div> 423 423 <div class="paramValue"> -
main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl
r37448 r37469 19 19 <xsl:param name="cookie_consent"/> 20 20 21 <!-- does this collection allow webswing-based GLI editing? it's turned on by default, can turn off in config file--> 22 <xsl:variable name="isGLIEditingAllowed"> 23 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='allowGLIEditing']) or /page/pageResponse/format[@type='display']/gsf:option[@name='allowGLIEditing']/@value='true'">1</xsl:if> 24 </xsl:variable> 21 25 22 26 <!-- does this collection have editing allowed? it's turned on by default, can turn off in config file--> 23 <xsl:variable name="is EditingAllowed">27 <xsl:variable name="isDocumentEditingAllowed"> 24 28 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='allowDocumentEditing']) or /page/pageResponse/format[@type='display']/gsf:option[@name='allowDocumentEditing']/@value='true'">1</xsl:if> 25 29 </xsl:variable> … … 36 40 <xsl:if test="/page/pageRequest/userInformation and (util:csvContains(/page/pageRequest/userInformation/@groups, 'administrator') or util:csvContains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:csvContains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">1</xsl:if> 37 41 </xsl:variable> 42 38 43 <xsl:variable name="siteAdmin"> 39 44 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'siteAdmin']"/> … … 177 182 </xsl:if> 178 183 179 </xsl:if> 180 <script type="text/javascript" src="interfaces/{$interface_name}/js/debug_scripts.js"><xsl:text> </xsl:text></script> 181 <script type="text/javascript" src="interfaces/{$interface_name}/js/visual-xml-editor.js"><xsl:text> </xsl:text></script> 184 </xsl:if> 185 186 <xsl:variable name="allowGreenbugEditing"><xsl:value-of select="/page/pageResponse/format/gsf:option[@name='allowGreenbugEditing']/@value"/></xsl:variable> 187 188 <xsl:if test="$allowGreenbugEditing != 'false'"> 189 <!-- TLDR: explicitly set this option to false in your collection if you don't want it enabled --> 190 191 <!-- For backwards compatibility, testing this way means that if <gsf:option name="greenbugEnable"/> 192 isn't set at all, then it default to on ... the way things used to work before the option 193 was introduced --> 194 195 <script type="text/javascript" src="interfaces/{$interface_name}/js/debug_scripts.js"><xsl:text> </xsl:text></script> 196 <script type="text/javascript" src="interfaces/{$interface_name}/js/visual-xml-editor.js"><xsl:text> </xsl:text></script> 197 </xsl:if> 198 182 199 </xsl:if> 183 200 … … 497 514 menu.append(settingsLink); 498 515 499 </xsl:text><xsl:if test="/page/pageRequest/@action = 'd' and $is EditingAllowed = '1'"><xsl:text disable-output-escaping="yes">516 </xsl:text><xsl:if test="/page/pageRequest/@action = 'd' and $isDocumentEditingAllowed = '1'"><xsl:text disable-output-escaping="yes"> 500 517 var editingLink = $("<a>") 501 518 .attr("href", "javascript:;"); … … 508 525 .on("click", function() 509 526 { 510 var c_url = gs.xsltParams.library_name + "?a=g&rt=ro&s=ChangeUserEditMode&s1.username=" + gs.userInformation.username + "&s1.enabled=" + ((gs.userInformation.editEnabled == "true") ? "false" : "true");511 $.ajax(c_url)512 .done(function(response)513 {514 //location.reload(true); // need to set docEdit=0 if we have just disabled editing515 location.href= url + (hasQueryString ? "&" : "?") + ((gs.userInformation.editEnabled == "true") ? "docEdit=0&ed=0":"") + (hashPart ? hashPart : "");516 });527 var c_url = gs.xsltParams.library_name + "?a=g&rt=ro&s=ChangeUserEditMode&s1.username=" + gs.userInformation.username + "&s1.enabled=" + ((gs.userInformation.editEnabled == "true") ? "false" : "true"); 528 $.ajax(c_url) 529 .done(function(response) 530 { 531 //location.reload(true); // need to set docEdit=0 if we have just disabled editing 532 location.href= url + (hasQueryString ? "&" : "?") + ((gs.userInformation.editEnabled == "true") ? "docEdit=0&ed=0":"") + (hashPart ? hashPart : ""); 533 }); 517 534 }); 518 535 </xsl:text></xsl:when><xsl:otherwise><xsl:variable name="reason"><xsl:choose><xsl:when test="$isEditingAvailable != '1'"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.error_unavailable')"/></xsl:when><xsl:when test="$userHasEditPermission != '1'"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.error_wrong_group')"/></xsl:when></xsl:choose><xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.error_contact_admin', $siteAdmin)"/></xsl:variable><xsl:text disable-output-escaping="yes"> … … 520 537 .on("click", function() 521 538 { 522 alert("</xsl:text><xsl:value-of select="$reason"/><xsl:text disable-output-escaping='yes'>");523 menu.hide();539 alert("</xsl:text><xsl:value-of select="$reason"/><xsl:text disable-output-escaping='yes'>"); 540 menu.hide(); 524 541 }); 525 542 </xsl:text> … … 527 544 editingLink.append(editingButton); 528 545 menu.append(editingLink); 529 </xsl:text></xsl:if><xsl:text disable-output-escaping="yes"> 546 547 </xsl:text></xsl:if> 548 549 <xsl:if test="$isGLIEditingAllowed = '1'"><xsl:text disable-output-escaping="yes"> 550 var gliLink = $("<a>"); 551 if (gs.cgiParams["c"]) { 552 gliLink.attr("href", gs.xsltParams.library_name + "/collection/"+gs.cgiParams["c"]+"/page/gli"); 553 } 554 else { 555 gliLink.attr("href", gs.xsltParams.library_name + "/page/gli"); 556 } 557 var gliButton = $("<li>") 558 .css("padding", "3px") 559 .html("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'menu.webswing_gli')"/><xsl:text disable-output-escaping="yes">") 560 .addClass("ui-state-default"); 561 gliLink.append(gliButton); 562 menu.append(gliLink); 563 </xsl:text></xsl:if> 564 565 <xsl:text disable-output-escaping="yes"> 530 566 531 567 // Need to check for the situation where the user immediately logs out, having just logged in -
main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
r37409 r37469 46 46 47 47 <xsl:variable name="canDoEditing"> 48 <xsl:if test="$is EditingAllowed = '1' and (/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>48 <xsl:if test="$isDocumentEditingAllowed = '1' and (/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> 49 49 </xsl:variable> 50 50 <xsl:variable name="editingTurnedOn"> -
main/trunk/greenstone3/web/interfaces/default/transform/pages/home.xsl
r37019 r37469 69 69 --> 70 70 71 <!--72 71 <gslib:webswingGLILink/><br/><br/> 73 -->74 72 75 73 <gslib:aboutGreenstoneLink/><br/>
Note:
See TracChangeset
for help on using the changeset viewer.