<?php

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

require_once USER_TRUST_PATH . "/class/AbstractFilterForm.class.php";

define('USER_VALUE_SET_SORT_KEY_SEQ_ID', 1);
define('USER_VALUE_SET_SORT_KEY_SELECT_NAME', 2);
define('USER_VALUE_SET_SORT_KEY_ID', 3);
define('USER_VALUE_SET_SORT_KEY_TITLE', 4);
define('USER_VALUE_SET_SORT_KEY_DISPLAY_ORDER', 5);

define('USER_VALUE_SET_SORT_KEY_DEFAULT', USER_VALUE_SET_SORT_KEY_SELECT_NAME);

class User_UserValueSetFilterForm extends User_AbstractFilterForm
{
	var $mSortKeys = array(
		USER_VALUE_SET_SORT_KEY_SEQ_ID => 'seq_id',
		USER_VALUE_SET_SORT_KEY_SELECT_NAME => 'select_name',
		USER_VALUE_SET_SORT_KEY_ID => 'title_id',
		USER_VALUE_SET_SORT_KEY_TITLE => 'title',
		USER_VALUE_SET_SORT_KEY_DISPLAY_ORDER => 'weight'
	);
	
	function getDefaultSortKey()
	{
		return USER_VALUE_SET_SORT_KEY_DEFAULT;
	}

	function getTotalItems(&$total)
	{
		$total = $this->_mHandler->getCount();
	}
	
	function fetch()
	{
		parent::fetch();	
		$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
	}
}

?>
