<inp2:adm_SetPopupSize width="720" height="500"/>

<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" prefix="u" title_preset="user_edit_groups" tab_preset="Default" pagination="1" pagination_prefix="u-ug"/>

<!-- 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_temp_item('u-ug', 'users/user_edit_group');
	  			}

	  			a_toolbar = new ToolBar();

	  			a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
							submit_event('u','<inp2:u_SaveEvent/>');
						}
					) );
				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
							cancel_edit('u','OnCancelEdit','<inp2:u_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
						}
				 ) );

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

				a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
							go_to_id('u', '<inp2:u_PrevId/>');
						}
				 ) );
				a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
							go_to_id('u', '<inp2:u_NextId/>');
						}
				 ) );

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

				a_toolbar.AddButton( new ToolBarButton('select_user', '<inp2:m_phrase label="la_ToolTip_AddToGroup" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
						function() {
							openSelector('u-ug', '<inp2:m_Link t="users/group_selector" pass="m,u" no_amp="1" js_escape="1"/>', 'GroupId', '800x600');
						} ) );

				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('u-ug');
						} ) );

				a_toolbar.AddButton( new ToolBarButton('setprimary', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>',
						function() {
							submit_event('u-ug','OnSetPrimary');
						} ) );


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

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

				a_toolbar.Render();

				<inp2:m_if check="u_IsSingle" >
					a_toolbar.HideButton('prev');
					a_toolbar.HideButton('next');
					a_toolbar.HideButton('sep2');
				<inp2:m_else/>
					<inp2:m_if check="u_IsLast" >
						a_toolbar.DisableButton('next');
					</inp2:m_if>
					<inp2:m_if check="u_IsFirst" >
						a_toolbar.DisableButton('prev');
					</inp2:m_if>
				</inp2:m_if>
			</script>

		</td>

		<inp2:m_RenderElement name="search_main_toolbar" prefix="u-ug" grid="Default"/>
	</tr>
</tbody>
</table>

<inp2:m_DefineElement name="grid_membership_td" no_special="">
	<inp2:m_if check="Field" name="$field" db="db">
		<inp2:Field field="$field" first_chars="$first_chars" nl2br="$nl2br" grid="$grid" no_special="$no_special" format="$format"/>
	<inp2:m_else/>
		<inp2:m_phrase name="la_NeverExpires"/>
	</inp2:m_if>
</inp2:m_DefineElement>

<inp2:m_RenderElement name="grid" PrefixSpecial="u-ug" IdField="GroupId" grid="Default"/>
<script type="text/javascript">
	Grids['u-ug'].SetDependantToolbarButtons( new Array('delete', 'edit', 'setprimary') );
</script>

<input type="hidden" name="u_mode" value="t<inp2:m_Get var="m_wid" />" />

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