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

<inp2:m_RenderElement name="combined_header" prefix="l.duplicates" section="in-link:duplicate_checker" grid="Duplicates" title_preset="duplicate_links" pagination="1"/>

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

				function edit()
				{
					open_popup('l.duplicates', 'OnStoreSelected', 'in-link/duplicate_checker/duplicate_link_view');
				}

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

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

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

				a_toolbar.Render();

				function set_grouping($prefix_special, $dupe_fields)
				{
					set_hidden_field($prefix_special + '_dupe_fields', $dupe_fields);
					submit_event($prefix_special, 'OnSetGrouping');

				}

				Application.setHook(
					'l.duplicates:OnCreateViewMenu',
					function() {
						// create grouping menu
						$Menus['l.duplicates_grouping_menu'] = menuMgr.createMenu(rs('l.duplicates.grouping.menu'));
						$Menus['l.duplicates_grouping_menu'].applyBorder(false, false, false, false);
						$Menus['l.duplicates_grouping_menu'].dropShadow("none");
						$Menus['l.duplicates_grouping_menu'].showIcon = true;
						<inp2:m_Get name="m_lang" result_to_var="language"/>
						$Menus['l.duplicates_grouping_menu'].addItem(rs('l.duplicates.group.name'), 'Name', 'javascript:set_grouping("l.duplicates", "|l<inp2:m_Param name="language"/>_Name|");' <inp2:m_if check="m_RecallEquals" name="l.duplicates_dupe_fields" value="|l{$language}_Name|">,['img/check_on.gif']</inp2:m_if>);
						$Menus['l.duplicates_grouping_menu'].addItem(rs('l.duplicates.group.url'), 'Url',  'javascript:set_grouping("l.duplicates", "|Url|");' <inp2:m_if check="m_RecallEquals" name="l.duplicates_dupe_fields" value="|Url|">,['img/check_on.gif']</inp2:m_if>);
						$Menus['l.duplicates_grouping_menu'].addItem(rs('l.duplicates.group.name.url'), 'Name <inp2:m_phrase name="la_and"/> Url', 'javascript:set_grouping("l.duplicates", "|l<inp2:m_Param name="language"/>_Name|Url|");' <inp2:m_if check="m_RecallEquals" name="l.duplicates_dupe_fields" value="|l{$language}_Name|Url|">,['img/check_on.gif']</inp2:m_if>);

						// add grouping menu to view menu
						$Menus['l.duplicates_view_menu'].addItem(
							rs('l.duplicates.grouping.menu.item'),
							'<inp2:m_phrase name="la_menu_Grouping"/>',
							'javascript:void()',
							null, true, null,
							rs('l.duplicates.grouping.menu'),
							'<inp2:m_phrase name="la_menu_Grouping"/>'
						);
					}
				);
			</script>
		</td>

		<inp2:m_RenderElement name="search_main_toolbar" prefix="l.duplicates" grid="Duplicates"/>
	</tr>
</tbody>
</table>

<inp2:m_RenderElement name="grid" PrefixSpecial="l.duplicates" IdField="LinkId" grid="Duplicates"/>
<script type="text/javascript">
	Grids['l.duplicates'].SetDependantToolbarButtons( new Array('edit') );
</script>

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