snappymail/dev/Screen/Admin/Settings.js

95 lines
2.9 KiB
JavaScript
Raw Normal View History

2016-07-07 07:11:13 +08:00
/* global RL_COMMUNITY */
2016-07-08 07:22:58 +08:00
import {addSettingsViewModel} from 'Knoin/Knoin';
2016-07-07 07:11:13 +08:00
import {runSettingsViewModelHooks} from 'Common/Plugins';
import {AbstractSettingsScreen} from 'Screen/AbstractSettings';
2016-07-16 03:54:37 +08:00
import {GeneralAdminSettings} from 'Settings/Admin/General';
import {LoginAdminSettings} from 'Settings/Admin/Login';
import {ContactsAdminSettings} from 'Settings/Admin/Contacts';
import {DomainsAdminSettings} from 'Settings/Admin/Domains';
import {SecurityAdminSettings} from 'Settings/Admin/Security';
import {SocialAdminSettings} from 'Settings/Admin/Social';
import {PluginsAdminSettings} from 'Settings/Admin/Plugins';
import {PackagesAdminSettings} from 'Settings/Admin/Packages';
2016-07-16 05:29:42 +08:00
import {AboutAdminSettings} from 'Settings/Admin/About';
2016-07-16 03:54:37 +08:00
import {getApp} from 'Helper/Apps/Admin';
import {MenuSettingsAdminView} from 'View/Admin/Settings/Menu';
import {PaneSettingsAdminView} from 'View/Admin/Settings/Pane';
2016-07-07 07:11:13 +08:00
class SettingsAdminScreen extends AbstractSettingsScreen
{
2016-07-16 05:29:42 +08:00
constructor() {
2016-07-07 07:11:13 +08:00
super([
MenuSettingsAdminView,
PaneSettingsAdminView
2016-07-07 07:11:13 +08:00
]);
}
/**
* @param {Function=} fCallback = null
*/
setupSettings(fCallback = null) {
2016-07-16 03:54:37 +08:00
addSettingsViewModel(GeneralAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsGeneral', 'TABS_LABELS/LABEL_GENERAL_NAME', 'general', true);
2016-07-16 03:54:37 +08:00
addSettingsViewModel(LoginAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsLogin', 'TABS_LABELS/LABEL_LOGIN_NAME', 'login');
if (RL_COMMUNITY)
{
2016-07-16 03:54:37 +08:00
addSettingsViewModel(require('Settings/Admin/Branding').default,
2016-07-07 07:11:13 +08:00
'AdminSettingsBranding', 'TABS_LABELS/LABEL_BRANDING_NAME', 'branding');
}
else
{
2016-07-16 03:54:37 +08:00
addSettingsViewModel(require('Settings/Admin/Prem/Branding').default,
2016-07-07 07:11:13 +08:00
'AdminSettingsBranding', 'TABS_LABELS/LABEL_BRANDING_NAME', 'branding');
}
2016-07-16 03:54:37 +08:00
addSettingsViewModel(ContactsAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsContacts', 'TABS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
2016-07-16 03:54:37 +08:00
addSettingsViewModel(DomainsAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsDomains', 'TABS_LABELS/LABEL_DOMAINS_NAME', 'domains');
2016-07-16 03:54:37 +08:00
addSettingsViewModel(SecurityAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsSecurity', 'TABS_LABELS/LABEL_SECURITY_NAME', 'security');
2016-07-16 03:54:37 +08:00
addSettingsViewModel(SocialAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsSocial', 'TABS_LABELS/LABEL_INTEGRATION_NAME', 'integrations');
2016-07-16 03:54:37 +08:00
addSettingsViewModel(PluginsAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsPlugins', 'TABS_LABELS/LABEL_PLUGINS_NAME', 'plugins');
2016-07-16 03:54:37 +08:00
addSettingsViewModel(PackagesAdminSettings,
2016-07-07 07:11:13 +08:00
'AdminSettingsPackages', 'TABS_LABELS/LABEL_PACKAGES_NAME', 'packages');
if (!RL_COMMUNITY)
{
2016-07-16 03:54:37 +08:00
addSettingsViewModel(require('Settings/Admin/Prem/Licensing').default,
2016-07-07 07:11:13 +08:00
'AdminSettingsLicensing', 'TABS_LABELS/LABEL_LICENSING_NAME', 'licensing');
}
2016-07-16 05:29:42 +08:00
addSettingsViewModel(AboutAdminSettings,
'AdminSettingsAbout', 'TABS_LABELS/LABEL_ABOUT_NAME', 'about');
2016-07-07 07:11:13 +08:00
runSettingsViewModelHooks(true);
if (fCallback)
{
fCallback();
}
}
onShow() {
getApp().setWindowTitle('');
2016-07-07 07:11:13 +08:00
}
}
export {SettingsAdminScreen, SettingsAdminScreen as default};