move remaining global settings to configModel

This commit is contained in:
Arthur Schiwon 2015-08-18 12:13:08 +02:00 committed by Vincent Petry
parent 83d91ddf20
commit a57ff13a23
2 changed files with 33 additions and 5 deletions

View File

@ -19,6 +19,13 @@
publicUploadEnabled: false publicUploadEnabled: false
}, },
/**
* @returns {boolean}
*/
areAvatarsEnabled: function() {
return oc_config.enable_avatars === true;
},
/** /**
* @returns {boolean} * @returns {boolean}
*/ */
@ -41,6 +48,27 @@
return oc_appconfig.core.defaultExpireDateEnforced === true; 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} * @returns {number}
*/ */

View File

@ -182,17 +182,17 @@
} }
return reshareTemplate({ return reshareTemplate({
avatarEnabled: oc_config.enable_avatars === true, avatarEnabled: this.configModel.areAvatarsEnabled(),
sharedByText: sharedByText sharedByText: sharedByText
}); });
}, },
_renderRemoteShareInfoPart: function() { _renderRemoteShareInfoPart: function() {
var remoteShareInfo = ''; var remoteShareInfo = '';
if(oc_appconfig.core.remoteShareAllowed) { if(this.configModel.isRemoteShareAllowed()) {
var infoTemplate = this._getRemoteShareInfoTemplate(); var infoTemplate = this._getRemoteShareInfoTemplate();
remoteShareInfo = infoTemplate({ 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') tooltip: t('core', 'Share with people on other ownClouds using the syntax username@example.com/owncloud')
}); });
} }
@ -203,7 +203,7 @@
var linkShare = ''; var linkShare = '';
if( this.model.hasSharePermission() if( this.model.hasSharePermission()
&& this._showLink && this._showLink
&& $('#allowShareWithLink').val() === 'yes') && this.configModel.isShareWithLinkAllowed())
{ {
var linkShareTemplate = this._getLinkShareTemplate(); var linkShareTemplate = this._getLinkShareTemplate();
@ -236,7 +236,7 @@
_renderSharePlaceholderPart: function () { _renderSharePlaceholderPart: function () {
var sharePlaceholder = t('core', 'Share with users or groups …'); 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 …'); sharePlaceholder = t('core', 'Share with users, groups or remote users …');
} }
return sharePlaceholder; return sharePlaceholder;