Minahito
minah****@users*****
2006年 8月 1日 (火) 19:40:48 JST
Index: xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php diff -u xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php:1.1.2.4 xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php:1.1.2.5 --- xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php:1.1.2.4 Tue Mar 28 22:29:05 2006 +++ xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php Tue Aug 1 19:40:48 2006 @@ -1,12 +1,13 @@ <?php /** * This file is generated by Sort Filter Unit Class Maker. - * @version $Id: ModuleListFilterForm.class.php,v 1.1.2.4 2006/03/28 13:29:05 minahito Exp $ + * @version $Id: ModuleListFilterForm.class.php,v 1.1.2.5 2006/08/01 10:40:48 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); -define("MODULE_SORT_KEY_DEFAULT", 0); +require_once XOOPS_ROOT_PATH . "/modules/base/class/AbstractFilterForm.class.php"; + define("MODULE_SORT_KEY_MID", 1); define("MODULE_SORT_KEY_NAME", 2); define("MODULE_SORT_KEY_VERSION", 3); @@ -20,19 +21,17 @@ define("MODULE_SORT_KEY_HASCONFIG", 11); define("MODULE_SORT_KEY_HASCOMMENTS",12); +define("MODULE_SORT_KEY_DEFAULT", MODULE_SORT_KEY_MID); define("MODULE_SORT_KEY_MAXVALUE", 12); /** * */ -class ModuleListFilterForm +class Legacy_ModuleListFilterForm extends Legacy_AbstractFilterForm { - var $mSpecial=null; - - var $mSortKey=0; + var $mSpecial = null; - var $_mSortKeys=array( - MODULE_SORT_KEY_DEFAULT => "mid", + var $mSortKeys = array( MODULE_SORT_KEY_MID => "mid", MODULE_SORT_KEY_NAME => "name", MODULE_SORT_KEY_VERSION => "version", @@ -49,23 +48,17 @@ function fetch() { - $this->mSpecial=isset($_REQUEST['special']) ? intval($_REQUEST['special']) : null; - - $this->mSortKey=isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : 0; - - if($this->mSortKey>MODULE_SORT_KEY_MAXVALUE) - $this->mSortKey=0; - } - - function getSort() - { - $sortkey=abs($this->mSortKey); - return $this->_mSortKeys[$sortkey]; - } + $this->mSort = isset($_REQUEST['sort']) ? intval(xoops_getrequest('sort')) : MODULE_SORT_KEY_DEFAULT; - function getOrder() - { - return ($this->mSortKey < 0) ? "DESC" : "ASC"; + if (!isset($this->mSortKeys[abs($this->mSort)])) { + $this->mSort = MODULE_SORT_KEY_DEFAULT; + } + + if (isset($_REQUEST['special'])) { + $this->mSpecial = intval(xoops_getreqeust('special')); + } + + $this->_mCriteria->addSort($this->getSort(), $this->getOrder()); } }