#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">spaceadmin</content>

<table border="0" cellpadding="5" cellspacing="0">
<tr><td width="165" valign="top" nowrap>
    <div class="navmenu">
        #set ($location = "system.space.admin")
        $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"))
							<div class="optionSelected">
						#else
							<div class="optionPadded">
						#end

						#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">
    <!--<div class="pageheader">
        <span class="pagetitle">$params.get("title")</span>
    </div>-->

    $body

</td></tr>
</table>

#parse("/breadcrumbs.vm")
#if ($space)
    <content tag="spacename">$webwork.htmlEncode($space.name)</content>
    <content tag="spacekey">$space.key</content>
    <content tag="spaceadminaction">true</content>
#end
