<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-link:link_validation" prefix="link-validation" title_preset="link_validation_list" pagination="1"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
	  	<td>
	  		<script type="text/javascript">
	  			//do not rename - this function is used in default grid for double click!
	  			function edit()
	  			{
					std_edit_item('l', 'in-link/links/links_edit');
	  			}

	  			var a_toolbar = new ToolBar();

	  			a_toolbar.AddButton(
					new ToolBarButton(
						'in-link:validate_continue',
						'<inp2:m_phrase label="la_ToolTip_ContinueValidation" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Continue" escape="1"/>',
						function() {
							Application.SetVar('progress_template', 'in-link/link_validation/link_validation_progress');
							submit_event('link-validation', 'OnContinueValidation');
						}
					)
				);

				a_toolbar.AddButton(
					new ToolBarButton(
						'in-link:validate_restart',
						'<inp2:m_phrase label="la_ToolTip_NewValidation" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_New" escape="1"/>',
						function() {
							Application.SetVar('progress_template', 'in-link/link_validation/link_validation_progress');
							submit_event('link-validation', 'OnRestartValidation');
						}
					)
				);

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

				a_toolbar.AddButton(
					new ToolBarButton(
						'in-link:validate',
						'<inp2:m_phrase label="la_ToolTip_ValidateSelected" escape="1"/>',
						function() {
							Application.SetVar('progress_template', 'in-link/link_validation/link_validation_progress');
							submit_event('link-validation', 'OnValidateSelected');
						}
					)
				);

				a_toolbar.AddButton(
					new ToolBarButton(
						'in-link:validate_reset',
						'<inp2:m_phrase label="la_ToolTip_ResetValidationStatus" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_ResetValidationStatus" escape="1"/>',
						function() {
							submit_event('link-validation', 'OnResetValidationStatus');
						}
					)
				);

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

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

				a_toolbar.AddButton(
					new ToolBarButton(
						'delete',
						'<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
						function() {
							var phrase = phrases['la_Delete_Confirm'] ? phrases['la_Delete_Confirm'] : 'Are you sure you want to delete selected items?';
							if (inpConfirm(phrase)) {
						  		submit_event('link-validation', 'OnDeleteLinks');
							}
						}
					)
				);

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

				a_toolbar.AddButton(
					new ToolBarButton(
						'approve',
						'<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>',
						function() {
							submit_event('link-validation', 'OnApproveLinks');
						}
					)
				);

				a_toolbar.AddButton(
					new ToolBarButton(
						'decline',
						'<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>',
						function() {
							submit_event('link-validation', 'OnDeclineLinks');
						}
					)
				);

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

				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="link-validation" grid="Default"/>
	</tr>
</tbody>
</table>

<inp2:m_DefineElement name="grid_url_td" format="" nl2br="" first_chars="" td_style="" currency="">
	<a href="<inp2:FormatUrl field='$field'/>"><inp2:Field field='$field' first_chars="30"/></a>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="grid_link_name_td" format="" nl2br="" first_chars="" td_style="" currency="">
	<inp2:Field field='$field' first_chars="$first_chars"/><br />
	<span class="small-statistics">
		<inp2:Field name="CategoryId" db="db" result_to_var="item_category"/>
		<inp2:m_Phrase name="la_fld_Category"/>: <a href="<inp2:m_Link template="catalog/catalog" m_cat_id="$item_category"/>"><inp2:CategoryName /></a>
	</span>
</inp2:m_DefineElement>


<inp2:m_RenderElement name="grid" PrefixSpecial="link-validation" IdField="ForeignLinkId" grid="Default"/>
<script type="text/javascript">
	Grids['link-validation'].SetDependantToolbarButtons( new Array('validate', 'validate_reset', 'edit', 'approve', 'decline', 'delete') );
</script>
<inp2:m_include t="incs/footer"/>