<inp2:m_include t="incs/header"/>

<inp2:m_RenderElement name="combined_header" section="in-portal:configemail" pagination="1" prefix="email-template" grid="Emails" title_preset="email_template_list" additional_blue_bar_render_as="grid_ml_selector"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
  		<td>
  			<script type="text/javascript">
  				function edit() {
	  				std_edit_item('email-template', 'languages/email_template_edit');
	  			}

  				a_toolbar = new ToolBar();

  				<inp2:m_if check="m_IsDebugMode">
					<inp2:m_RenderElement design="toolbar_button" icon="new_item" title="la_ToolTip_Add">
						std_precreate_item('email-template', 'languages/email_template_edit');
					</inp2:m_RenderElement>
				</inp2:m_if>

				<inp2:m_RenderElement design="toolbar_button" icon="edit" title="la_ToolTip_Edit" short_title="la_ShortToolTip_Edit">
					edit();
				</inp2:m_RenderElement>

				<inp2:m_if check="m_IsDebugMode">
					<inp2:m_RenderElement design="toolbar_button" icon="delete" title="la_ToolTip_Delete">
						std_delete_items('email-template');
					</inp2:m_RenderElement>
				</inp2:m_if>

				a_toolbar.AddButton( new ToolBarSeparator('sep1') );

				<inp2:m_if check="m_IsDebugMode">
					<inp2:m_RenderElement design="toolbar_button" icon="approve" title="la_ToolTip_Enable">
						  submit_event('email-template', 'OnMassApprove');
					</inp2:m_RenderElement>

				  	<inp2:m_RenderElement design="toolbar_button" icon="decline" title="la_ToolTip_Disable">
				  		submit_event('email-template', 'OnMassDecline');
				  	</inp2:m_RenderElement>
				</inp2:m_if>

				<inp2:m_RenderElement design="toolbar_button" icon="frontend_mail" title="la_ToolTip_Email_FrontOnly">
					submit_event('email-template', 'OnFrontOnly');
				</inp2:m_RenderElement>

				<inp2:m_RenderElement design="toolbar_button" icon="export" title="la_ToolTip_Export" short_title="la_ShortToolTip_Export">
					open_popup('email-template', 'OnExportEmailTemplates', 'regional/languages_export');
				</inp2:m_RenderElement>

				<inp2:m_if check="m_IsDebugMode">
					<inp2:m_RenderElement design="toolbar_button" icon="process" title="la_ToolTip_Send">
						submit_event('email-template', 'OnSend');
					</inp2:m_RenderElement>
				</inp2:m_if>

				a_toolbar.AddButton( new ToolBarSeparator('sep2') );

				<inp2:m_RenderElement design="toolbar_button" icon="view" title="la_ToolTip_View">
					show_viewmenu(a_toolbar,'view');
				</inp2:m_RenderElement>

				a_toolbar.Render();
			</script>
		</td>
		<inp2:m_RenderElement name="search_main_toolbar" prefix="email-template" grid="Emails"/>
	</tr>
</tbody>
</table>

<style type="text/css">
	tr.row-disabled td {
		background-color: #FFDFE0;
	}

	tr.grid-data-row-even.row-disabled td {
		background-color: #F4D4D5;
	}
</style>

<inp2:m_DefineElement name="row_class">
	<inp2:m_ifnot check="Field" field="Enabled" db="db">
		row-disabled
	</inp2:m_ifnot>
</inp2:m_DefineElement>

<inp2:m_RenderElement name="grid" PrefixSpecial="email-template" IdField="TemplateId" grid="Emails" row_class_render_as="row_class"/>
<script type="text/javascript">
	Grids['email-template'].SetDependantToolbarButtons( new Array('edit', 'delete', 'approve', 'decline', 'frontend_mail', 'process') );
</script>
<inp2:m_include t="incs/footer"/>