<f:layout name="Module" />

<f:section name="Content">

    <f:asset.module identifier="@typo3/backend/settings/editor.js"/>
    <f:for each="{categories}" as="category">
        <f:for each="{category.settings}" as="setting">
            <f:asset.module identifier="{setting.typeImplementation}"/>
        </f:for>
    </f:for>

    <h1>
        <f:translate
            key="LLL:EXT:backend/Resources/Private/Language/locallang_sitesettings.xlf:edit.headline"
            arguments="{0: siteTitle}"
        />
    </h1>

    <f:render partial="SiteManagement/InvalidSets" arguments="{site: site, renderMode: 'infobox'}"/>

    <f:if condition="{categories -> f:count()} == 0">
        <f:then>
            <f:be.infobox
                state="{f:constant(name: 'TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::INFO')}"
                title="{f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_sitesettings.xlf:edit.noSettings.title')}"
            >
                <f:translate
                    key="LLL:EXT:backend/Resources/Private/Language/locallang_sitesettings.xlf:edit.noSettings.message"
                    arguments="{0: site.identifier}"
                />
            </f:be.infobox>
        </f:then>
        <f:else>
            <typo3-backend-settings-editor
                form-name="sitesettings_form"
                action-url="{actionUrl}"
                categories="{categories -> f:format.json()}"
                custom-form-data="{f:format.json(value: {formToken: formToken, returnUrl: returnUrl})}"
                mode="{mode.value}"
                {f:if(condition: "{mode.value} === advanced", then: 'dump-url="{dumpUrl}"')}
            ></typo3-backend-settings-editor>
        </f:else>
    </f:if>

</f:section>
