diff --git a/core/js/shareconfigmodel.js b/core/js/shareconfigmodel.js index 371cc96df5..857e356a35 100644 --- a/core/js/shareconfigmodel.js +++ b/core/js/shareconfigmodel.js @@ -19,6 +19,13 @@ publicUploadEnabled: false }, + /** + * @returns {boolean} + */ + areAvatarsEnabled: function() { + return oc_config.enable_avatars === true; + }, + /** * @returns {boolean} */ @@ -41,6 +48,27 @@ return oc_appconfig.core.defaultExpireDateEnforced === true; }, + /** + * @returns {boolean} + */ + isRemoteShareAllowed: function() { + return oc_appconfig.core.remoteShareAllowed; + }, + + /** + * @returns {boolean} + */ + isShareWithLinkAllowed: function() { + return $('#allowShareWithLink').val() === 'yes'; + }, + + /** + * @returns {string} + */ + getFederatedShareDocLink: function() { + return oc_appconfig.core.federatedCloudShareDoc; + }, + /** * @returns {number} */ diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 7b0af2bc84..abf45a6bf4 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -182,17 +182,17 @@ } return reshareTemplate({ - avatarEnabled: oc_config.enable_avatars === true, + avatarEnabled: this.configModel.areAvatarsEnabled(), sharedByText: sharedByText }); }, _renderRemoteShareInfoPart: function() { var remoteShareInfo = ''; - if(oc_appconfig.core.remoteShareAllowed) { + if(this.configModel.isRemoteShareAllowed()) { var infoTemplate = this._getRemoteShareInfoTemplate(); remoteShareInfo = infoTemplate({ - docLink: oc_appconfig.core.federatedCloudShareDoc, + docLink: this.configModel.getFederatedShareDocLink(), tooltip: t('core', 'Share with people on other ownClouds using the syntax username@example.com/owncloud') }); } @@ -203,7 +203,7 @@ var linkShare = ''; if( this.model.hasSharePermission() && this._showLink - && $('#allowShareWithLink').val() === 'yes') + && this.configModel.isShareWithLinkAllowed()) { var linkShareTemplate = this._getLinkShareTemplate(); @@ -236,7 +236,7 @@ _renderSharePlaceholderPart: function () { var sharePlaceholder = t('core', 'Share with users or groups …'); - if (oc_appconfig.core.remoteShareAllowed) { + if (this.configModel.isRemoteShareAllowed()) { sharePlaceholder = t('core', 'Share with users, groups or remote users …'); } return sharePlaceholder;