<inp2:m_include t="incs/header" />
<inp2:m_RenderElement name="combined_header" section="in-portal:change_logs" prefix="change-log" title_preset="change_log_list" pagination="1"/>

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

								function edit() {
								  	std_edit_item('change-log', 'logs/change_logs/change_log_edit');
								}

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

								a_toolbar.AddButton(
									new ToolBarButton(
										'delete',
										'<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
										function() {
											std_delete_items('change-log')
										}
									)
								);

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

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

								a_toolbar.Render();

								<inp2:m_ifnot check="m_GetConfig" var="UseChangeLog">
									function enable_log() {
										if ( confirm('<inp2:m_Phrase name="la_msg_EnableTrackingDatabaseChangesToChangeLog" js_escape="1"/>') ) {
											submit_event('change-log', 'OnEnableLog');
										}
									}
								</inp2:m_ifnot>
							</script>
		  				</td>

		  				<inp2:m_RenderElement name="search_main_toolbar" prefix="change-log" grid="Default"/>
		  			</tr>
		  		</table>
			</td>
		</tr>
	</tbody>
</table>

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

	tr.row-update td {
		background-color: #FFFFE6;
	}

	tr.row-delete td {
		background-color: #FFE6E6;
	}
</style>

<inp2:m_DefineElement name="row_class">
	<inp2:m_if check="FieldEquals" field="Action" value="1">
		row-create
	<inp2:m_else/>
		<inp2:m_if check="FieldEquals" field="Action" value="2">
			row-update
		<inp2:m_else/>
			row-delete
		</inp2:m_if>
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_changes_td" format="" nl2br="" first_chars="" td_style="">
	<inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="1" format="$format"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="enable_change_log_link">
	<a href="javascript:enable_log()"><inp2:m_Phrase name="la_config_UseChangeLog"/></a>
</inp2:m_DefineElement>

<inp2:m_ifnot check="m_GetConfig" var="UseChangeLog">
	<inp2:m_RenderElement design="form_message">
		<inp2:change-log_EnableChangeLogMessage phrase="la_msg_ChangeLogIsCurrentlyDisabledTurnOnSettingToEnableIt" link_render_as="enable_change_log_link"/>
	</inp2:m_RenderElement>
</inp2:m_ifnot>


<inp2:m_RenderElement name="grid" PrefixSpecial="change-log" IdField="ChangeLogId" grid="Default" row_class_render_as="row_class"/>
<script type="text/javascript">
	Grids['change-log'].SetDependantToolbarButtons( new Array('edit', 'delete') );
</script>

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