<?xml version="1.0" encoding="UTF-8"?>
<ajxp_plugin label="CONF_MESSAGE[Bootstrap Loader]" description="CONF_MESSAGE[Core plugin for loading the framework. Do NOT disable this plugin!]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd" mixins="dibidriver_provider" id="boot.conf">
    <class_definition classname="BootConfLoader" filename="plugins/boot.conf/class.BootConfLoader.php" />
    <client_settings>
        <resources>
            <css file="plugins/boot.conf/installer.css" autoload="true"/>
            <i18n namespace="installer" path="plugins/boot.conf/i18n"/>
            <js className="AjxpInstaller" file="plugins/boot.conf/class.AjxpInstaller.js"/>
        </resources>
    </client_settings>
    <server_settings>
        <global_param group="CONF_MESSAGE[Main options]" name="sysLegend" type="legend" label="" description="CONF_MESSAGE[Set up application title and create a connexion identifier for the super-administrator user. Make sure to use a strong password, as this user will have full access to the server.]"/>
        <global_param group="CONF_MESSAGE[Main options]" name="APPLICATION_TITLE" type="string" label="CONF_MESSAGE[Application Title]" description="CONF_MESSAGE[Your system title]" default="Pydio" mandatory="false"/>
        <global_param group="CONF_MESSAGE[Main options]" name="APPLICATION_WELCOME" type="string" label="CONF_MESSAGE[Welcome Message]" description="CONF_MESSAGE[An additional message displayed at startup, on the splash screen and the login screen.]" default="CONF_MESSAGE[Welcome to Pydio]" mandatory="false"/>
        <global_param group="CONF_MESSAGE[Main options]" name="ADMIN_USER_LOGIN" type="string" label="CONF_MESSAGE[Admin Login]" description="CONF_MESSAGE[Alphanumeric login]" mandatory="true"/>
        <global_param group="CONF_MESSAGE[Main options]" name="ADMIN_USER_NAME" type="string" label="CONF_MESSAGE[Admin Display Name]" description="CONF_MESSAGE[User-friendly name of the user]" mandatory="true"/>
        <global_param group="CONF_MESSAGE[Main options]" name="ADMIN_USER_PASS" type="password" label="CONF_MESSAGE[Admin Password]" description="CONF_MESSAGE[Use a strong password (more than 8 characters, complicated ones.]" mandatory="true"/>
        <global_param group="CONF_MESSAGE[Main options]" name="ADMIN_USER_PASS2" type="password" label="CONF_MESSAGE[Confirm]" description="CONF_MESSAGE[Confirm password]" mandatory="true"/>
        <global_param group="CONF_MESSAGE[Database Connexion]" name="StorageLegend" type="legend" label="" description="CONF_MESSAGE[How the application configuration data will be stored (users, plugins, etc. not how your actual documents are managed). To get started rapidly, select No Database. To enable more advanced features, configure a database connection.]"/>
        <global_param group="CONF_MESSAGE[Database Connexion]" type="button" name="TEST_SQL" choices="boot_test_sql_connexion" label="CONF_MESSAGE[Test SQL Connection]" description="CONF_MESSAGE[Test Connexion]" mandatory="false"/>
        <global_param group="CONF_MESSAGE[Database Connexion]" name="db_type" default="mysql" label="CONF_MESSAGE[Database]" description="CONF_MESSAGE[Driver type (do not touch)]" type="group_switch:dibi_provider" mandatory="true" choices="mysql|MySQL,sqlite3|Sqlite 3,postgre|PostgreSQL"/>
        <global_param group="CONF_MESSAGE[Advanced Options]" name="AdvancedLegend" type="legend" label="" description="CONF_MESSAGE[Please review these technical parameters. Encoding and URI should be auto-detected, but please make sure they reflect your actual server configuration.]"/>
        <global_param group="CONF_MESSAGE[Advanced Options]" name="ENCODING" type="string" label="CONF_MESSAGE[Detected Encoding]" description="CONF_MESSAGE[Please make sure to set the encoding corresponding to your server configuration, something like ln_LN.CHARSET, e.g en_US.UTF-8]" default="" mandatory="true"/>
        <global_param group="CONF_MESSAGE[Advanced Options]" name="SERVER_URI" type="string" label="CONF_MESSAGE[Detected Server Path]" description="CONF_MESSAGE[Make sure this is correct, as it's used to rewrite the htaccess file]" default="/" mandatory="true"/>
        <global_param group="CONF_MESSAGE[Advanced Options]" name="MAILER_ENABLE" type="group_switch:mailer" label="CONF_MESSAGE[Enable emails]" description="CONF_MESSAGE[Set up system to send emails]" default="no" mandatory="true"/>
        <global_param group_switch_name="mailer" group_switch_value="no" group_switch_label="CONF_MESSAGE[No (you can enable mails later)]" name="status" type="hidden" label="No" description="s" default="no"/>
        <global_param group_switch_name="mailer" group_switch_value="yes" group_switch_label="CONF_MESSAGE[Yes (requires a correct PHP configuration)]" name="status" type="hidden" label="Yes" description="s" default="yes"/>
        <global_param group_switch_name="mailer" group_switch_value="yes" group_switch_label="Yes" name="MAILER_SYSTEM" type="select" label="CONF_MESSAGE[Php Mailer]" description="CONF_MESSAGE[Set up the correct value to send emails]" choices="mail|Mail,sendmail|Sendmail" default="mail" mandatory="true"/>
        <global_param group_switch_name="mailer" group_switch_value="yes" group_switch_label="Yes" name="MAILER_ADMIN" type="string" label="CONF_MESSAGE[Administrator Email]" description="CONF_MESSAGE[Default 'From' email used to send emails.]" mandatory="true"/>
        <global_param group_switch_name="mailer" group_switch_label="yes" group_switch_value="yes" type="button" name="TEST_MAILER" choices="boot_test_mailer" label="CONF_MESSAGE[Test Mailer]" description="CONF_MESSAGE[Try sending an email with the configured data]" mandatory="false"/>
        <global_param group="CONF_MESSAGE[Advanced Options]" name="APPLICATION_LANGUAGE" type="select" choices="AJXP_AVAILABLE_LANGUAGES" label="CONF_MESSAGE[Default Language]" description="CONF_MESSAGE[Select a language activated by default( users will still be able to switch)]" default="en" mandatory="true"/>
    </server_settings>
    <registry_contributions>
        <actions>
            <action name="load_installer_form">
                <processing><serverCallback methodName="loadInstallerForm"/></processing>
            </action>
            <action name="boot_test_sql_connexion">
                <processing><serverCallback methodName="testConnexions"/></processing>
            </action>
            <action name="boot_test_mailer">
                <processing><serverCallback methodName="testConnexions"/></processing>
            </action>
            <action name="apply_installer_form">
                <processing><serverCallback methodName="applyInstallerForm"/></processing>
            </action>
            <action name="ajxp_installer">
                <gui iconClass="icon-magic" src="" text="installer.1" title="installer.1">
                    <context dir="" recycle="false" selection="false" actionBar="true" actionBarGroup="user"/>
                </gui>
                <rightsContext adminOnly="false" noUser="false" read="false" userLogged="false" write="false"/>
                <processing>
                    <clientCallback dialogOpenForm="installer_form" dialogSkipButtons="true" prepareModal="true">
                        <dialogOnOpen><![CDATA[
                            var installer = new AjxpInstaller(modal.getForm().down('#installer_form'), {});
                        ]]></dialogOnOpen>
                        <dialogOnComplete><![CDATA[

                        ]]></dialogOnComplete>
                    </clientCallback>
                    <clientForm id="installer_form"><![CDATA[
                        <div id="installer_form" box_padding="0" box_resize="true" box_width="460" overlayStyle='{"backgroundColor":"black","opacity":10,"backgroundImage":"url(\"AJXP_THEME_FOLDER/images/grid_t.png\")"}' style="padding: 20px 20px; overflow:auto; background-color: white;">
                            <img class="install_pydio_logo" src="plugins/gui.ajax/PydioLogo250.png" style="display:block;margin:20px auto;">
                            <div class="installerWelcome">
                                <span ajxp_message_id="installer.3">AJXP_MESSAGE[installer.3]</span>
                            </div>
                            <div style="margin-top:40px;" class="dialogLegend installerLang SF_material">
                                <div class="SF_element" style="float: left;"><select class="SF_input" id="installer_lang"></select><span class="select-styler"></span></div>
                                <div id="start_button" class="SF_input SF_inlineButton" style="display:block; float:right; width:180px; margin-top: 7px !important; background-color:#F47561 !important;" ajxp_message_id="installer.4">AJXP_MESSAGE[installer.4] <span class="icon-chevron-right"></span></div>
                            </div>
                            <div id="the_form" class="SF_material" style="display:none; margin:0 5px;"></div>
                            <div id="configuration_progress" class="dialogLegend installerWelcome" style="display:none; margin:0 5px;">
                                <span ajxp_message_id="installer.5">AJXP_MESSAGE[installer.5]</span>
                                <div style="margin: 20px auto; width: 40px;">
                                    <span class="icon-spinner rotating spinner_large"></span>
                                </div>
                            </div>
                            <div class="SF_input SF_inlineButton" style="display:none; width:180px;" tabIndex="0"><span class="icon-play-circle"></span><span ajxp_message_id="installer.6">AJXP_MESSAGE[installer.6]</span></div>
                        </div>
                    ]]></clientForm>
                    <clientListener name="init"><![CDATA[
                        ResourcesManager.loadClassesAndApply(['AjxpInstaller'], function(){
                            pydio.getController().fireAction("ajxp_installer");
                        });
                    ]]></clientListener>
                </processing>
            </action>
        </actions>
    </registry_contributions>
</ajxp_plugin>
