<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/tooltip.js',
            3: '@typo3/backend/utility/collape-state-persister.js',
            4: '@typo3/tstemplate/typo-script-object-browser.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_objbrowser.xlf:objectBrowserTitleWithTemplate"
                    arguments="{
                        0: '{templateTitle}'
                    }"
                />
            </f:then>
            <f:else>
                <f:translate key="LLL:EXT:tstemplate/Resources/Private/Language/locallang_objbrowser.xlf:objectBrowserTitle" />
            </f:else>
        </f:if>
    </h1>

    <f:comment>
        General options
    </f:comment>
    <f:render
        partial="ObjectBrowserOptions"
        arguments="{
            allTemplatesOnPage: allTemplatesOnPage,
            pageUid: pageUid,
            selectedTemplateUid: selectedTemplateUid,
            searchValue: searchValue,
            displayConstantSubstitutions: displayConstantSubstitutions,
            displayComments: displayComments,
            sortAlphabetically: sortAlphabetically
        }"
    />

    <f:comment>
        Constant conditions and tree
    </f:comment>
    <div class="panel-group">
        <f:render
            partial="ObjectBrowserConditions"
            arguments="{
                pageUid: pageUid,
                type: 'constant',
                conditions: constantConditions,
                conditionActiveCount: constantConditionsActiveCount
            }"
        />
        <f:render
            partial="ObjectBrowserTreePanel"
            arguments="{
                type: 'constant',
                tree: constantAst,
                pageUid: pageUid,
                currentObjectPath: constantCurrentObjectPath,
                displayComments: displayComments
            }"
        />
    </div>

    <f:comment>
        Setup conditions and tree
    </f:comment>
    <div class="panel-group">
        <f:render
            partial="ObjectBrowserConditions"
            arguments="{
                pageUid: pageUid,
                type: 'setup',
                conditions: setupConditions,
                conditionActiveCount: setupConditionsActiveCount,
                displayConstantSubstitutions: displayConstantSubstitutions
            }"
        />
        <f:render
            partial="ObjectBrowserTreePanel"
            arguments="{
                type: 'setup',
                tree: setupAst,
                pageUid: pageUid,
                currentObjectPath: setupCurrentObjectPath,
                displayConstantSubstitutions: displayConstantSubstitutions,
                displayComments: displayComments
            }"
        />
    </div>

</f:section>

</html>
