#set ($portlet_display = $portletDisplay)

#set ($portlet_id = $htmlUtil.escape($portlet_display.getId()))
#set ($portlet_title = $portlet_display.getTitle())
#set ($portlet_description = $portlet_display.getDescription())
#set ($portlet_back_url = $htmlUtil.escape($portlet_display.getURLBack()))
#set ($show_portlet_description = $sessionClicks.get($request, "show-portlet-description-$portlet_id", "true"))
#set ($valid_portlet_description = $validator.isNotNull($portlet_description) && $portlet_description.indexOf('javax.portlet.description') == -1)

<section class="portlet" id="portlet_$portlet_id">
	<header class="portlet-topper">
		<h1 class="portlet-title" id="cpPortletTitle">
			<span class="portlet-title-text">$portlet_title</span>

			#if ($valid_portlet_description)
				<img id="cpPortletTitleHelpIcon" src="$themeDisplay.getPathThemeImages()/portlet/help.png" />
			#end
		</h1>

		<menu class="portlet-topper-toolbar" id="portlet-topper-toolbar_$portlet_id" type="portlet-topper-toolbar">
			#if ($portlet_display.isShowBackIcon())
				<a href="$portlet_back_url" class="portlet-icon-back">#language ("return-to-full-page")</a>
			#else
				$theme.iconOptions()
			#end
		</menu>
	</header>

	#if ($valid_portlet_description)
		<div id="cpContextPanelTemplate" class="aui-helper-hidden" data-portlet-id="$portlet_id" data-visible-panel="$show_portlet_description">
			$portlet_description
		</div>
	#end

	<div class="portlet-content">
		$portlet_display.writeContent($writer)
	</div>
</section>