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

<p class="h3 dropdown-headline"><f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:toolbarItems.workspace" /></p>
<ul class="dropdown-list">
    <f:if condition="{topItem}">
        <f:then>
            <f:render section="workspaceItem" arguments="{item: topItem}" />
        </f:then>
        <f:else>
            <li>
                <f:comment>no items on top (= no workspace to work in)</f:comment>
                <p class="dropdown-item-text">
                    <f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:bookmark_noWSfound" />
                </p>
            </li>
        </f:else>
    </f:if>
    <f:if condition="{additionalItems}">
        <f:for each="{additionalItems}" as="item">
            <f:render section="workspaceItem" arguments="{item: item}" />
        </f:for>
    </f:if>
</ul>


<f:if condition="{showLinkToModule}">
    <hr class="dropdown-divider" aria-hidden="true">
    <a href="#" target="list_frame" data-module="workspaces_admin" class="dropdown-item t3js-workspaces-modulelink">
        <f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:bookmark_workspace" />
    </a>
</f:if>

<f:section name="workspaceItem">
    <li class="t3js-workspace-item">
        <a href="{item.link}" data-workspaceid="{item.workspaceId}" class="dropdown-item t3js-workspaces-switchlink {item.isActive ? 'active' : ''}">
            <span class="dropdown-item-columns">
                <span class="dropdown-item-column dropdown-item-column-title">
                    {item.label -> f:format.htmlspecialchars()}
                </span>
            </span>
        </a>
    </li>
</f:section>

</html>
