<html xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" data-namespace-typo3-fluid="true">
<h3 class="dropdown-headline">
    {f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.user')}
</h3>
<hr>
<f:if condition="{modules}">
    <ul class="modulemenu-group-container">
        <f:for each="{modules}" as="module">
            <li>
                <a
                    title="{module.description}"
                    class="modulemenu-action t3js-modulemenu-action"
                    role="menuitem"
                    id="{module.name}"
                    data-modulename="{module.name}"
                    {f:if(condition: module.link, then: 'href="{module.link}"')}
                    {f:if(condition: module.navigationComponentId, then: 'data-navigationcomponentid="{module.navigationComponentId}"')}
                    {f:if(condition: module.navigationFrameScript, then: 'data-navigationframescript="{module.navigationFrameScript}"')}
                    {f:if(condition: module.navigationFrameScriptParameters, then: 'data-navigationframescriptparameters="{module.navigationFrameScriptParameters}"')}
                >
                    <span class="modulemenu-icon" aria-hidden="true"><f:format.raw>{module.icon}</f:format.raw></span>
                    <span class="modulemenu-name">{module.title}</span>
                    <span class="modulemenu-indicator" aria-hidden="true"></span>
                </a>
            </li>
        </f:for>
    </ul>
    <hr>
</f:if>
<f:if condition="{f:count(subject: recentUsers)} > 0">
    <h3 class="dropdown-headline"><f:translate key="usermodule.su.list" /></h3>
    <div class="dropdown-table">
        <f:for each="{recentUsers}" as="user">
            <div class="dropdown-table-row">
                <div class="dropdown-table-column dropdown-table-title">
                    <typo3-backend-switch-user mode="switch" targetUser="{user.uid}">
                        <button type="button" class="modulemenu-action" title="{f:translate(key: 'usermodule.su.tooltip', arguments: '{0: user.username}')}">
                            <be:avatar backendUser="{user.uid}" size="32" />&nbsp;{f:if(condition: user.realName, then: user.realName, else: user.username)}
                        </button>
                    </typo3-backend-switch-user>
                </div>
            </div>
        </f:for>
    </div>
    <hr>
</f:if>
<f:if condition="{switchUserMode}">
    <f:then>
        <typo3-backend-switch-user mode="exit">
            <button type="button" class="btn btn-danger float-start">
                <core:icon identifier="actions-logout" size="small" alternativeMarkupIdentifier="inline"/>
                {f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:buttons.exitSwitchUser')}
            </button>
        </typo3-backend-switch-user>
    </f:then>
    <f:else>
        <a href="{logoutUrl}" class="btn btn-danger float-start" target="_top">
            <core:icon identifier="actions-logout" size="small" alternativeMarkupIdentifier="inline"/>
            {f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:buttons.logout')}
        </a>
    </f:else>
</f:if>
</html>
