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

<h3>
    <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_exportPagetreeConfiguration"/>
</h3>

<div class="row">
    <div class="col-sm-2">
        <label class="control-label">
            <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_pageId"/>
        </label>
    </div>
    <div class="col-sm-10">
        {inData.pagetree.id}
        <input type="hidden" name="tx_impexp[pagetree][id]" value="{inData.pagetree.id}" />
    </div>
</div>

<div class="row">
    <div class="col-sm-2">
        <label class="control-label">
            <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_tree"/>
        </label>
    </div>
    <div class="col-sm-10">
        <f:if condition="{treeHTML}">
            <f:then>
                <f:format.raw>{treeHTML}</f:format.raw>
            </f:then>
            <f:else>
                <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_noTreeExportedOnly"/>
            </f:else>
        </f:if>
    </div>
</div>

<div class="form-group">
    <label for="pagetreeLevels">
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_levels"/>
    </label>
    <select
        id="pagetreeLevels"
        class="form-select"
        name="tx_impexp[pagetree][levels]"
    >
        <f:for each="{levelSelectOptions}" as="optionLabel" key="optionValue">
            <option value="{optionValue}" {f:if(condition:'{optionValue} == {inData.pagetree.levels}', then:'selected="selected"')}>{optionLabel}</option>
        </f:for>
    </select>
</div>

<div class="form-group">
    <label for="pagetreeTables">
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_includeTables"/>
    </label>
    <select
        id="pagetreeTables"
        class="form-select"
        name="tx_impexp[pagetree][tables][]"
        multiple="multiple"
        size="{f:if(condition: '{tableSelectOptions -> f:count()} > 9', then: '10', else: '5')}"
    >
        <f:for each="{tableSelectOptions}" as="optionLabel" key="optionValue">
            <option value="{optionValue}" {i:inArray(needle:optionValue, haystack:inData.pagetree.tables, then:'selected="selected"')}>{optionLabel}</option>
        </f:for>
    </select>
</div>

<f:if condition="{records -> f:count()} > 0">
    <h4>
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_exportSingleRecord"/>
    </h4>
    <div class="row">
        <div class="col-sm-2">
            <label>
                <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_record"/>
            </label>
        </div>
        <div class="col-sm-10">
            <f:for each="{records}" as="record">
                <f:format.raw>{record.icon}</f:format.raw>
                {record.title}
                <input type="hidden" name="tx_impexp[record][]" value="{record.tableName}:{record.recordUid}" />
                <br/>
            </f:for>
        </div>
    </div>
</f:if>

<f:if condition="{tableList -> f:count()} > 0">
    <h4>
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_exportTablesFromPages"/>
    </h4>
    <div class="row">
        <div class="col-sm-2">
            <label>
                <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_tablePids"/>
            </label>
        </div>
        <div class="col-sm-10">
            <f:for each="{tableList}" as="table">
                <f:format.raw>{table.iconAndTitle}</f:format.raw>
                <input type="hidden" name="tx_impexp[list][]" value="{table.reference}" />
                <br/>
            </f:for>
        </div>
    </div>
</f:if>

<h4>
    <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_relationsAndExclusions"/>
</h4>

<div class="form-group">
    <label for="externalRefTables">
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_includeRelationsToTables"/>
    </label>
    <select
        id="externalRefTables"
        class="form-select"
        name="tx_impexp[external_ref][tables][]"
        multiple="multiple"
        size="{f:if(condition: '{externalReferenceTableSelectOptions -> f:count()} > 9', then: '10', else: '5')}"
    >
        <f:for each="{externalReferenceTableSelectOptions}" as="optionLabel" key="optionValue">
            <option value="{optionValue}" {i:inArray(needle:optionValue, haystack:inData.external_ref.tables, then:'selected="selected"')}>{optionLabel}</option>
        </f:for>
    </select>
</div>

<div class="form-group">
    <label for="externalStaticTables">
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_useStaticRelationsFor"/>
    </label>
    <select
        id="externalStaticTables"
        class="form-select"
        name="tx_impexp[external_static][tables][]"
        multiple="multiple"
        size="{f:if(condition: '{externalStaticTableSelectOptions -> f:count()} > 9', then: '10', else: '5')}"
    >
        <f:for each="{externalStaticTableSelectOptions}" as="optionLabel" key="optionValue">
            <option value="{optionValue}" {i:inArray(needle:optionValue, haystack:inData.external_static.tables, then:'selected="selected"')}>{optionLabel}</option>
        </f:for>
    </select>
</div>

<div class="form-group">
    <label for="checkShowStaticRelations">
        <input type="hidden" name="tx_impexp[showStaticRelations]" value="" />
        <input
            type="checkbox"
            id="checkShowStaticRelations"
            name="tx_impexp[showStaticRelations]"
            value="1"
            {f:if(condition:'{inData.showStaticRelations} == 1', then:'checked="checked"')}
        />
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_showStaticRelations"/>
    </label>
</div>

<div class="form-group">
    <label class="control-label">
        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_excludeElements"/>
    </label>
    <p class="form-control-static">
        <f:if condition="{inData.exclude -> f:count()} > 0">
            <f:then>
                <f:for each="{inData.exclude}" key="key" as="value" iteration="index">
                    <input type="hidden" name="tx_impexp[exclude][{key}]" value="1" />
                    <f:if condition="{index.isLast}">
                        <f:then>{key}</f:then>
                        <f:else>{key},</f:else>
                    </f:if>
                </f:for>
                <div class="form-check">
                    <input type="checkbox" name="tx_impexp[resetExclude]" id="checkResetExclude" value="1" class="form-check-input" />
                    <label for="checkResetExclude" class="form-check-label">
                        <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_clearAllManualExclusions" />
                    </label>
                </div>
            </f:then>
            <f:else>
                <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_noManuallyExcludedElementsYet"/>
            </f:else>
        </f:if>
    </p>
    <p class="form-control-static">
        <div class="form-check">
            <input type="hidden" name="tx_impexp[excludeDisabled]" value="" />
            <input
                type="checkbox"
                id="checkExcludeDisabled"
                class="form-check-input"
                name="tx_impexp[excludeDisabled]"
                value="1"
                {f:if(condition:'{inData.excludeDisabled} == 1', then:'checked="checked"')}
            />
            <label for="checkExcludeDisabled" class="form-check-label">
                <f:translate key="LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeconfig_excludeDisabledElements" />
            </label>
        </div>
    </p>
</div>

<div class="form-group">
    <input
        type="submit"
        class="btn btn-default"
        value="{f:translate(key:'LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:makeadvanc_update')}"
    />
</div>

</html>
