Minahito
minah****@users*****
2006年 8月 1日 (火) 19:39:12 JST
Index: xoops2jp/html/modules/base/admin/forms/CommentFilterForm.class.php diff -u xoops2jp/html/modules/base/admin/forms/CommentFilterForm.class.php:1.1.2.6 xoops2jp/html/modules/base/admin/forms/CommentFilterForm.class.php:1.1.2.7 --- xoops2jp/html/modules/base/admin/forms/CommentFilterForm.class.php:1.1.2.6 Sat Apr 15 13:48:27 2006 +++ xoops2jp/html/modules/base/admin/forms/CommentFilterForm.class.php Tue Aug 1 19:39:11 2006 @@ -1,4 +1,8 @@ <?php +/** + * @package Legacy + * @version $Id: CommentFilterForm.class.php,v 1.1.2.7 2006/08/01 10:39:11 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -24,14 +28,13 @@ define('COMMENT_SORT_KEY_DOXCODE', 18); define('COMMENT_SORT_KEY_DOIMAGE', 19); define('COMMENT_SORT_KEY_DOBR', 20); -define('COMMENT_SORT_KEY_MAXVALUE', 20); define('COMMENT_SORT_KEY_DEFAULT', COMMENT_SORT_KEY_COM_ID); +define('COMMENT_SORT_KEY_MAXVALUE', 20); class Legacy_CommentFilterForm extends Legacy_AbstractFilterForm { - var $mSort = 0; - var $_mSortKeys = array( + var $mSortKeys = array( COMMENT_SORT_KEY_COM_ID => 'com_id', COMMENT_SORT_KEY_COM_PID => 'com_pid', COMMENT_SORT_KEY_COM_ROOTID => 'com_rootid', @@ -53,19 +56,18 @@ COMMENT_SORT_KEY_DOIMAGE => 'doimage', COMMENT_SORT_KEY_DOBR => 'dobr' ); - var $_mCriteria = null; function fetch() { - $this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : 0; + $this->mSort = isset($_REQUEST['sort']) ? intval(xoops_getrequest('sort')) : COMMENT_SORT_KEY_DEFAULT; - if ($this->mSort > COMMENT_SORT_KEY_MAXVALUE) { + if (!isset($this->mSortKeys[abs($this->mSort)])) { $this->mSort = COMMENT_SORT_KEY_DEFAULT; } if (isset($_REQUEST['com_modid']) && intval(xoops_getrequest('com_modid')) > 0) { $this->_mNavi->addExtra('com_modid', xoops_getrequest('com_modid')); - $this->_mCriteria->add(new Criteria('com_modid', array(XOBJ_DTYPE_INT, xoops_getrequest('com_modid')))); + $this->_mCriteria->add(new Criteria('com_modid', xoops_getrequest('com_modid'))); } elseif (isset($_REQUEST['dirname'])) { $this->_mNavi->addExtra('dirname', xoops_getrequest('dirname')); @@ -73,28 +75,28 @@ $handler =& xoops_gethandler('module'); $module =& $handler->getByDirname(xoops_getrequest('dirname')); if (is_object($module)) { - $this->_mCriteria->add(new Criteria('com_modid', array(XOBJ_DTYPE_INT, $module->get('mid')))); + $this->_mCriteria->add(new Criteria('com_modid', $module->get('mid'))); } } if (isset($_REQUEST['com_icon'])) { $this->_mNavi->addExtra('com_icon', xoops_getrequest('com_icon')); - $this->_mCriteria->add(new Criteria('com_icon', array(XOBJ_DTYPE_STRING, xoops_getrequest('com_icon')))); + $this->_mCriteria->add(new Criteria('com_icon', xoops_getrequest('com_icon'))); } if (isset($_REQUEST['com_uid'])) { $this->_mNavi->addExtra('com_uid', xoops_getrequest('com_uid')); - $this->_mCriteria->add(new Criteria('com_uid', array(XOBJ_DTYPE_INT, xoops_getrequest('com_uid')))); + $this->_mCriteria->add(new Criteria('com_uid', xoops_getrequest('com_uid'))); } if (isset($_REQUEST['com_ip'])) { $this->_mNavi->addExtra('com_ip', xoops_getrequest('com_ip')); - $this->_mCriteria->add(new Criteria('com_ip', array(XOBJ_DTYPE_STRING, xoops_getrequest('com_ip')))); + $this->_mCriteria->add(new Criteria('com_ip', xoops_getrequest('com_ip'))); } if (xoops_getrequest('com_status') > 0) { $this->_mNavi->addExtra('com_status', xoops_getrequest('com_status')); - $this->_mCriteria->add(new Criteria('com_status', array(XOBJ_DTYPE_BOOL, xoops_getrequest('com_status')))); + $this->_mCriteria->add(new Criteria('com_status', xoops_getrequest('com_status'))); } $this->_mCriteria->addSort($this->getSort(), $this->getOrder());