From e1add8ef89861414de73875c75fe045a2ee5f21e Mon Sep 17 00:00:00 2001 From: cdujeu Date: Thu, 24 Mar 2016 10:02:50 +0100 Subject: [PATCH] Fix typo in Registry : user object is on _pydioObject, not self. Check for ajxp_readonly to avoid proposing writeable editors. --- core/src/plugins/editor.pixlr/fake_error_pixlr.php | 5 +++++ core/src/plugins/gui.ajax/res/js/es6/model/Registry.es6 | 2 +- .../plugins/gui.ajax/res/js/ui/prototype/class.PydioUI.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 core/src/plugins/editor.pixlr/fake_error_pixlr.php diff --git a/core/src/plugins/editor.pixlr/fake_error_pixlr.php b/core/src/plugins/editor.pixlr/fake_error_pixlr.php new file mode 100644 index 0000000000..80696362b1 --- /dev/null +++ b/core/src/plugins/editor.pixlr/fake_error_pixlr.php @@ -0,0 +1,5 @@ +
+
+
+
+
Error while opening Pixlr editor!
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 70e3c169c0..db55ff8f05 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 @@ -245,7 +245,7 @@ class Registry{ findEditorsForMime (mime, restrictToPreviewProviders){ var editors = []; var checkWrite = false; - if(this.user != null && !this.user.canWrite()){ + if(this._pydioObject.user != null && !this._pydioObject.user.canWrite()){ checkWrite = true; } this._extensionsRegistry.editor.forEach(function(el){ diff --git a/core/src/plugins/gui.ajax/res/js/ui/prototype/class.PydioUI.js b/core/src/plugins/gui.ajax/res/js/ui/prototype/class.PydioUI.js index ea56c737b1..d366f5e312 100644 --- a/core/src/plugins/gui.ajax/res/js/ui/prototype/class.PydioUI.js +++ b/core/src/plugins/gui.ajax/res/js/ui/prototype/class.PydioUI.js @@ -72,7 +72,7 @@ Class.create("PydioUI", { if(!editorData){ var selectedMime = getAjxpMimeType(selectedNode); var editors = this._pydio.Registry.findEditorsForMime(selectedMime, false); - if(editors.length && editors[0].openable){ + if(editors.length && editors[0].openable && !(editors[0].write && selectedNode.getMetadata().get("ajxp_readonly") === "true")){ editorData = editors[0]; } }