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 =