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
},
/**
* @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}
*/

View File

@ -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;