diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-08-18 12:13:08 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:25 +0200 |
commit | a57ff13a23ce06846160c1264369ff4b07619890 (patch) | |
tree | 5dba0c086696a750327073737e8644469df0d323 | |
parent | 83d91ddf20bd2e61b9f01c82817ac8b815d3ac66 (diff) | |
download | nextcloud-server-a57ff13a23ce06846160c1264369ff4b07619890.tar.gz nextcloud-server-a57ff13a23ce06846160c1264369ff4b07619890.zip |
move remaining global settings to configModel
-rw-r--r-- | core/js/shareconfigmodel.js | 28 | ||||
-rw-r--r-- | core/js/sharedialogview.js | 10 |
2 files changed, 33 insertions, 5 deletions
diff --git a/core/js/shareconfigmodel.js b/core/js/shareconfigmodel.js index 371cc96df5e..857e356a351 100644 --- a/core/js/shareconfigmodel.js +++ b/core/js/shareconfigmodel.js @@ -22,6 +22,13 @@ /** * @returns {boolean} */ + areAvatarsEnabled: function() { + return oc_config.enable_avatars === true; + }, + + /** + * @returns {boolean} + */ isPublicUploadEnabled: function() { var publicUploadEnabled = $('#filestable').data('allow-public-upload'); return !_.isUndefined(publicUploadEnabled); @@ -42,6 +49,27 @@ }, /** + * @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} */ getDefaultExpireDate: function () { diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 7b0af2bc84c..abf45a6bf45 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; |