/*
    this.action_installApplications = new Ext.Action({
        text: this.app.i18n._('Install application'),
        handler: this.onAlterApplications,
        actionType: 'install',
        iconCls: 'setup_action_install',
        disabled: true,
        scope: this
    });
    
    this.actions = [
        this.action_installApplications,
    ];
    */

/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/

/*
 * Tine 2.0
 *
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 - 2017 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2018 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Michael Spahn <m.spahn@metaways.de>
 * @copyright   Copyright (c) 2009-2015 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 - 2017 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009-2012 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009-2023 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2009-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2009-2015 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Setup
 * @license     https://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009-2025 Metaways Infosystems GmbH (https://www.metaways.de)
 *
 */

/* ["default"] */

/* ["default"].locals */

/* asset import */

/* harmony default export */

/* harmony export */

/* harmony import */

/* istanbul ignore if  */

/* istanbul ignore next  */

/*#__PURE__*/

/**
    * returns config manager form
    * 
    * @private
    * @return {Array} items
    */

/**
   * 
   * @cfg grid config 
   */

/**
   * @private
   *
   */

/**
   * @private
   * 
   * NOTE: Order of items matters! Ext.Layout.Border.SplitRegion.layout() does not
   *       fence the rendering correctly, as such it's impotant, so have the ftb
   *       defined after all other layout items
   */

/**
   * @private
   * field index counter
   */

/**
   * @private
   * panel cfg
   */

/**
   * @private
   */

/**
   * @property actionToolbar
   * @type Ext.Toolbar
   */

/**
   * @property contextMenu
   * @type Ext.Menu
   */

/**
   * @property idPrefix DOM Id prefix
   * @type String
   */

/**
   * Change IMAP card layout depending on selected combo box entry
   */

/**
   * Change SMTP card layout depending on selected combo box entry
   */

/**
   * Change cache card layout depending on selected combo box entry
   */

/**
   * Change card layout depending on selected combo box entry
   */

/**
   * Change default ports when database adapter gets changed
   */

/**
   * Change queue card layout depending on selected combo box entry
   */

/**
   * Change session card layout depending on selected combo box entry
   */

/**
   * If license uploaded successfully ..
   */

/**
   * Sets license data to textfields
   * @param response
   */

/**
   * The currently active accounts storage backend
   * 
   * @property originalAccountsStorage
   * @type String
   */

/**
   * accountsStorageIdPrefix DOM Id prefix
   * 
   * @property accountsStorageIdPrefix
   * @type String
   */

/**
   * active panel
   * 
   * @property activeContentType
   * @type String
   */

/**
   * alter applications
   * 
   * @param {} type (uninstall/install/update)
   * @private
   */

/**
   * applies registry state to this cmp
   */

/**
   * apply registry state
   */

/**
   * authProviderPrefix DOM Id prefix
   * 
   * @property authProviderIdPrefix
   * @type String
   */

/**
   * checks if form is valid
   * - password fields are equal
   * 
   * @return {Boolean}
   */

/**
   * combo box containing the accounts storage selection
   * 
   * @property accountsStorageCombo
   * @type Ext.form.ComboBox
   */

/**
   * combo box containing the authentication backend selection
   * 
   * @property authenticationBackendCombo
   * @type Ext.form.ComboBox 
   */

/**
   * combo box containing the imap backend selection
   * 
   * @property imapBackendCombo
   * @type Ext.form.ComboBox 
   */

/**
   * combo box containing the smtp backend selection
   * 
   * @property smtpBackendCombo
   * @type Ext.form.ComboBox 
   */

/**
   * get content panel
   *
   * @return {Ext.Panel}
   */

/**
   * get db adapter field
   * 
   * @param {String} type1 (imap, smtp)
   * @param {String} type2 (dbmail, postfix, ...)
   * @return {Array}
   */

/**
   * get db config fields
   * 
   * @param {String} type1 (imap, smtp)
   * @param {String} type2 (postfix, ...)
   * @return {Array}
   */

/**
   * get db config fields
   * 
   * @param {String} type1 (imap, smtp)
   * @return {Array}
   */

/**
   * get north panel for given activeContentType
   *
   * @param {String} activeContentType
   * @return {Ext.Panel}
   */

/**
   * get tab index for field
   * 
   * @return {Integer}
   */

/**
   * get west panel for given activeContentType
   *
   * template method to be overridden by subclasses to modify default behaviour
   *
   * @return {Ext.Panel}
   */

/**
   * getDirectoryOptions
   * 
   * @param {String} type LDAP or ActiveDirectory
   * @param {Object} commonComboConfig
   */

/**
   * goto tine 2.0 login screen
   * 
   * @param {Button} btn
   * @param {Event} e
   */

/**
   * imapBackend DOM Id prefix
   * 
   * @property imapBackendIdPrefix
   * @type String
   */

/**
   * init component
   */

/**
   * init ext grid panel
   * @private
   */

/**
   * init store
   * @private
   */

/**
   * license
   */

/**
   * license type switch
   *
   * * allowed values: BusinessEdition
   *
   * TODO: read this from config
   *
   * @property licenseType
   * @type String
   */

/**
   * overwrite default - we do not have a filterpanel here
   */

/**
   * returns config manager form
   * 
   * @private
   * @return {Array} items
   */

/**
   * select all installable or updateable apps
   * @private
   */

/**
   * session backend DOM Id prefix
   * 
   * @property sessionBackendIdPrefix
   * @type String
   */

/**
   * show type before db settings
   * @cfg {Boolean} showType
   */

/**
   * smtpBackend DOM Id prefix
   * 
   * @property smtpBackendIdPrefix
   * @type String
   */

/**
   * transforms form data into a config object
   * 
   * @hack   smuggle termsAccept in 
   * @return {Object} configData
   */

/**
   * tree panel cfg
   * 
   * @private
   */

/**
  * init component
  */

/**
 * @namespace   Tine.Setup
 * @class       Tine.Setup.ApplicationBackend
 * @extends     Tine.Tinebase.data.RecordProxy
 *
 * default application backend
 */

/**
 * @namespace   Tine.Setup
 * @class       Tine.Setup.ApplicationGridPanel
 * @extends     Tine.widgets.grid.GridPanel
 * 
 * <p>Application Setup Grid Panel</p>
 * <p></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.ApplicationGridPanel
 */

/**
 * @namespace   Tine.Setup
 * @class       Tine.Setup.MainScreen
 * @extends     Tine.widgets.MainScreen
 * 
 * <p>MainScreen Definition</p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.MainScreen
 */

/**
 * @namespace   Tine.Setup
 * @class       Tine.Setup.TreePanel
 * @extends     Ext.tree.TreePanel
 * 
 * <p>Setup TreePanel</p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.TreePanel
 */

/**
 * @namespace   Tine.Setup.Model
 * @class       Tine.Setup.Model.Application
 * @extends     Tine.Tinebase.data.Record
 *
 * Application Record Definition
 */

/**
 * @namespace   Tine.Setup.Model
 * @class       Tine.Setup.Model.EnvCheck
 * @extends     Ext.data.Record
 *
 * env check Record Definition
 */

/**
 * Environment Check Grid Panel
 * 
 * @namespace   Tine.Setup
 * @class       Tine.Setup.EnvCheckGridPanel
 * @extends     Ext.Panel
 * 
 * <p>Environment Check Grid Panel</p>
 * <p><pre>
 * </pre></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schuele <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.EnvCheckGridPanel
 */

/**
 * Licensecheck Panel
 *
 * @namespace   Tine.Setup
 * @class       Tine.Setup.LicensePanel
 * @extends     Ext.Panel
 *
 * <p>Licensecheck Panel</p>
 * <p><pre>
 * </pre></p>
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Michael Spahn <m.spahn@metaways.de
 * @copyright   Copyright (c) 2014 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.LicensePanel
 */

/**
 * Setup Authentication Manager
 * 
 * @namespace   Tine.Setup
 * @class       Tine.Setup.AuthenticationPanel
 * @extends     Tine.Tinebase.widgets.form.ConfigPanel
 * 
 * <p>Authentication Panel</p>
 * <p><pre>
 * TODO         move to next step after install?
 * TODO         make default is valid mechanism with 'allowEmpty' work
 * </pre></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.AuthenticationPanel
 */

/**
 * Setup Configuration Manager
 * 
 * @namespace   Tine.Setup
 * @class       Tine.Setup.ConfigManagerPanel
 * @extends     Tine.Tinebase.widgets.form.ConfigPanel
 * 
 * <p>Configuration Panel</p>
 * <p><pre>
 * </pre></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.ConfigManagerPanel
 */

/**
 * Setup Email Config Manager
 * 
 * @namespace   Tine.Setup
 * @class       Tine.Setup.EmailPanel
 * @extends     Tine.Tinebase.widgets.form.ConfigPanel
 * 
 * <p>Email Config Panel</p>
 * <p><pre>
 * </pre></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schuele <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Setup.EmailPanel
 */

/**
 * always show login screen in Setup
 * @returns {boolean}
 */

/**
 * init ajax
 */

/**
 * init registry
 */

/**
 * local storage prefix for Setup
 */

/**
 * render window
 */

/***/

/*global Ext, Tine*/

/*{
       name: 'imap_user',
       fieldLabel: this.app.i18n._('Username'),
       xtype: 'textfield'
      }, {
       name: 'imap_password',
       fieldLabel: this.app.i18n._('Password'),
       xtype: 'textfield',
       xtype: 'tw-passwordTriggerField',
       clipboard: false
      }, */

//    setup only works with mysql version check ok

// 15 mins

// @todo add re-run checks here

// @todo change default port

// Exports

// For old IE

// If url is already wrapped in quotes, remove them

// Module

// NOTE: do not interfere with standard mainscreen rendering

// See https://drafts.csswg.org/css-values-3/#urls

// Should url be wrapped?

// Special case to return head of iframe instead of iframe itself

// TODO disable imap_domain if this is checked

// TODO move map panel config to common config panel -> it should not be saved in config.inc.php

// TODO this should be not saved in the config.inc.php

// This will throw an exception if access to iframe is blocked

// Tine.loginPanel.doLayout();

// activate local sort

// add selection of updateable apps after store load

// check if initial username/passwords are set

// check if passwords match

// check prefix length

// common config for all combos in this setup

// cyrus config options

// dovecot combined with postfix config options

// dovecot config options

// due to cross-origin restrictions

// enable setup app

// fake a setup user

// file config options

// get user confirmation before uninstall

// hide and disable stuff in main menu

// if a config file exists, the admin needs to login!        

// imap combo

// import a list of modules into the list

// init sel model

// init view

// istanbul ignore if

// istanbul ignore next

// ngettext('Application', 'Applications', n); gettext('Application');

// nothing in here yet

// overwrite the default renderer to show links correctly

// postfix config options

// postfix ldap qmail user schema config options

// redis config options

// replace some registry data

// return the list of modules as css string

// select last non disabled entry

// setup calls can take quite a while

// smtp combo

// use backend combo config as common combo config

// we are not ready for this button yet:

//Dependency Exception
