<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="productexport" translate="label" sortOrder="152" showInDefault="1" showInStore="1" showInWebsite="0">
            <tab>xtento</tab>
            <label>Product Feed Export Module</label>
            <resource>Xtento_ProductExport::configuration</resource>
            <group id="general" translate="label" showInDefault="1" sortOrder="10">
                <label>Extension Configuration</label>
                <attribute type="expanded">1</attribute>
                <frontend_model>Xtento\XtCore\Block\System\Config\Form\Xtento\Module</frontend_model>
                <fieldset_css>Xtento_ProductExport|Xtento\ProductExport\Model\System\Config\Backend\Server</fieldset_css>
                <comment>
                    <![CDATA[
                    <script>
                    requirejs(['jquery', 'prototype'], function() {
                        function setCommentHtml(message) {
                            if (Prototype.Browser.IE) {
                                $('productexport_general_serial').next('p').outerHTML = message;
                            } else {
                                $('productexport_general_serial').next('p').innerHTML = message;
                            }
                        }

                        function initSystemConfiguration() {
                            if ($('productexport_general_server_name')) {
                                $('productexport_general_server_name').style.backgroundColor='#f0f0f0';
                                $('productexport_general_server_name').disable();
                                if ($('row_productexport_general_server')) {
                                    $('row_productexport_general_server').hide();
                                }
                            }

                            if ($('productexport_general_serial') && $('productexport_general_serial').value !== '' && $('productexport_general_server') && $('productexport_general_server').value !== '') {
                                if ($('productexport_general_serial').value.length !== 40) {
                                    setCommentHtml('<a href="http://www.xtento.com" target="_blank"><img src="//www.xtento.com/license/check/?d='+$('productexport_general_server').value+'" border="0" style="margin-top: 4px;"/></a>');
                                } else {
                                    if (typeof $('productexport_general_serial').nextSibling !== 'undefined' && typeof $('productexport_general_serial').nextSibling.nextSibling !== 'undefined') {
                                        setCommentHtml('<a href="http://www.xtento.com" target="_blank"><img src="//www.xtento.com/license/check/?d='+$('productexport_general_server').value+'" border="0" style="margin-top: 4px;"/></a>');
                                    }
                                }
                            } else {
                                if ($('productexport_general_server').value !== '') {
                                    setCommentHtml('<a href="http://www.xtento.com" target="_blank"><img src="//www.xtento.com/license/check/?d='+$('productexport_general_server').value+'" border="0" style="margin-top: 4px;"/></a>');
                                }
                            }
                        }
                        jQuery(document).ready(function () {
                            initSystemConfiguration();
                        });
                    });
                    </script>
                    ]]>
                </comment>
                <field id="heading" translate="label" sortOrder="10" showInDefault="1">
                    <label>General Configuration</label>
                    <frontend_model>Magento\Config\Block\System\Config\Form\Field\Heading</frontend_model>
                </field>
                <field id="server_name" translate="label" sortOrder="20" showInDefault="1">
                    <label>Server Name</label>
                    <frontend_model>Xtento\XtCore\Block\System\Config\Form\Xtento\Servername</frontend_model>
                </field>
                <field id="serial" translate="label" sortOrder="30" showInDefault="1">
                    <label>License Key</label>
                    <comment>Please enter your license key here.</comment>
                    <backend_model>Xtento\XtCore\Model\System\Config\Backend\License</backend_model>
                </field>
                <field id="enabled" translate="label" type="select" sortOrder="40" showInDefault="1">
                    <label>Module Enabled</label>
                    <comment>A valid license key is required in order to enable the module.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="server" translate="label" type="hidden" sortOrder="50" showInDefault="1">
                    <label/>
                    <backend_model>Xtento\ProductExport\Model\System\Config\Backend\Server</backend_model>
                </field>
                <field id="debug_section" translate="label" sortOrder="60" showInDefault="1">
                  <label>Debug Section</label>
                  <frontend_model>Magento\Config\Block\System\Config\Form\Field\Heading</frontend_model>
                </field>
                <field id="debug" translate="label" sortOrder="70" type="select" showInDefault="1">
                  <label>Debug Mode Enabled</label>
                  <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="debug_email" translate="label" sortOrder="80" type="text" showInDefault="1">
                  <label>Debug E-Mail</label>
                  <comment>Enter your email address if you want to be notified about failed exports.</comment>
                </field>
                <field id="disable_cron_warning" translate="label" sortOrder="90" type="select" showInDefault="1">
                  <label>Disable Cronjob Warning</label>
                  <comment>Set this to "Yes" if you don't want to be notified about problems with the cronjob</comment>
                  <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>
            <group id="advanced" translate="label" showInDefault="1" sortOrder="500">
                <label>Advanced Configuration</label>
                <field id="disable_category_mapper" translate="label comment" type="select" showInDefault="1" sortOrder="10">
                    <label><![CDATA[Disable Category Mapper]]></label>
                    <comment>Only required if you have ten thousands of categories. Then your export profile page could be hanging and disabling the category mapper will fix it. It is better to map such an amount of categories via a product attribute or directly in the XSL Template.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="collection_batch_size" translate="label" sortOrder="20" type="text" showInDefault="1">
                    <label>Collection: Batch Size</label>
                    <comment>Default value: 500. Use this to decrease or increase the number of collection items loaded during each iteration when loading collections. Higher or lower values can have better performance depending on your server setup. Too high values will cause memory issues.</comment>
                    <validate>validate-number validate-zero-or-greater</validate>
                </field>
                <field id="memory_limit" translate="label" sortOrder="30" type="text" showInDefault="1">
                    <label>PHP: memory_limit (MB)</label>
                    <comment>Default value: 2048. Has no effects when ran from cronjob/CLI, but important for manual exports.</comment>
                    <validate>validate-number validate-zero-or-greater</validate>
                </field>
            </group>
        </section>
    </system>
</config>
<!--
/**
 * Product:       Xtento_ProductExport
 * ID:            %!uniqueid!%
 * Last Modified: 2019-11-20T11:31:30+00:00
 * File:          etc/adminhtml/system.xml
 * Copyright:     Copyright (c) XTENTO GmbH & Co. KG <info@xtento.com> / All rights reserved.
 */
-->