<?xml version="1.0"?>

<!-- 
    Add-on scheme version 2.0 description
    All parameters that are not marked as optional must be defined in the scheme. 
    @edition_type - An optional attribute available for any settings-related element. It defines editions in which one or another setting is available. If left empty, the parent element value will be used. If the latter is not set, the value is considered ROOT
-->

<addon scheme='2.0' edition_type="ROOT,ULT:VENDOR">
    <!-- Add-on identifier. It must be equal to the catalog name in which the add-on resides -->
    <id>sample_addon_2_0</id>

    <!-- Add-on version -->
    <version>1.0</version> 
    
    <!-- Add-on native (default) language. An optional parameter; if not specified, the language will be recognized as English (EN)-->
    <default_language>en</default_language>

    <!-- Add-on name in the default language -->
    <name>2.0 scheme addon sample</name>

    <!-- Add-on description in the default language -->
    <description>This is description of addon</description>

    <!-- Add-on priority. The higher the priority the later the add-on is connected -->
    <priority>100</priority>

    <!-- Status to be set after the add-on installation (active/disabled); "disabled" by default -->
    <status>active</status>

    <!-- Authors contact information -->
    <!-- All fields are optional -->
    <authors>
        <author>
            <name>CS-Cart</name>
            <email>contact@cs-cart.com</email>
            <url>http://cs-cart.com</url>
            <phone>+1 999 1234 5678</phone>
        </author>
    </authors>

    <!-- Block for the other add-ons compatibilities or system preferences descriptions -->
    <compatibility>
        <!-- Dependencies. These add-ons must be installed in order to install the current one; otherwise an error message will be displayed -->
        <dependencies>discussion,form_builder</dependencies>

        <!-- Conflicts. These add-ons will be automatically disabled before the current add-on installation starts and the notification will be displayed-->
        <conflicts>catalog_mode,reward_points</conflicts>

        <!-- Minimal/Maximal cart version. Min or Max parameter can be optional -->
        <core_version>
            <min>4.0.3</min>
        </core_version>

        <!-- Cart edition: ULTIMATE/MULTIVENDOR -->
        <core_edition>
            ULTIMATE,MULTIVENDOR
        </core_edition>

        <!-- Minimal/Maximal PHP version. Min or Max parameter can be optional -->
        <php_version>
            <min>5.3.0</min>
            <max>5.5.0</max>
        </php_version>

        <!-- Dependencies on extra extensions -->
        <php_extensions>
            <!-- Checking Extension availability. Must be installed: Y. Not to be installed: N -->
            <calendar>
                <supported>Y</supported>
            </calendar>

            <!-- Extension id (phpinfo) and required version -->
            <json>
                <min>1.1.0</min>
                <max>1.2.2</max>
            </json>
        </php_extensions>
    </compatibility>

    <!-- Reserved field -->
    <license></license>
    
    <!-- Translations for the non-default languages -->
    <translations> 
        <!--
            @for - points to the property for which the translation is provided. Possible values: name/description/tooltip. Optional. The default value is "name"
            @lang - the translation language code. If there is no language with the given code, the translation will not be installed
        -->
        <item for="name" lang="ru">Пример аддона версии 2.0</item>
        <item for="description" lang="ru">Описание для аддона версии 2.0</item>
        
        <item for="name" lang="zh">计划插件示例 2.0</item>
        <item for="description" lang="zh">插件描述</item>
    </translations>

    <!--Prepend or append the common tab list with add-on tabs (default defained as append)-->
    <tab_order>prepend</tab_order> 

    <!-- Add-on settings block. Optional.
        @layout - Defines where the settings page will be opened (popup/separate). Optional attribute; "popup" by default
    -->
    <settings layout="separate" edition_type="ROOT,ULT:VENDOR">
        <!-- List of tabs on the add-on settings page -->
        <sections>
            <!-- Tab for settings.
                @id - text identifier. This setting can be accessed later on through Registry::get('addons.[addon_id].[setting_id]')
                @edition_type - list of editions in which the tab will be available. Optional
            -->
            <section id="section1">
                <!-- Tab name in the default language -->
                <name>Generic settings</name>        
                <translations>
                    <item lang="ru" for="name">Обычные настройки</item>
                    <item lang="zh" for="name">常规设置</item>
                </translations>

                <!-- List of settings in the tab -->
                <items>
                    <!-- Add-on settings
                        @id - setting identifier.
                        @edition_type - list of editions in which the setting will be available.
                    -->
                    <item id="header">
                        <!-- Element type: 
                            input, textarea, password, checkbox, selectbox, multiple select, 
                            multiple checkboxes, countries list, states list, 
                            file, info, header, template
                        -->
                        <type>header</type>
                        
                        <!-- Setting name in the default language -->
                        <name>Header</name>

                        <!-- Setting translations -->
                        <translations>
                            <item lang="ru" for="name">Заголовок</item>
                            <item lang="zh" for="name">头部</item>
                        </translations>
                    </item>
                    <item id="input">
                        <type>input</type>
                        <name>Input</name>

                        <!-- Tooltip -->
                        <tooltip>Tooltip</tooltip>
                        <translations>
                            <item lang="ru" for="name">Поле ввода</item>
                            <!-- It is possible to provide translations for tooltips too -->
                            <item lang="ru" for="tooltip">Подсказка</item>
                        </translations>
                    </item>
                    <item id="password">
                        <type>password</type>
                        <name>Password input</name>
                        <translations>
                            <item lang="ru" for="name">Поле ввода пароля</item>
                        </translations>
                    </item>
                    <item id="checkbox">
                        <type>checkbox</type>
                        <name>Checkbox</name>                
                        <translations>
                            <item lang="ru" for="name">Флажок</item>
                        </translations>
                    </item>
                    <item id="textarea">
                        <type>textarea</type>
                        <name>Textarea</name>                
                        
                        <!-- Default value; must be option id for lists (items with options like selectbox, multiple select etc. -->
                        <default_value>Sample textarea text</default_value>

                        <translations>
                            <item lang="ru" for="name">Поле ввода текста</item>
                        </translations>
                    </item>
                    <item id="radiogroup">
                        <type>radiogroup</type>
                        <name>Radio group box</name>
                        <tooltip>Tooltip</tooltip>
                        <default_value>radio_2</default_value>

                        <!-- Options - for types selectbox, multiple select, 
                            multiple checkboxes, combo select -->
                        <variants>
                            <!-- @id - option identifier -->
                            <item id="radio_1">
                                <!-- Option name -->
                                <name>Radio button 1</name>
                                <!-- Option translations; similar as for the add-on name, but the parameter "for" in not used -->
                                <translations>
                                    <item lang="ru">Радио кнопка 1</item>
                                </translations>
                            </item>
                            <item id="radio_2">
                                <name>Radio button 2</name>                        
                                <translations>
                                    <item lang="ru">Радио кнопка 2</item>
                                </translations>
                            </item>
                        </variants>
                        <translations>
                            <item lang="ru" for="name">Группа радиокнопок</item>
                        </translations>
                    </item>
                    <item id="file">
                        <type>file</type>
                        <name>File select</name>                
                        <translations>
                            <item lang="ru">Поле выбора файла</item>
                        </translations>
                    </item>
                </items>
            </section>
            <section id="section2">
                <name>Selects</name>
                <translations>
                    <item lang="ru">Списки</item>
                </translations>
                <items>
                    <item id="selectbox">
                        <type>selectbox</type>
                        <name>Selectbox</name>
                        <variants>
                            <item id="select_box_1">
                                <name>Select box item 1</name>
                                <translations>
                                    <item lang="ru">Элемент списка 1</item>
                                </translations>
                            </item>
                            <item id="select_box_2">
                                <name>Select box item 2</name>                        
                                <translations>
                                    <item lang="ru">Элемент списка 2</item>
                                </translations>
                            </item>
                        </variants>
                        <translations>
                            <item lang="ru">Простой список</item>
                        </translations>
                    </item>
                    <item id="countries_list">
                        <type>countries list</type>
                        <name>Countries list</name>                
                        <translations>
                            <item lang="ru">Список стран</item>
                        </translations>
                    </item>
                    <item id="states_list">
                        <type>states list</type>
                        <name>States list</name>                
                        <translations>
                            <item lang="ru">Список регионов</item>
                        </translations>
                    </item>
                    <item id="multiple_select">
                        <type>multiple select</type>
                        <name>Multiple select</name>
                        <translations>
                            <item lang="ru">Список с возможностью выбрать несколько значений</item>
                        </translations>
                        <variants>
                            <item id="select_box_1">
                                <name>Select box item 1</name>
                                <translations>
                                    <item lang="ru">Элемент списка 1</item>
                                </translations>
                            </item>
                            <item id="select_box_2">
                                <name>Select box item 2</name>                                                
                                <translations>
                                    <item lang="ru">Элемент списка 2</item>
                                </translations>
                            </item>
                            <item id="select_box_3">
                                <name>Select box item 3</name>        
                                <translations>
                                    <item lang="ru">Элемент списка 3</item>
                                </translations>                
                            </item>
                        </variants>
                    </item>
                    <item id="multiple_checkboxes">
                        <type>multiple checkboxes</type>
                        <name>Multiple select check boxes</name>
                        <translations>
                            <item lang="ru">Список флагов</item>
                        </translations>
                        <variants>
                            <item id="select_box_1">
                                <name>Select box item 1</name>
                                <translations>
                                    <item lang="ru">Элемент списка 1</item>
                                </translations>
                            </item>
                            <item id="select_box_2">
                                <name>Select box item 2</name>                                                
                                <translations>
                                    <item lang="ru">Элемент списка 2</item>
                                </translations>
                            </item>
                            <item id="select_box_3">
                                <name>Select box item 3</name>        
                                <translations>
                                    <item lang="ru">Элемент списка 3</item>
                                </translations>                
                            </item>
                        </variants>
                        <default_value>select_box_2</default_value>
                    </item>
                </items>
            </section>
            <section name="section3">
                <name>Additional settings</name>
                <translations>
                    <item lang="ru">Особые настройки</item>
                </translations>
                <items>
                    <item id="selectable_box">
                        <name>Selectable box</name>
                        <!-- Варианты данной настроки будут браться из функции fn_settings_variants_addons_[addon_id]_[setting_id]-->
                        <!-- The current setting options will be taken from the function fn_settings_variants_addons_[addon_id]_[setting_id] -->
                        <type>selectable_box</type>
                        <default_value><![CDATA[#M#product_code=Y&product=Y&amount=Y&price=Y]]></default_value>
                        <translations>
                            <item lang="ru">Двухпанельный список мультивыбора</item>
                        </translations>
                    </item>

                    <!-- In this case the information returned by the function "handler" will be displayed -->
                    <item id="info">
                        <name>Info url</name>
                        <type>info</type>
                        <handler>fn_sample_addon_1_0_info</handler>
                        <translations>
                            <item lang="ru">Информация</item>
                        </translations>
                    </item>
                    <!-- Setting appearance; type "template". In this case a user-defined template from the folder themes/THEME_NAME/addons/ADDON_NAME/settings/TEMPLATE_NAME is loaded.
                         The template name is stored in the "default_value" -->
                    <item id="template">
                        <type>template</type>
                        <default_value>sample.tpl</default_value>
                    </item>

                    <!-- A hidden setting. Exists in the database and in the Registry but is not shown to the user -->
                    <item id="hidden">
                        <type>hidden</type>
                        <default_value>Some hidden setting value</default_value>
                    </item>
                </items>
            </section>
        </sections>
    </settings>

    <!-- Add language variables -->
    <language_variables>
        <!-- 
            @id - language variable identifier, 
            @lang - the language it is added for -->
        <item lang="en" id="test_xml_1.0_1">First language variable</item>
        <item lang="en" id="test_xml_1.0_2">Second language variable</item>

        <item lang="ru" id="test_xml_1.0_1">Первое языковое значение</item>
        <item lang="ru" id="test_xml_1.0_2">Второе языковое значение</item>
    </language_variables>

    <!-- Additional database queries -->
    <queries>
        <!-- If parameter "for" equals "install" or is not set, the query is executed during the add-on installation -->
        <item for="install">
        CREATE TABLE `?:addon_test_1234567` (
            `queue_id` mediumint NOT NULL auto_increment,
            PRIMARY KEY  (`queue_id`),
        ) ENGINE=MyISAM DEFAULT CHARSET=UTF8
        </item>
        <!-- If the "editions" attribute is given, the request will be executed only for the editions that are defined in it (separated with commas) -->
        <item for="install" editions="ULTIMATE,MULTIVENDOR">
            ALTER TABLE `?:addon_test_123456789` ADD company_id INT NOT NULL DEFAULT 0;
        </item>
        <!-- If the parameter "for" equals "uninstall", the query is executed during the add-on uninstallation -->
        <item for="uninstall">DROP TABLE IF EXISTS `?:addon_test_1234567`</item>
    </queries>

    <!-- User-defined functions called on certain events:
            before_install - before the add-on installation
            install - after the installation of the add-on, its templates, settings and language variables but before its activation and cache clearing
            uninstall - before uninstallation
            -->
    <functions>
        <item for="install">fn_google_export_add_features</item>
        <item for="install">fn_google_export_add_feed</item>
        <item for="uninstall">fn_google_export_remove_features</item>
        <item for="uninstall">fn_google_export_remove_feed</item>
    </functions>
</addon>

