diff --git a/core/src/plugins/action.share/class.ShareCenter.php b/core/src/plugins/action.share/class.ShareCenter.php index 9d1b69fa32..4160832488 100644 --- a/core/src/plugins/action.share/class.ShareCenter.php +++ b/core/src/plugins/action.share/class.ShareCenter.php @@ -907,29 +907,35 @@ public function nodeSharedMetadata(&$ajxpNode) */ public function updateNodeSharedData($oldNode=null, $newNode=null, $copy = false){ - if($oldNode != null && !$copy){ - $this->logDebug("Should update node"); + if($oldNode == null || $copy){ + // Create or copy, do nothing + return; + } + if($oldNode != null && $newNode != null && $oldNode->getUrl() == $newNode->getUrl()){ + // Same path => must be a content update, do nothing + return; + } - $delete = false; - if($newNode == null) { + $this->logDebug("Should update node"); + $delete = false; + if($newNode == null) { + $delete = true; + }else{ + $repo = $newNode->getRepository(); + $recycle = $repo->getOption("RECYCLE_BIN"); + if(!empty($recycle) && strpos($newNode->getPath(), $recycle) === 1){ $delete = true; - }else{ - $repo = $newNode->getRepository(); - $recycle = $repo->getOption("RECYCLE_BIN"); - if(!empty($recycle) && strpos($newNode->getPath(), $recycle) === 1){ - $delete = true; - } - } - $shareStore = $this->getShareStore(); - $modifiedNodes = $shareStore->moveSharesFromMetaRecursive($oldNode, $delete, $oldNode->getPath(), ($newNode != null ? $newNode->getPath() : null)); - // Force switching back to correct driver! - if($modifiedNodes > 0){ - $oldNode->getRepository()->driverInstance = null; - $oldNode->setDriver(null); - $oldNode->getDriver(); } - return; } + $shareStore = $this->getShareStore(); + $modifiedNodes = $shareStore->moveSharesFromMetaRecursive($oldNode, $delete, $oldNode->getPath(), ($newNode != null ? $newNode->getPath() : null)); + // Force switching back to correct driver! + if($modifiedNodes > 0){ + $oldNode->getRepository()->driverInstance = null; + $oldNode->setDriver(null); + $oldNode->getDriver(); + } + return; } diff --git a/core/src/plugins/action.share/res/i18n/ca.php b/core/src/plugins/action.share/res/i18n/ca.php index 0c9f727a6f..55274f3cdd 100644 --- a/core/src/plugins/action.share/res/i18n/ca.php +++ b/core/src/plugins/action.share/res/i18n/ca.php @@ -82,6 +82,7 @@ "72" => "Cercar i previsualitzar", "73" => "Descarregar", "74" => "Carregar fitxers", +"74b"=>"Edit", "75" => "Per favor emprau un nombre positiu tant per la caducitat com per el límit de descàrrega.", "76" => "Per favor habilitau les Cookies per a accedir a aquesta aplicació", "77" => "Per favor habilitau JavaScript per a accedir a aquesta aplicació", diff --git a/core/src/plugins/action.share/res/i18n/de.php b/core/src/plugins/action.share/res/i18n/de.php index 0c313d89cb..556b090087 100644 --- a/core/src/plugins/action.share/res/i18n/de.php +++ b/core/src/plugins/action.share/res/i18n/de.php @@ -83,6 +83,7 @@ "72" => "Ansehen", "73" => "Herunterladen", "74" => "Hochladen", +"74b"=>"Edit", "75"=> "Bitte verwenden Sie eine positive Zahl für die Verfall- und Downloadbegrenzung.", "76"=> "Bitte Cookies aktivieren um auf diese Anwendung zuzugreifen", "77"=> "Bitte JavaScript aktivieren um auf diese Anwendung zuzugreifen", diff --git a/core/src/plugins/action.share/res/i18n/en.php b/core/src/plugins/action.share/res/i18n/en.php index 653f09b32e..757851903e 100644 --- a/core/src/plugins/action.share/res/i18n/en.php +++ b/core/src/plugins/action.share/res/i18n/en.php @@ -83,6 +83,7 @@ "72"=> "Preview", "73"=> "Download", "74"=> "Upload files", + "74b"=>"Edit", "75"=> "Please use a positive number for both Expiration and Download limit fields.", "76"=> "Please enable Cookies to access this application", "77"=> "Please enable JavaScript to access this application", diff --git a/core/src/plugins/action.share/res/i18n/es.php b/core/src/plugins/action.share/res/i18n/es.php index e74dc2a607..4a0182c030 100644 --- a/core/src/plugins/action.share/res/i18n/es.php +++ b/core/src/plugins/action.share/res/i18n/es.php @@ -80,6 +80,7 @@ "72"=> "Previsualizar", "73"=> "Descargar", "74"=> "Cargar", +"74b"=>"Edit", "75"=> "Por favor use un número positivo para Caducidad y Límite de Descargas.", "76"=> "Por favor, habilite las cookies para acceder a esta aplicación", "77"=> "Por favor, habilite JavaScript para acceder a esta aplicación", diff --git a/core/src/plugins/action.share/res/i18n/fr.php b/core/src/plugins/action.share/res/i18n/fr.php index 777d73cba9..8d631b1c87 100644 --- a/core/src/plugins/action.share/res/i18n/fr.php +++ b/core/src/plugins/action.share/res/i18n/fr.php @@ -82,6 +82,7 @@ "72"=> "Prévisualiser", "73"=> "Télécharger", "74"=> "Envoyer", +"74b"=>"Editer", "75"=> "Veuillez utiliser des entiers positifs pour les champs Expiration et Nombre de téléchargements !", "76"=> "Merci d'activer les cookies pour accéder à cette application", "77"=> "Merci d'activer JavaScript pour accéder à cette application", diff --git a/core/src/plugins/action.share/res/i18n/it.php b/core/src/plugins/action.share/res/i18n/it.php index 55c4c81005..27b097e393 100644 --- a/core/src/plugins/action.share/res/i18n/it.php +++ b/core/src/plugins/action.share/res/i18n/it.php @@ -81,6 +81,7 @@ "72"=> "Sfoglia & Anteprima", "73"=> "Download", "74"=> "Upload file", + "74b"=>"Edit", "75"=> "Usare un numero positivo sia per la Scadenza che per il limite di Download.", "76"=> "Abilitare i Cookies per accedere a questa applicazione", "77"=> "Abilitare JavScript per accedere a questa applicazione", diff --git a/core/src/plugins/action.share/res/i18n/pt.php b/core/src/plugins/action.share/res/i18n/pt.php index f06914644f..d10f07eb72 100644 --- a/core/src/plugins/action.share/res/i18n/pt.php +++ b/core/src/plugins/action.share/res/i18n/pt.php @@ -80,6 +80,7 @@ "72"=> "Navegar & Pré-Visualização", "73"=> "Transferir", "74"=> "Enviar ficheiros", +"74b"=>"Edit", "75"=> "Por favor utilize um número positivo tanto para o campo Validade como para o Limite Máximo de Transferências.", "76"=> "Por favor active as cookies no seu Navegador para poder aceder a esta aplicação", "77"=> "Por favor active o Javascript no seu Navegador para aceder a esta aplicação", diff --git a/core/src/plugins/action.share/res/i18n/ru.php b/core/src/plugins/action.share/res/i18n/ru.php index 067b69e6de..7bd6febe28 100644 --- a/core/src/plugins/action.share/res/i18n/ru.php +++ b/core/src/plugins/action.share/res/i18n/ru.php @@ -83,6 +83,7 @@ "72"=> "Предпросмотр", "73"=> "Скачивание", "74"=> "Загрузка файлов", + "74b"=>"Edit", "75"=> "Используйте положительные значения для срока окончания и количества скачиваний.", "76"=> "Включите куки для работы с программой", "77"=> "Включите JavaScript для работы с программой", diff --git a/core/src/plugins/action.share/res/react/ShareDialog.js b/core/src/plugins/action.share/res/react/ShareDialog.js index be5115032f..47300bb246 100644 --- a/core/src/plugins/action.share/res/react/ShareDialog.js +++ b/core/src/plugins/action.share/res/react/ShareDialog.js @@ -997,6 +997,11 @@ NAME:'write', LABEL:this.context.getMessage('74') }); + }else if(this.props.shareModel.fileHasWriteableEditors()){ + perms.push({ + NAME:'write', + LABEL:this.context.getMessage('74b') + }); } if(this.props.shareModel.isPublicLinkPreviewDisabled() && this.props.shareModel.getPublicLinkPermission(linkId, 'read')){ previewWarning =
{this.context.getMessage('195')}
; diff --git a/core/src/plugins/action.share/res/react/model/ShareModel.js b/core/src/plugins/action.share/res/react/model/ShareModel.js index 6c2cbab2c7..95e168f73f 100644 --- a/core/src/plugins/action.share/res/react/model/ShareModel.js +++ b/core/src/plugins/action.share/res/react/model/ShareModel.js @@ -63,6 +63,13 @@ return this._data['links'][linkId]['hash_is_shorten']; } + fileHasWriteableEditors(){ + console.log(this._previewEditors); + return this._previewEditors.filter(function(entry){ + return (entry.canWrite); + }).length > 0; + } + togglePublicLink(){ var publicLinks = this.getPublicLinks(); this._pendingData['enable_public_link'] = !publicLinks.length; diff --git a/core/src/plugins/core.ajaxplorer/ajxp_registry.xsd b/core/src/plugins/core.ajaxplorer/ajxp_registry.xsd index 9578bdcf3b..2eecee5ee9 100644 --- a/core/src/plugins/core.ajaxplorer/ajxp_registry.xsd +++ b/core/src/plugins/core.ajaxplorer/ajxp_registry.xsd @@ -302,6 +302,7 @@ + diff --git a/core/src/plugins/editor.ckeditor/manifest.xml b/core/src/plugins/editor.ckeditor/manifest.xml index a0e2cfdf22..89b449a13c 100644 --- a/core/src/plugins/editor.ckeditor/manifest.xml +++ b/core/src/plugins/editor.ckeditor/manifest.xml @@ -1,7 +1,7 @@ diff --git a/core/src/plugins/editor.codemirror/manifest.xml b/core/src/plugins/editor.codemirror/manifest.xml index 21d030d779..5617f787ce 100644 --- a/core/src/plugins/editor.codemirror/manifest.xml +++ b/core/src/plugins/editor.codemirror/manifest.xml @@ -1,5 +1,5 @@ - + diff --git a/core/src/plugins/editor.codepress/manifest.xml b/core/src/plugins/editor.codepress/manifest.xml index e7a4f0ed17..9c0eed9773 100644 --- a/core/src/plugins/editor.codepress/manifest.xml +++ b/core/src/plugins/editor.codepress/manifest.xml @@ -1,5 +1,5 @@ - + Charles du Jeu diff --git a/core/src/plugins/editor.etherpad/manifest.xml b/core/src/plugins/editor.etherpad/manifest.xml index 324bcd8054..10b11d90c9 100644 --- a/core/src/plugins/editor.etherpad/manifest.xml +++ b/core/src/plugins/editor.etherpad/manifest.xml @@ -1,6 +1,6 @@ diff --git a/core/src/plugins/editor.pixlr/manifest.xml b/core/src/plugins/editor.pixlr/manifest.xml index 8dc2ea5fa4..22bebf48d2 100644 --- a/core/src/plugins/editor.pixlr/manifest.xml +++ b/core/src/plugins/editor.pixlr/manifest.xml @@ -1,5 +1,5 @@ - + - + diff --git a/core/src/plugins/editor.zoho/manifest.xml b/core/src/plugins/editor.zoho/manifest.xml index 45a675184d..1068532f93 100644 --- a/core/src/plugins/editor.zoho/manifest.xml +++ b/core/src/plugins/editor.zoho/manifest.xml @@ -1,5 +1,5 @@ - + diff --git a/core/src/plugins/gui.ajax/res/js/es6/model/Registry.es6 b/core/src/plugins/gui.ajax/res/js/es6/model/Registry.es6 index db55ff8f05..3a86e3c930 100644 --- a/core/src/plugins/gui.ajax/res/js/es6/model/Registry.es6 +++ b/core/src/plugins/gui.ajax/res/js/es6/model/Registry.es6 @@ -146,7 +146,8 @@ class Registry{ icon_class : xmlNode.getAttribute("iconClass"), editorClass : xmlNode.getAttribute("className"), mimes : xmlNode.getAttribute("mimes").split(","), - write : (xmlNode.getAttribute("write") && xmlNode.getAttribute("write")=="true"?true:false) + write : (xmlNode.getAttribute("write") && xmlNode.getAttribute("write")=="true"?true:false), + canWrite: (xmlNode.getAttribute("canWrite") && xmlNode.getAttribute("canWrite")=="true"?true:false) }; for(var k in properties){ if(properties.hasOwnProperty(k)){