
<!-- HTML for the sections/options/controls in the slot drop-down menus -->

<%
	var css = m.tuix.css_class,
		showSlotInEditMode = false,
		showSlotInLayoutMode = false,
		slot = zenario.slots[m.slotName],
		cName, control,
		sName, si, section,
		sections = ['info', 'notes', 'actions', 'switch_to', 're_move_place', 'overridden_info', 'overridden_actions', 'no_perms'];
%>


<% foreach (sections as si => sName) { %>
	<% if (!_.isEmpty(section = m.tuix[sName])) { %>
		<div
			class="zenario_slotControlsSection zenario_slotControlsWrap_{{sName|escape}}"
			
			<% switch (sName) { %>
				<% case 'actions': %>
				<% case 're_move_place': %>
				<% case 'overridden_actions': %>
				<% case 'no_perms': %>
				<% case 'switch_to': %>
					onclick="zenarioA.closeSlotControls();"
			<% } %>
		>
			<% foreach (section as cName => control) { %>
				
				<% if (zenarioA.slotControlVisible(control, m)) { %>
					<% var page_modes = control.page_modes || {}; %>
					
					<div
						id="zenario_slot_control__{{m.slotName|escape}}__{{sName|escape}}__{{cName|escape}}"
						class="
							zenario_sc
							
							<% if (page_modes.edit) { %>
								<% showSlotInEditMode = true; %>
								
								zenario_showInEditMode
							<% } else { %>
								zenario_hideInEditMode
							<% } %>
							
							<% if (page_modes.layout) { %>
								<% showSlotInLayoutMode = true; %>
								
								zenario_showInLayoutMode
							<% } else { %>
								zenario_hideInLayoutMode
							<% } %>
							
							{{control.css_class|escape}}
						"
							
						data-slotname="{{m.slotName|escape}}"
						
						<% if (control.onclick) { %>
							href="#"
							onclick="
								var slotName = '{{m.slotName|escape}}',
									slot = zenario.slots[slotName],
									instanceId = slot.instanceId,
									moduleId = slot.moduleId;
								
								{{control.onclick|escape}}
							"
						<% } %>
					>
						
						
						<% if (control.link_to_new_tab) { %>
							<a
								target="_blank"
								class="plugins_optional_link_to_new_tab"
								href="{{control.link_to_new_tab|escape}}"
								onclick="return false;"
							>{{control.label}}</a>
						<% } else { %>
							{{control.label}}
						<% } %>
					</div>
				<% } %>
			<% } %>
		</div>
	<% } %>
<% } %>



<!-- Set the CSS class for the slot's admin wrapper/slot controls -->

<% if (slot.beingEdited) { %>
	<% css += ' zenario_slot_being_edited'; %>
<% } %>

<% if (showSlotInEditMode) { %>
	<% css += ' zenario_showSlotInEditMode'; %>
<% } else { %>
	<% css += ' zenario_hideSlotInEditMode'; %>
<% } %>

<% if (showSlotInLayoutMode) { %>
	<% css += ' zenario_showSlotInLayoutMode'; %>
<% } else { %>
	<% css += ' zenario_hideSlotInLayoutMode'; %>
<% } %>

<% if (slot.isSitewide) { %>
	<% css += ' zenario_sitewideSlotWrap'; %>
<% } else { %>
	<% css += ' zenario_bodySlotWrap'; %>
<% } %>

<% if (slot.isHeader) { %>
	<% css += ' zenario_headerSlotWrap'; %>
<% } %>

<% if (slot.isFooter) { %>
	<% css += ' zenario_footerSlotWrap'; %>
<% } %>

<% zenario.get(m.containerId + '-wrap').className = css; %>

