Minahito
minah****@users*****
2006年 8月 1日 (火) 19:40:05 JST
Index: xoops2jp/html/modules/base/admin/forms/ImagecategoryFilterForm.class.php diff -u xoops2jp/html/modules/base/admin/forms/ImagecategoryFilterForm.class.php:1.1.2.1 xoops2jp/html/modules/base/admin/forms/ImagecategoryFilterForm.class.php:1.1.2.2 --- xoops2jp/html/modules/base/admin/forms/ImagecategoryFilterForm.class.php:1.1.2.1 Tue May 9 19:31:59 2006 +++ xoops2jp/html/modules/base/admin/forms/ImagecategoryFilterForm.class.php Tue Aug 1 19:40:05 2006 @@ -1,4 +1,8 @@ <?php +/** + * @package Legacy + * @version $Id: ImagecategoryFilterForm.class.php,v 1.1.2.2 2006/08/01 10:40:05 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -13,14 +17,13 @@ define('IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT', 7); define('IMAGECATEGORY_SORT_KEY_IMGCAT_TYPE', 8); define('IMAGECATEGORY_SORT_KEY_IMGCAT_STORETYPE', 9); -define('IMAGECATEGORY_SORT_KEY_MAXVALUE', 9); define('IMAGECATEGORY_SORT_KEY_DEFAULT', IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT); +define('IMAGECATEGORY_SORT_KEY_MAXVALUE', 9); class Legacy_ImagecategoryFilterForm extends Legacy_AbstractFilterForm { - var $mSort = 0; - var $_mSortKeys = array( + var $mSortKeys = array( IMAGECATEGORY_SORT_KEY_IMGCAT_ID => 'imgcat_id', IMAGECATEGORY_SORT_KEY_IMGCAT_NAME => 'imgcat_name', IMAGECATEGORY_SORT_KEY_IMGCAT_MAXSIZE => 'imgcat_maxsize', @@ -31,34 +34,33 @@ IMAGECATEGORY_SORT_KEY_IMGCAT_TYPE => 'imgcat_type', IMAGECATEGORY_SORT_KEY_IMGCAT_STORETYPE => 'imgcat_storetype' ); - var $_mCriteria = null; function fetch() { - $this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : IMAGECATEGORY_SORT_KEY_DEFAULT; + $this->mSort = isset($_REQUEST['sort']) ? intval(xoops_getrequest('sort')) : IMAGECATEGORY_SORT_KEY_DEFAULT; - if ($this->mSort > IMAGECATEGORY_SORT_KEY_MAXVALUE) { + if (!isset($this->mSortKeys[abs($this->mSort)])) { $this->mSort = IMAGECATEGORY_SORT_KEY_DEFAULT; } if (isset($_REQUEST['imgcat_name'])) { $this->_mNavi->addExtra('imgcat_name', xoops_getrequest('imgcat_name')); - $this->_mCriteria->add(new Criteria('imgcat_name', array(XOBJ_DTYPE_STRING, xoops_getrequest('imgcat_name')))); + $this->_mCriteria->add(new Criteria('imgcat_name', xoops_getrequest('imgcat_name'))); } if (isset($_REQUEST['imgcat_display'])) { $this->_mNavi->addExtra('imgcat_display', xoops_getrequest('imgcat_display')); - $this->_mCriteria->add(new Criteria('imgcat_display', array(XOBJ_DTYPE_BOOL, xoops_getrequest('imgcat_display')))); + $this->_mCriteria->add(new Criteria('imgcat_display', xoops_getrequest('imgcat_display'))); } if (isset($_REQUEST['imgcat_type'])) { $this->_mNavi->addExtra('imgcat_type', xoops_getrequest('imgcat_type')); - $this->_mCriteria->add(new Criteria('imgcat_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('imgcat_type')))); + $this->_mCriteria->add(new Criteria('imgcat_type', xoops_getrequest('imgcat_type'))); } if (isset($_REQUEST['imgcat_storetype'])) { $this->_mNavi->addExtra('imgcat_storetype', xoops_getrequest('imgcat_storetype')); - $this->_mCriteria->add(new Criteria('imgcat_storetype', array(XOBJ_DTYPE_STRING, xoops_getrequest('imgcat_storetype')))); + $this->_mCriteria->add(new Criteria('imgcat_storetype', xoops_getrequest('imgcat_storetype'))); } //