<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:forms" pagination="1" prefix="form" title_preset="forms_list"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%">
<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('form', 'forms/forms_edit');
  			}

  			var a_toolbar = new ToolBar();
				a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_New_Form" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
						function() {
							std_precreate_item('form', 'forms/forms_edit')
						} ) );

				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() {
							std_delete_items('form')
						} ) );

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

				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();
			</script>
		</td>
		<inp2:m_RenderElement name="search_main_toolbar" prefix="form" grid="Default"/>
	</tr>
</tbody>
</table>

<inp2:m_RenderElement name="grid" PrefixSpecial="form" IdField="FormId" grid="Default"/>
<script type="text/javascript">
	Grids['form'].SetDependantToolbarButtons( new Array('edit','delete') );
	<inp2:m_if check="m_GetEquals" name="RefreshTree" value="1">
		var $tree_frame = window.parent.getFrame('menu');
		$tree_frame.location = $tree_frame.location;
	</inp2:m_if>
</script>

<script type="text/javascript">
<inp2:m_if check="m_Recall" var="RefreshStructureTree" value="1">
	<inp2:m_DefineElement name="structure_node"><inp2:m_param name="section_url"/></inp2:m_DefineElement>
	getFrame('menu').location.reload();
	<inp2:m_RemoveVar var="RefreshStructureTree"/>
</inp2:m_if>
</script>

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