<?php

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

require_once XOOPS_MODULE_PATH . "/user/class/PageNavigator.class.php";

class User_AbstractListAction extends User_Action
{
	var $mObjects = array();
	var $mFilter = null;
	var $mNavi = null;

	function &_getHandler()
	{
	}

	function &_getFilterForm(&$navi)
	{
	}

	function _getBaseUrl()
	{
	}

	function getDefaultView(&$controller, &$xoopsUser)
	{
		$this->mNavi =& new User_PageNavigator($this->_getBaseUrl(), 0, XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE);
		
		$this->mFilter =& $this->_getFilterForm($this->mNavi);
		$this->mFilter->fetch();
		$handler =& $this->_getHandler();
		
		$total = $handler->getCount($this->mFilter->getCriteria());
		
		$this->mNavi->setTotal($total);
		$this->mNavi->fetch();
		
		$criteria = $this->mFilter->getCriteria($this->mNavi->getStart(), $this->mNavi->getPerpage());
		$this->mObjects =& $handler->getObjects($criteria);
		
		return USER_FRAME_VIEW_INDEX;
	}
}

?>
