snappymail/dev/Screen/Admin/Settings.js

90 lines
2.4 KiB
JavaScript
Raw Normal View History

2016-06-07 05:57:52 +08:00
/* global RL_COMMUNITY */
2016-06-30 08:02:45 +08:00
var
_ = require('_'),
2016-06-30 08:02:45 +08:00
kn = require('Knoin/Knoin'),
2016-06-30 08:02:45 +08:00
Plugins = require('Common/Plugins'),
2016-06-30 08:02:45 +08:00
AbstractSettings = require('Screen/AbstractSettings');
2016-06-30 08:02:45 +08:00
/**
* @constructor
* @extends AbstractSettings
*/
function SettingsAdminScreen()
{
AbstractSettings.call(this, [
require('View/Admin/Settings/Menu'),
require('View/Admin/Settings/Pane')
]);
}
2016-06-30 08:02:45 +08:00
_.extend(SettingsAdminScreen.prototype, AbstractSettings.prototype);
2016-06-30 08:02:45 +08:00
/**
* @param {Function=} fCallback
*/
SettingsAdminScreen.prototype.setupSettings = function(fCallback)
{
kn.addSettingsViewModel(require('Settings/Admin/General'),
'AdminSettingsGeneral', 'TABS_LABELS/LABEL_GENERAL_NAME', 'general', true);
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Login'),
'AdminSettingsLogin', 'TABS_LABELS/LABEL_LOGIN_NAME', 'login');
2016-06-30 08:02:45 +08:00
if (RL_COMMUNITY)
{
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Branding'),
'AdminSettingsBranding', 'TABS_LABELS/LABEL_BRANDING_NAME', 'branding');
}
else
{
kn.addSettingsViewModel(require('Settings/Admin/Prem/Branding'),
'AdminSettingsBranding', 'TABS_LABELS/LABEL_BRANDING_NAME', 'branding');
}
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Contacts'),
'AdminSettingsContacts', 'TABS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Domains'),
'AdminSettingsDomains', 'TABS_LABELS/LABEL_DOMAINS_NAME', 'domains');
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Security'),
'AdminSettingsSecurity', 'TABS_LABELS/LABEL_SECURITY_NAME', 'security');
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Social'),
'AdminSettingsSocial', 'TABS_LABELS/LABEL_INTEGRATION_NAME', 'integrations');
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Plugins'),
'AdminSettingsPlugins', 'TABS_LABELS/LABEL_PLUGINS_NAME', 'plugins');
2015-05-20 21:09:21 +08:00
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/Packages'),
'AdminSettingsPackages', 'TABS_LABELS/LABEL_PACKAGES_NAME', 'packages');
2016-06-30 08:02:45 +08:00
if (!RL_COMMUNITY)
{
kn.addSettingsViewModel(require('Settings/Admin/Prem/Licensing'),
'AdminSettingsLicensing', 'TABS_LABELS/LABEL_LICENSING_NAME', 'licensing');
}
2016-06-30 08:02:45 +08:00
kn.addSettingsViewModel(require('Settings/Admin/About'),
'AdminSettingsAbout', 'TABS_LABELS/LABEL_ABOUT_NAME', 'about');
2016-06-30 08:02:45 +08:00
Plugins.runSettingsViewModelHooks(true);
2016-06-30 08:02:45 +08:00
if (fCallback)
{
2016-06-30 08:02:45 +08:00
fCallback();
}
};
2016-06-30 08:02:45 +08:00
SettingsAdminScreen.prototype.onShow = function()
{
require('App/Admin').default.setWindowTitle('');
};
2016-06-30 08:02:45 +08:00
module.exports = SettingsAdminScreen;