diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/shareconfigmodel.js | 1 | ||||
-rw-r--r-- | core/js/sharedialogview.js | 34 |
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...'); }, /** |