<inp2:m_DefineElement name="nlsmenu_sort_block">
	$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.sort.<inp2:m_param name="sort_field"/>'), '<inp2:m_phrase name="$title" html_escape="1" js_escape="1"/>','javascript:direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:m_param name="sort_field"/>","<inp2:{$PrefixSpecial}_OrderInfo type="direction" pos="1"/>", null, <inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_IsOrder" field="$sort_field" pos="1">,['img/menu_dot.gif']</inp2:m_if>);
</inp2:m_DefineElement>

<inp2:m_DefineElement name="nlsmenu_filter_block">
	$Menus['<inp2:m_Param name="menu_name"/>'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.filter.<inp2:m_param name="label" escape="1"/>', true), '<inp2:m_param name="label" html_escape="1"/>', 'javascript:<inp2:m_param name="filter_action" js_escape="1"/>',<inp2:m_param name="filter_status"/>);
</inp2:m_DefineElement>

<inp2:m_DefineElement name="nlsmenu_auto_refresh_element">
	$Menus['<inp2:m_Param name="menu_name"/>'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.refresh_interval.<inp2:m_Param name="refresh_interval"/>'), '<inp2:m_param name="label" js_escape="1" html_escape="1"/>', 'javascript:set_refresh_interval("<inp2:m_Param name="PrefixSpecial"/>", <inp2:m_Param name="refresh_interval"/>, <inp2:m_Param name="ajax"/>)'<inp2:m_if check="m_Param" name="selected">, ['img/menu_dot.gif']</inp2:m_if>);
</inp2:m_DefineElement>

<inp2:m_DefineElement name="nlsmenu_filter_separator">
	$Menus['<inp2:m_Param name="menu_name"/>'].addSeparator();
</inp2:m_DefineElement>

<inp2:m_DefineElement name="nlsmenu_declaration" menu_columns="yes" menu_auto_refresh="yes" menu_filters="no" menu_sorting="yes" menu_perpage="yes" menu_select="yes" ajax="0">
	// define ViewMenu

		<inp2:m_if check="m_ParamEquals" name="menu_auto_refresh" value="yes">
			// auto refresh menu
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_auto_refresh_menu'] = menuMgr.createMenu(rs('<inp2:m_param name="PrefixSpecial"/>.auto_refresh.menu'));
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_auto_refresh_menu'].applyBorder(false, false, false, false);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_auto_refresh_menu'].dropShadow("none");
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_auto_refresh_menu'].showIcon = true;
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_auto_refresh_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.auto_refresh.enabled'), '<inp2:m_Phrase name="la_Enabled" html_escape="1" js_escape="1"/>', 'javascript:submit_event("<inp2:m_param name="PrefixSpecial"/>", "OnAutoRefreshToggle");'<inp2:m_if check="{$PrefixSpecial}_UseAutoRefresh">, ['img/check_on.gif']</inp2:m_if>);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_auto_refresh_menu'].addSeparator();
			<inp2:{$PrefixSpecial}_DrawAutoRefreshMenu render_as="nlsmenu_auto_refresh_element" menu_name="{$PrefixSpecial}_auto_refresh_menu" ajax="$ajax"/>
		</inp2:m_if>

		<inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
			// filtring menu
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'] = menuMgr.createMenu(rs('<inp2:m_param name="PrefixSpecial"/>.filter.menu'));
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].applyBorder(false, false, false, false);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].dropShadow("none");
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].showIcon = true;
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.filter.all'), '<inp2:m_Phrase name="la_Text_All" html_escape="1" js_escape="1"/>','javascript:filters_remove_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.filter.none'), '<inp2:m_Phrase name="la_Text_None" html_escape="1" js_escape="1"/>','javascript:filters_apply_all("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_filter_menu'].addSeparator();
			<inp2:{$PrefixSpecial}_DrawFilterMenu item_block="nlsmenu_filter_block" spearator_block="nlsmenu_filter_separator" menu_name="{$PrefixSpecial}_filter_menu" ajax="$ajax"/>
		</inp2:m_if>

		<inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
			// sorting menu
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'] = menuMgr.createMenu(rs('<inp2:m_param name="PrefixSpecial"/>.sorting.menu'));
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].applyBorder(false, false, false, false);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].dropShadow("none");
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].showIcon = true;
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.sort.asc'), '<inp2:m_phrase name="la_common_ascending" html_escape="1" js_escape="1"/>','javascript:direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:{$PrefixSpecial}_OrderInfo type="field" pos="1"/>","asc",null,<inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_IsOrder" direction="asc" pos="1" >,['img/menu_dot.gif']</inp2:m_if>);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.sort.desc'), '<inp2:m_phrase name="la_common_descending" html_escape="1" js_escape="1"/>','javascript:direct_sort_grid("<inp2:m_param name="PrefixSpecial"/>","<inp2:{$PrefixSpecial}_OrderInfo type="field" pos="1"/>","desc",null,<inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_IsOrder" direction="desc" pos="1" >,['img/menu_dot.gif']</inp2:m_if>);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addSeparator();
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_sorting_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.sort.def'), '<inp2:m_phrase name="la_Text_Default" html_escape="1" js_escape="1"/>','javascript:reset_sorting("<inp2:m_param name="PrefixSpecial"/>", <inp2:m_param name="ajax"/>);');
			<inp2:{$PrefixSpecial}_IterateGridFields grid="$grid" mode="header" force_block="nlsmenu_sort_block" ajax="$ajax"/>
		</inp2:m_if>

		<inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
			// per page menu
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'] = menuMgr.createMenu(rs('<inp2:m_param name="PrefixSpecial"/>.perpage.menu'));
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].applyBorder(false, false, false, false);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].dropShadow("none");
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].showIcon = true;
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.perpage.10'), '10','javascript:set_per_page("<inp2:m_param name="PrefixSpecial"/>",10,<inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_PerPageEquals" value="10" >,['img/check_on.gif']</inp2:m_if>);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.perpage.20'), '20','javascript:set_per_page("<inp2:m_param name="PrefixSpecial"/>",20,<inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_PerPageEquals" value="20" >,['img/check_on.gif']</inp2:m_if>);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.perpage.50'), '50','javascript:set_per_page("<inp2:m_param name="PrefixSpecial"/>",50,<inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_PerPageEquals" value="50" >,['img/check_on.gif']</inp2:m_if>);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.perpage.100'), '100','javascript:set_per_page("<inp2:m_param name="PrefixSpecial"/>",100,<inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_PerPageEquals" value="100" >,['img/check_on.gif']</inp2:m_if>);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_perpage_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.perpage.500'), '500','javascript:set_per_page("<inp2:m_param name="PrefixSpecial"/>",500,<inp2:m_param name="ajax"/>);'<inp2:m_if check="{$PrefixSpecial}_PerPageEquals" value="500" >,['img/check_on.gif']</inp2:m_if>);
		</inp2:m_if>

		<inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
			// select menu
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'] = menuMgr.createMenu(rs('<inp2:m_param name="PrefixSpecial"/>.select.menu'));
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].applyBorder(false, false, false, false);
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].dropShadow("none");
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].showIcon = true;
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.select.all'), '<inp2:m_phrase name="la_Text_All" html_escape="1" js_escape="1"/>','javascript:Grids["<inp2:m_param name="PrefixSpecial"/>"].SelectAll();');
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.unselect'), '<inp2:m_phrase name="la_Text_Unselect" html_escape="1" js_escape="1"/>','javascript:Grids["<inp2:m_param name="PrefixSpecial"/>"].ClearSelection();');
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_select_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.invert'), '<inp2:m_phrase name="la_Text_Invert" html_escape="1" js_escape="1"/>','javascript:Grids["<inp2:m_param name="PrefixSpecial"/>"].InvertSelection();');
		</inp2:m_if>

		$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = menuMgr.createMenu(rs('<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'));
		$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].applyBorder(false, false, false, false);
		$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].dropShadow("none");
		$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].showIcon = true;

		<inp2:m_if check="m_ParamEquals" name="menu_columns" value="yes">
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.columns'),'<inp2:m_Phrase label="la_SelectColumns" html_escape="1" js_escape="1"/>','javascript:openSelector("<inp2:m_param name="PrefixSpecial"/>", "<inp2:m_Link template="popups/column_picker" grid_name="$grid" no_amp="1"/>")');
			<!--##
			// currently the widths are saved automatically shortly after it have been changed
			// $Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.save_view'),'<inp2:m_Phrase label="la_SaveView" escape="1"/>','javascript:myGrid.SaveWidths()');
			##-->
		</inp2:m_if>

		<inp2:m_if check="m_ParamEquals" name="menu_auto_refresh" value="yes">
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.auto_refresh'), '<inp2:m_phrase name="la_text_AutoRefresh" html_escape="1" js_escape="1"/>', 'javascript:void()', null, true, null, rs('<inp2:m_param name="PrefixSpecial"/>.auto_refresh.menu'), null);
		</inp2:m_if>

		<inp2:m_if check="m_ParamEquals" name="menu_filters" value="yes">
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.filters'), '<inp2:m_phrase name="la_Text_View" html_escape="1" js_escape="1"/>', 'javascript:void()', null, true, null, rs('<inp2:m_param name="PrefixSpecial"/>.filter.menu'), null);
		</inp2:m_if>
		<inp2:m_if check="m_ParamEquals" name="menu_sorting" value="yes">
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.sorting'), '<inp2:m_phrase name="la_Text_Sort" html_escape="1" js_escape="1"/>', 'javascript:void()', null, true, null, rs('<inp2:m_param name="PrefixSpecial"/>.sorting.menu'), null);
		</inp2:m_if>
		<inp2:m_if check="m_ParamEquals" name="menu_perpage" value="yes">
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.perpage'), '<inp2:m_phrase name="la_prompt_PerPage" html_escape="1" js_escape="1"/>', 'javascript:void()', null, true, null, rs('<inp2:m_param name="PrefixSpecial"/>.perpage.menu'), null);
		</inp2:m_if>
		<inp2:m_if check="m_ParamEquals" name="menu_select" value="yes">
			$Menus['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'].addItem(rs('<inp2:m_param name="PrefixSpecial"/>.select'), '<inp2:m_phrase name="la_Text_Select" html_escape="1" js_escape="1"/>', 'javascript:void()', null, true, null, rs('<inp2:m_param name="PrefixSpecial"/>.select.menu'), null);
		</inp2:m_if>

		$MenuNames['<inp2:m_param name="PrefixSpecial"/>'+'_view_menu'] = '<inp2:{$PrefixSpecial}_GetItemName js_escape="1"/>';

		Application.processHooks('<inp2:m_param name="PrefixSpecial"/>:OnCreateViewMenu');
</inp2:m_DefineElement>