<?php

if (!defined('XOOPS_ROOT_PATH')) exit();

require_once USER_TRUST_PATH . "/admin/forms/UserSearchForm.class.php";
require_once USER_TRUST_PATH . '/class/core/User.class.php';
class User_UserSearchAction extends User_Action
{
	var $mActionForm = null;
	
	function prepare(&$controller, &$xoopsUser)
	{
	}
	
	function getDefaultView(&$controller, &$xoopsUser)
	{
		return USER_FRAME_VIEW_INPUT;
	}
	
	function execute(&$controller, &$xoopsUser)
	{
		return USER_FRAME_VIEW_INPUT;
	}
	function executeViewInput(&$controller, &$xoopsUser, &$render)
	{
		$user = User_User::getInstance();
		$render->setTemplateName('user_search.html');
		$searchView = $user->getSearchViewForModerator();
		if ( isset($_GET['searchType']) ){
			$user->setDataFromPost($_POST);
			$searchView = $user->getSearchViewWithDataForModerator();
		}
		$render->setAttribute('searchView',$searchView);
	}
}


