<?php

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

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

class LegacyRender_AbstractListAction extends LegacyRender_Action
{
	var $mObjects = array();
	var $mFilter = null;
	var $mNavi = null;

	function &_getHandler()
	{
	}

	function &_getFilterForm(&$navi)
	{
	}

	function _getBaseUrl()
	{
	}

	function getDefaultView(&$controller, &$xoopsUser)
	{
		$this->mNavi =& new LegacyRender_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 LEGACYRENDER_FRAME_VIEW_INDEX;
	}
}

?>
