<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:configemail" pagination="1" prefix="emailmessages.st" grid="Emails" title_preset="email_messages_direct_list"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
  		<td>
  			<script type="text/javascript">

  				function edit()
	  			{
	  				set_hidden_field('remove_specials[emailmessages.st]', 1);
	  				std_edit_item('emailmessages.st', 'languages/email_message_edit');
	  			}

  				a_toolbar = new ToolBar();
				a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );

				<inp2:m_if check="m_IsDebugMode">
					a_toolbar.AddButton( new ToolBarSeparator('sep1') );

					a_toolbar.AddButton(
						new ToolBarButton(
							'approve',
							'<inp2:m_phrase label="la_ToolTip_Enable" escape="1"/>',
							function() {
								set_hidden_field('remove_specials[emailmessages.st]', 1);
								submit_event('emailmessages.st', 'OnMassApprove');
							}
						)
					);

					a_toolbar.AddButton(
						new ToolBarButton(
							'decline',
							'<inp2:m_phrase label="la_ToolTip_Disable" escape="1"/>',
							function() {
								set_hidden_field('remove_specials[emailmessages.st]', 1);
								submit_event('emailmessages.st', 'OnMassDecline');
							}
						)
					);
				</inp2:m_if>

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

				a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
							show_viewmenu(a_toolbar,'view');
						}
				) );

				a_toolbar.Render();

			</script>
		</td>
		<inp2:m_RenderElement name="search_main_toolbar" prefix="emailmessages.st" 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="emailmessages.st" IdField="EmailMessageId" grid="Emails" row_class_render_as="row_class"/>
<script type="text/javascript">
	Grids['emailmessages.st'].SetDependantToolbarButtons( new Array('edit', 'approve', 'decline') );
</script>
<inp2:m_include t="incs/footer"/>