<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" section="in-portal:user_list" grid="RegularUsers" title_preset="users_list" pagination="1" prefix="u.regular"/>

<!-- 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()
	  			{
	  				set_hidden_field('remove_specials[u.regular]', 1);
	  				std_edit_item('u.regular', 'users/users_edit');
	  			}

	  			var a_toolbar = new ToolBar();
				a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_NewUser" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
						function() {
							set_hidden_field('remove_specials[u.regular]', 1);
							std_precreate_item('u.regular', 'users/users_edit')
						} ) );

				a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_Edit" escape="1"/>', edit) );
				a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
						function() {
							set_hidden_field('remove_specials[u.regular]', 1);
							std_delete_items('u.regular')
						} ) );

				/*a_toolbar.AddButton (
					new ToolBarButton(
						'primary_user_group',
						'<inp2:m_phrase label="la_ToolTip_PrimaryGroup" escape="1"/>::<inp2:m_phrase label="la_ShortToolTip_SetPrimary" escape="1"/>',
						function() {
							openSelector('u.regular', '<inp2:m_Link t="users/group_selector" pass="m,u"/>', 'PrimaryGroupId', '800x600', 'OnSaveSelected');
						}
					)
				);*/

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


				a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
							set_hidden_field('remove_specials[u.regular]', 1);
							submit_event('u.regular', 'OnMassApprove');
						}
				 ) );

				a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
							set_hidden_field('remove_specials[u.regular]', 1);
							submit_event('u.regular', 'OnMassDecline');
						}
				 ) );

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

				<inp2:m_if check="m_ModuleEnabled" module="In-Portal">
					a_toolbar.AddButton(
						new ToolBarButton(
							'e-mail',
							'<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>',
							function() {
								Application.SetVar('remove_specials[u.regular]', 1);
								Application.SetVar('mailing_recipient_type', 'u');
								openSelector('mailing-list', '<inp2:m_Link template="mailing_lists/mailing_list_edit"/>', 'UserEmail', null, 'OnNew');
							}
						)
					);
				</inp2:m_if>

				a_toolbar.AddButton( new ToolBarButton('export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
							set_hidden_field('remove_specials[u.regular]', 1);
							std_csv_export('u.regular', 'RegularUsers', 'export/export_progress');
						}
				) );

				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();
			</script>
		</td>

		<inp2:m_RenderElement name="search_main_toolbar" prefix="u.regular" grid="RegularUsers"/>
	</tr>
</tbody>
</table>

<inp2:m_RenderElement name="grid" PrefixSpecial="u.regular" IdField="PortalUserId" grid="RegularUsers" menu_filters="yes"/>
<script type="text/javascript">
	Grids['u.regular'].SetDependantToolbarButtons( new Array('edit', 'delete', 'e-mail', 'approve', 'decline') );
</script>
<inp2:m_include t="incs/footer"/>