<?php

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

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

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

	function &_getHandler()
	{
	}

	function &_getFilterForm()
	{
	}

	function _getBaseUrl()
	{
	}

	function getDefaultView(&$controller, &$xoopsUser)
	{
		$this->mPageNavi =& new LegacyRender_PageNavigator($this->_getBaseUrl(), 0, XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE);

		$this->mFilter =& $this->_getFilterForm();
		$this->mFilter->fetch();
	
		$handler =& $this->_getHandler();
	
		$total = $handler->getCount($this->mFilter->getCriteria());
		
		$this->mPageNavi->setTotal($total);
		$this->mPageNavi->fetch();
		
		$criteria = $this->mFilter->getCriteria($this->mPageNavi->getStart(), $this->mPageNavi->getPerpage());
		$this->mObjects =& $handler->getObjects($criteria);
	
		return LEGACYRENDER_FRAME_VIEW_INDEX;
	}
}

?>