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

<inp2:m_RenderElement name="combined_header" section="in-portal:configemail" pagination="1" prefix="emailevents" grid="Emails" title_preset="email_message_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('emailevents', 'languages/email_message_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('emailevents', 'languages/email_message_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('emailevents');
					</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('emailevents', 'OnMassApprove');
					</inp2:m_RenderElement>

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

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

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

				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="emailevents" 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="emailevents" IdField="EventId" grid="Emails" row_class_render_as="row_class"/>
<script type="text/javascript">
	Grids['emailevents'].SetDependantToolbarButtons( new Array('edit', 'delete', 'approve', 'decline', 'frontend_mail') );
</script>
<inp2:m_include t="incs/footer"/>