<html
    xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
    xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    data-namespace-typo3-fluid="true"
>

<f:layout name="Module" />

<f:section name="Before">
    <f:asset.module identifier="@typo3/backend/context-menu.js"/>
    <f:asset.module identifier="@typo3/impexp/import-export.js"/>
    <f:asset.module identifier="@typo3/backend/element/immediate-action-element.js"/>
    <f:variable name="args" value="{0: 'web', 1: id}" />
    <typo3-immediate-action
        action="TYPO3.Backend.Storage.ModuleStateStorage.update"
        args="{args -> f:format.json() -> f:format.htmlspecialchars()}"
    ></typo3-immediate-action>
</f:section>

<f:section name="Content">

    <h1>
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:title_export" />
    </h1>
    <form action="{f:be.uri(route:'tx_impexp_export')}" method="post" id="ImportExportController">
        <input type="hidden" name="id" value="{id}" />
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="nav-item">
                <button
                    type="button"
                    class="nav-link active"
                    data-typo3-tab="#export-configuration"
                    aria-controls="export-configuration"
                    role="tab"
                >
                    <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:tableselec_configuration" />
            </button>
            </li>
            <li role="presentation" class="nav-item">
                <button
                    type="button"
                    class="nav-link"
                    data-typo3-tab="#export-filepreset"
                    aria-controls="export-filepreset"
                    role="tab"
                >
                    <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:exportdata_filePreset" />
                </button>
            </li>
            <li role="presentation" class="nav-item">
                <button
                    type="button"
                    class="nav-link"
                    data-typo3-tab="#export-advancedoptions"
                    aria-controls="export-advancedoptions"
                    role="tab"
                >
                    <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:exportdata_advancedOptions" />
                </button>
            </li>
            <f:if condition="{errors -> f:count()} > 0">
                <li role="presentation" class="nav-item">
                    <button
                        type="button"
                        class="nav-link"
                        data-typo3-tab="#export-errors"
                        aria-controls="export-errors"
                        role="tab"
                    >
                        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:exportdata_messages" />
                        <core:icon identifier="status-dialog-warning" />
                    </button>
                </li>
            </f:if>
        </ul>
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="export-configuration">
                <f:render partial="Export/Configuration" arguments="{_all}" />
            </div>
            <div role="tabpanel" class="tab-pane" id="export-filepreset">
                <f:render partial="Export/Save" arguments="{_all}" />
            </div>
            <div role="tabpanel" class="tab-pane" id="export-advancedoptions">
                <f:render partial="Export/AdvancedOptions" arguments="{_all}" />
            </div>
            <f:if condition="{errors -> f:count()} > 0">
                <div role="tabpanel" class="tab-pane" id="export-errors">
                    <f:be.infobox state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::ERROR')}" disableIcon="true">
                        <f:for each="{errors}" as="error">
                            <p>{error}</p>
                        </f:for>
                    </f:be.infobox>
                </div>
            </f:if>
        </div>
        <f:render partial="Preview" arguments="{_all}" />
    </form>

</f:section>

</html>
