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

<f:layout name="Module"/>

<f:section name="Content">

    <f:be.pageRenderer
        includeJavaScriptModules="{
            0: '@typo3/backend/context-menu.js',
            1: '@typo3/backend/element/immediate-action-element.js',
            2: '@typo3/backend/utility/collape-state-persister.js'
        }"
    />

    <f:variable name="args" value="{0: 'web', 1: pageUid}" />
    <typo3-immediate-action action="TYPO3.Backend.Storage.ModuleStateStorage.update" args="{args -> f:format.json() -> f:format.htmlspecialchars()}"></typo3-immediate-action>

    <f:comment>
        Heading
    </f:comment>
    <h1>
        <f:if condition="{templateTitle}">
            <f:then>
                <f:translate
                    key="LLL:EXT:tstemplate/Resources/Private/Language/locallang_analyzer.xlf:analyzerTitleWithTemplate"
                    arguments="{
                        0: '{templateTitle}'
                    }"
                />
            </f:then>
            <f:else>
                <f:translate key="LLL:EXT:tstemplate/Resources/Private/Language/locallang_analyzer.xlf:analyzerTitle" />
            </f:else>
        </f:if>
    </h1>

    <f:comment>
        General options
    </f:comment>
    <f:render
        partial="AnalyzerOptions"
        arguments="{
            allTemplatesOnPage: allTemplatesOnPage,
            pageUid: pageUid,
            selectedTemplateUid: selectedTemplateUid,
            restrictIncludesToMatchingConditionsEnabled: restrictIncludesToMatchingConditionsEnabled
        }"
    />

    <f:comment>
        Constant conditions, source and tree
    </f:comment>
    <div class="panel-group">
        <f:render
            partial="AnalyzerConditions"
            arguments="{
                pageUid: pageUid,
                type: 'constant',
                conditions: constantConditions,
                conditionActiveCount: constantConditionsActiveCount
            }"
        />
        <f:render
            partial="AnalyzerSource"
            arguments="{
                type: 'constant',
                source: constantSource
            }"
        />
        <f:render
            partial="AnalyzerTreePanel"
            arguments="{
                type: 'constant',
                tree: constantIncludeTree,
                pageUid: pageUid,
                restrictIncludesToMatchingConditionsEnabled: restrictIncludesToMatchingConditionsEnabled
            }"
        />
    </div>

    <f:comment>
        Setup conditions, source and tree
    </f:comment>
    <div class="panel-group">
        <f:render
            partial="AnalyzerConditions"
            arguments="{
                pageUid: pageUid,
                type: 'setup',
                conditions: setupConditions,
                conditionActiveCount: setupConditionsActiveCount
            }"
        />
        <f:render
            partial="AnalyzerSource"
            arguments="{
                type: 'setup',
                source: setupSource
            }"
        />
        <f:render
            partial="AnalyzerTreePanel"
            arguments="{
                type: 'setup',
                tree: setupIncludeTree,
                pageUid: pageUid,
                restrictIncludesToMatchingConditionsEnabled: restrictIncludesToMatchingConditionsEnabled
            }"
        />
    </div>
</f:section>

</html>
