#set ($selectedTab = $params.get("selectedTab"))
#set ($helper   = $params.get("helper"))

#* this effectively stops the header from showing in the space admin pages *#
<content tag="no-page-header">true</content>
<content tag="spaceop">browse</content>
<content tag="selectedTab">advanced</content>

<table border=0 width="100%" cellpadding="5" cellspacing="0">
<tr><td width="180" valign="top" nowrap>
    <div class="navmenu">
    #set ($location = "system.space.advanced")
    $generalUtil.profilePush($location)
    #foreach ($section in $webInterfaceManager.getDisplayableSections($location, $action.webInterfaceContext))
        #set ($sectionKey = "$location/$section.key")
        $generalUtil.profilePush($sectionKey)
        #set ($displayableItems = $webInterfaceManager.getDisplayableItems($sectionKey, $action.webInterfaceContext))

        #if (!$displayableItems.isEmpty())
            #if ($section.label.key)
                #set ($label = $action.getText($section.label.key))
            #else
                #set ($label = $section.label.noKeyValue)
            #end

            <div class="menuheading">$label</div>
            <div class="menuitems">
                #foreach ($item in $displayableItems)
                    #if ($item.key == $params.get("selection"))
                        #set($itemClassName = "optionSelected")
                    #else
                        #set($itemClassName = "optionPadded")
                    #end
                    <div class="menu-item $itemClassName">

                    #set ($itemLabel = $item.label.getDisplayableLabel($req, $action.webInterfaceContext))
                    #set ($itemRenderedUrl = $item.link.getDisplayableUrl($req, $action.webInterfaceContext))
                    #if ($item.icon)
                        #set ($icon = $item.icon)
                        <a href="$itemRenderedUrl"><img src="$icon.url.getDisplayableUrl($req, $action.webInterfaceContext)" height="$icon.height" width="$icon.width" border="0" align="absmiddle" title="$itemLabel"></a>
                    #else
                        <img src="$staticResourceUrlPrefix/images/icons/bullet_creme.gif" height=8 width=8 alt="">
                    #end
                    <a href="$itemRenderedUrl">$itemLabel</a>
                    </div>
                #end
            </div>
        #end
        $generalUtil.profilePop($sectionKey)
    #end
    $generalUtil.profilePop($location)
    </div>

</td>
<td valign="top">
    $body
</td></tr>
</table>

#parse ( "/breadcrumbs.vm" )

#if ($helper.spaceKey)
    <content tag="spacename">$helper.spaceName</content>
    <content tag="spacekey">$helper.spaceKey</content>
    <content tag="spaceaction">true</content>
#end

