summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-10-31 11:52:00 +0100
committerBjoern Schiessle <bjoern@schiessle.org>2016-11-01 19:54:41 +0100
commit86b362809bb58c12864fce93af9c6e961bb7301d (patch)
treea1b19e6be605f5b52d0375f355c5ea440aa5f21f /core
parentce08682c2fdeaeb835cd41c0e9e1207a4da422ab (diff)
downloadnextcloud-server-86b362809bb58c12864fce93af9c6e961bb7301d.tar.gz
nextcloud-server-86b362809bb58c12864fce93af9c6e961bb7301d.zip
always show correct place holder, mention share by mail only if the share provider is enabled
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core')
-rw-r--r--core/js/shareconfigmodel.js1
-rw-r--r--core/js/sharedialogview.js34
2 files changed, 25 insertions, 10 deletions
diff --git a/core/js/shareconfigmodel.js b/core/js/shareconfigmodel.js
index b04c2acae16..24922d62636 100644
--- a/core/js/shareconfigmodel.js
+++ b/core/js/shareconfigmodel.js
@@ -25,6 +25,7 @@
isDefaultExpireDateEnforced: oc_appconfig.core.defaultExpireDateEnforced === true,
isDefaultExpireDateEnabled: oc_appconfig.core.defaultExpireDateEnabled === true,
isRemoteShareAllowed: oc_appconfig.core.remoteShareAllowed,
+ isMailShareAllowed: oc_appconfig.shareByMailEnabled !== undefined,
defaultExpireDate: oc_appconfig.core.defaultExpireDate,
isResharingAllowed: oc_appconfig.core.resharingAllowed,
allowGroupSharing: oc_appconfig.core.allowGroupSharing
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 129206b0931..3b2a7480c47 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -416,19 +416,33 @@
},
_renderSharePlaceholderPart: function () {
- var sharePlaceholder = t('core', 'Share with users, or by mail...');
+ var allowGroupSharing = this.configModel.get('allowGroupSharing');
+ var allowRemoteSharing = this.configModel.get('isRemoteShareAllowed');
+ var allowMailSharing = this.configModel.get('isMailShareAllowed');
- if (this.configModel.get('allowGroupSharing')) {
- if (this.configModel.get('isRemoteShareAllowed')) {
- sharePlaceholder = t('core', 'Share with users, groups, remote users, or by mail…');
- } else {
- sharePlaceholder = t('core', 'Share with users, groups or by mail...');
- }
- } else if (this.configModel.get('isRemoteShareAllowed')) {
- sharePlaceholder = t('core', 'Share with users, remote users or by mail...');
+ if (!allowGroupSharing && !allowRemoteSharing && allowMailSharing) {
+ return t('core', 'Share with users or by mail...');
+ }
+ if (!allowGroupSharing && allowRemoteSharing && !allowMailSharing) {
+ return t('core', 'Share with users or remote users...');
+ }
+ if (!allowGroupSharing && allowRemoteSharing && allowMailSharing) {
+ return t('core', 'Share with users, remote users or by mail...');
+ }
+ if (allowGroupSharing && !allowRemoteSharing && !allowMailSharing) {
+ return t('core', 'Share with users or groups...');
+ }
+ if (allowGroupSharing && !allowRemoteSharing && allowMailSharing) {
+ return t('core', 'Share with users, groups or by mail...');
+ }
+ if (allowGroupSharing && allowRemoteSharing && !allowMailSharing) {
+ return t('core', 'Share with users, groups or remote users...');
+ }
+ if (allowGroupSharing && allowRemoteSharing && allowMailSharing) {
+ return t('core', 'Share with users, groups, remote users or by mail...');
}
- return sharePlaceholder;
+ return t('core', 'Share with users...');
},
/**