<html
    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/backend/element/immediate-action-element.js"/>
    <f:asset.module identifier="@typo3/info/translation-status.js"/>
    <f:if condition="{accessContent}">
        <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:if>
</f:section>

<f:section name="Content">

    <f:if condition="{accessContent}">
        <f:then>
            <h1><f:translate key="LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:lang_title" /></h1>
            <f:if condition="{pageUid}">
                <f:then>
                    <f:if condition="{content}">
                        <f:then>
                            <form action="{f:be.uri(route: 'web_info_translations', parameters: '{id: pageUid}')}" method="post" id="InfoModuleController" name="webinfoForm">
                                <div class="form-row">
                                    <div class="form-group">
                                        <label class="form-label" for="depth">
                                            <f:translate key="LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:moduleFunctions.depth" />
                                        </label>
                                        <f:render partial="DropdownMenu" arguments="{name: 'depth', id: 'depth', options: depthDropdownOptions, currentValue: depthDropdownCurrentValue}"/>
                                    </div>
                                    <f:if condition="{displayLangDropdown}">
                                        <div class="form-group">
                                            <label class="form-label" for="lang">
                                                <f:translate key="LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:moduleFunctions.lang" />
                                            </label>
                                            <f:render partial="DropdownMenu" arguments="{name: 'lang', id: 'lang', options: langDropdownOptions, currentValue: langDropdownCurrentValue}"/>
                                        </div>
                                    </f:if>
                                </div>
                                <f:format.raw>{content}</f:format.raw>
                            </form>
                        </f:then>
                        <f:else>
                            <f:be.infobox
                                message="{f:translate(key:'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:info.noContent.message')}"
                                state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_NOTICE')}"
                            />
                        </f:else>
                    </f:if>
                </f:then>
                <f:else>
                    <f:be.infobox
                        message="{f:translate(key:'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:info.noPageSelected.message')}"
                        state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_INFO')}"
                    />
                </f:else>
            </f:if>
        </f:then>
        <f:else>
            <f:be.infobox
                title="{f:translate(key:'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:error.noAccess.title')}"
                message="{f:translate(key:'LLL:EXT:info/Resources/Private/Language/locallang_webinfo.xlf:error.noAccess.message')}"
                state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_ERROR')}"
            />

        </f:else>
    </f:if>

</f:section>

</html>
