Minahito
minah****@users*****
2005年 12月 1日 (木) 01:18:46 JST
Index: xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php:1.1.2.1 --- /dev/null Thu Dec 1 01:18:46 2005 +++ xoops2jp/html/modules/base/admin/forms/ModuleListFilterForm.class.php Thu Dec 1 01:18:46 2005 @@ -0,0 +1,70 @@ +<?php +/** + * This file is generated by Sort Filter Unit Class Maker. + * @version $Id: ModuleListFilterForm.class.php,v 1.1.2.1 2005/11/30 16:18:46 minahito Exp $ + */ + +define("MODULE_SORT_KEY_DEFAULT", 0); +define("MODULE_SORT_KEY_MID", 1); +define("MODULE_SORT_KEY_NAME", 2); +define("MODULE_SORT_KEY_VERSION", 3); +define("MODULE_SORT_KEY_LASTUPDATE", 4); +define("MODULE_SORT_KEY_WEIGHT", 5); +define("MODULE_SORT_KEY_ISACTIVE", 6); +define("MODULE_SORT_KEY_DIRNAME", 7); +define("MODULE_SORT_KEY_HASMAIN", 8); +define("MODULE_SORT_KEY_HASADMIN", 9); +define("MODULE_SORT_KEY_HASSEARCH", 10); +define("MODULE_SORT_KEY_HASCONFIG", 11); +define("MODULE_SORT_KEY_HASCOMMENTS",12); + +define("MODULE_SORT_KEY_MAXVALUE", 12); + +/** + * + */ +class ModuleListFilterForm +{ + var $mSpecial=null; + + var $mSortKey=0; + + var $_mSortKeys=array( + MODULE_SORT_KEY_DEFAULT => "id", + MODULE_SORT_KEY_MID => "mid", + MODULE_SORT_KEY_NAME => "name", + MODULE_SORT_KEY_VERSION => "version", + MODULE_SORT_KEY_LASTUPDATE => "last_update", + MODULE_SORT_KEY_WEIGHT => "weight", + MODULE_SORT_KEY_ISACTIVE => "isactive", + MODULE_SORT_KEY_DIRNAME => "dirname", + MODULE_SORT_KEY_HASMAIN => "hasmain", + MODULE_SORT_KEY_HASADMIN => "hasadmin", + MODULE_SORT_KEY_HASSEARCH => "hassearch", + MODULE_SORT_KEY_HASCONFIG => "hasconfig", + MODULE_SORT_KEY_HASCOMMENTS => "hascomments" + ); + + 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]; + } + + function getOrder() + { + return ($this->mSortKey < 0) ? "DESC" : "ASC"; + } +} + +?> \ No newline at end of file