diff --git a/core/src/plugins/access.ajxp_home/home.css b/core/src/plugins/access.ajxp_home/home.css index 9783fe7658..350fa44c54 100644 --- a/core/src/plugins/access.ajxp_home/home.css +++ b/core/src/plugins/access.ajxp_home/home.css @@ -194,7 +194,7 @@ div.legend_visible div#logo_div{ text-align: left; padding: 32px 0; margin: 0 30px; - border-bottom: 1px solid #555; + border-bottom: 1px solid #ddd; font-size: 1.3em; font-weight: normal; } diff --git a/core/src/plugins/action.share/class.ShareCenter.js b/core/src/plugins/action.share/class.ShareCenter.js index 43564b686d..eec9e575f3 100644 --- a/core/src/plugins/action.share/class.ShareCenter.js +++ b/core/src/plugins/action.share/class.ShareCenter.js @@ -25,6 +25,29 @@ Class.create("ShareCenter", { _currentFolderWatchValue:false, _dataModel:null, + initialize: function(){ + document.observe("ajaxplorer:afterApply-delete", function(){ + try{ + var u = ajaxplorer.getContextHolder().getUniqueNode(); + if(u.getMetadata().get("ajxp_shared")){ + var leaf = u.isLeaf(); + var f = $("generic_dialog_box").down("#delete_message"); + if(!f.down("#share_delete_alert")){ + var message; + if(u.isLeaf()){ + message = MessageHash["share_center.158"]; + }else{ + message = MessageHash["share_center.157"]; + } + f.insert("
"+message+"
"); + } + } + }catch(e){ + if(console) console.log(e); + } + }); + }, + performShareAction : function(dataModel){ var userSelection; if(dataModel){ @@ -35,11 +58,7 @@ Class.create("ShareCenter", { } this.currentNode = userSelection.getUniqueNode(); this.shareFolderMode = "workspace"; - if(this.currentNode.getMetadata().get('share_data')) { - this.readonlyMode = true; - }else{ - this.readonlyMode = false; - } + this.readonlyMode = this.currentNode.getMetadata().get('share_data') ? true : false; if(( userSelection.hasDir() && !userSelection.hasMime($A(['ajxp_browsable_archive']))) || userSelection.isMultiple() || (this.currentNode.getMetadata().get('share_data') && !this.currentNode.getMetadata().get('share_link')) @@ -1146,3 +1165,7 @@ Class.create("ShareCenter", { } }); + +if(ajaxplorer && ajaxplorer.actionBar){ + ajaxplorer.actionBar.shareCenter = new ShareCenter(); +} diff --git a/core/src/plugins/action.share/class.ShareCenter.php b/core/src/plugins/action.share/class.ShareCenter.php index cf78697645..069062023d 100644 --- a/core/src/plugins/action.share/class.ShareCenter.php +++ b/core/src/plugins/action.share/class.ShareCenter.php @@ -710,6 +710,17 @@ public function updateNodeSharedData($oldNode=null, $newNode=null, $copy = false if($oldNode != null && !$copy){ $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; + } + } + $this->getSharesFromMeta($oldNode, $shares, true); if(empty($shares)) { return; @@ -718,7 +729,7 @@ public function updateNodeSharedData($oldNode=null, $newNode=null, $copy = false $newShares = array(); foreach($shares as $id => $data){ $type = $data["type"]; - if($newNode == null){ + if($delete){ $this->getShareStore()->deleteShare($type, $id); continue; } diff --git a/core/src/plugins/action.share/res/i18n/ca.php b/core/src/plugins/action.share/res/i18n/ca.php index 3bfd3df236..f6c9c4c39f 100644 --- a/core/src/plugins/action.share/res/i18n/ca.php +++ b/core/src/plugins/action.share/res/i18n/ca.php @@ -165,4 +165,6 @@ "156" => "Successfully published link %s", "46_mini" => "Open mini %s1", "46_file" => "Open file %s1", +"157" => "This folder is currently shared. If you delete it, associated share will be disabled.", +"158" => "This file is currently shared. If you delete it, associated share will be disabled. " ); \ No newline at end of file diff --git a/core/src/plugins/action.share/res/i18n/de.php b/core/src/plugins/action.share/res/i18n/de.php index 822598fa3d..20b770d12b 100644 --- a/core/src/plugins/action.share/res/i18n/de.php +++ b/core/src/plugins/action.share/res/i18n/de.php @@ -164,4 +164,6 @@ "156" => "Successfully published link %s", "46_mini" => "Open mini %s1", "46_file" => "Open file %s1", +"157" => "This folder is currently shared. If you delete it, associated share will be disabled.", +"158" => "This file is currently shared. If you delete it, associated share will be disabled. " ); \ No newline at end of file diff --git a/core/src/plugins/action.share/res/i18n/en.php b/core/src/plugins/action.share/res/i18n/en.php index 3e85e522d0..5ef327fd0c 100644 --- a/core/src/plugins/action.share/res/i18n/en.php +++ b/core/src/plugins/action.share/res/i18n/en.php @@ -166,4 +166,6 @@ "154" => "Film Strip (good for image galleries)", "155" => "Embedded (smaller header, for widgets)", "156" => "Successfully published link %s", + "157" => "This folder is currently shared. If you delete it, associated share will be disabled.", + "158" => "This file is currently shared. If you delete it, associated share will be disabled. " ); diff --git a/core/src/plugins/action.share/res/i18n/es.php b/core/src/plugins/action.share/res/i18n/es.php index 4e476cfd50..cb0b93179d 100644 --- a/core/src/plugins/action.share/res/i18n/es.php +++ b/core/src/plugins/action.share/res/i18n/es.php @@ -165,4 +165,6 @@ "156" => "Successfully published link %s", "46_mini" => "Open mini %s1", "46_file" => "Open file %s1", +"157" => "This folder is currently shared. If you delete it, associated share will be disabled.", +"158" => "This file is currently shared. If you delete it, associated share will be disabled. " ); \ No newline at end of file diff --git a/core/src/plugins/action.share/res/i18n/fr.php b/core/src/plugins/action.share/res/i18n/fr.php index 395140c6fb..672ec053b5 100644 --- a/core/src/plugins/action.share/res/i18n/fr.php +++ b/core/src/plugins/action.share/res/i18n/fr.php @@ -165,5 +165,7 @@ "154" => "Pellicule (pour galleries de photos)", "155" => "Minimal (header plus petit, pour un widget)", "156" => "Le lien %s a été publié", +"157" => "Le répertoire est actuallement partagé. Si vous le supprimez, le partage sera désactivé.", +"158" => "Le fichier est actuallement partagé. Si vous le supprimez, le partage sera désactivé." // will be replaced by the filename to download ); \ No newline at end of file diff --git a/core/src/plugins/action.share/res/i18n/pt.php b/core/src/plugins/action.share/res/i18n/pt.php index 6a479a0359..c369fbeed7 100644 --- a/core/src/plugins/action.share/res/i18n/pt.php +++ b/core/src/plugins/action.share/res/i18n/pt.php @@ -165,5 +165,7 @@ "156" => "Successfully published link %s", "46_mini" => "Open mini %s1", "46_file" => "Open file %s1", +"157" => "This folder is currently shared. If you delete it, associated share will be disabled.", +"158" => "This file is currently shared. If you delete it, associated share will be disabled. " // will be replaced by the filename to download ); \ No newline at end of file diff --git a/core/src/plugins/auth.multi/class.multiAuthDriver.php b/core/src/plugins/auth.multi/class.multiAuthDriver.php index 1fab73c8e2..96faff9fe8 100644 --- a/core/src/plugins/auth.multi/class.multiAuthDriver.php +++ b/core/src/plugins/auth.multi/class.multiAuthDriver.php @@ -128,8 +128,10 @@ protected function parseSpecificContributions(&$contribNode) $xmlContent = str_replace("AJXP_MULTIAUTH_SOURCES", json_encode($sources), $xmlContent); $xmlContent = str_replace("AJXP_MULTIAUTH_MASTER", $this->getOption("MASTER_DRIVER"), $xmlContent); $xmlContent = str_replace("AJXP_USER_ID_SEPARATOR", $this->getOption("USER_ID_SEPARATOR"), $xmlContent); - $callbackNode->removeChild($callbackNode->firstChild); - $callbackNode->appendChild($contribNode->ownerDocument->createCDATASection($xmlContent)); + if($callbackNode) { + $callbackNode->removeChild($callbackNode->firstChild); + $callbackNode->appendChild($contribNode->ownerDocument->createCDATASection($xmlContent)); + } } }