<?php

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

class Legacy_AbstractFilterForm
{
	var $mSort = 0;
	var $mSortKeys = array();
	var $_mCriteria = null;
	var $_mNavi = null;

	function Legacy_AbstractFilterForm(&$navi)
	{
		$this->_mNavi =& $navi;
		$this->_mCriteria =& new CriteriaCompo();
	}

	function fetch()
	{
	}

	function getSort()
	{
		$sortkey = abs($this->mSort);
		return isset($this->_mSortKeys[$sortkey]) ? $this->_mSortKeys[$sortkey] : null;
	}

	function getOrder()
	{
		return ($this->mSort < 0) ? "DESC" : "ASC";
	}

	function getCriteria($start = 0, $limit = 0)
	{
		$criteria = $this->_mCriteria;
		
		$criteria->setStart($start);
		$criteria->setLimit($limit);
		
		return $criteria;
	}
}

?>
