Minahito
minah****@users*****
2006年 8月 1日 (火) 19:37:25 JST
Index: xoops2jp/html/modules/base/admin/forms/BlockFilterForm.class.php diff -u xoops2jp/html/modules/base/admin/forms/BlockFilterForm.class.php:1.1.2.6 xoops2jp/html/modules/base/admin/forms/BlockFilterForm.class.php:1.1.2.7 --- xoops2jp/html/modules/base/admin/forms/BlockFilterForm.class.php:1.1.2.6 Sat Apr 15 11:50:25 2006 +++ xoops2jp/html/modules/base/admin/forms/BlockFilterForm.class.php Tue Aug 1 19:37:25 2006 @@ -1,4 +1,8 @@ <?php +/** + * @package Legacy + * @version $Id: BlockFilterForm.class.php,v 1.1.2.7 2006/08/01 10:37:25 minahito Exp $ + */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -24,14 +28,13 @@ define('NEWBLOCKS_SORT_KEY_TEMPLATE', 18); define('NEWBLOCKS_SORT_KEY_BCACHETIME', 19); define('NEWBLOCKS_SORT_KEY_LAST_MODIFIED', 20); -define('NEWBLOCKS_SORT_KEY_MAXVALUE', 20); define('NEWBLOCKS_SORT_KEY_DEFAULT', NEWBLOCKS_SORT_KEY_SIDE); +define('NEWBLOCKS_SORT_KEY_MAXVALUE', 20); class Legacy_BlockFilterForm extends Legacy_AbstractFilterForm { - var $mSort = 0; - var $_mSortKeys = array( + var $mSortKeys = array( NEWBLOCKS_SORT_KEY_BID => 'bid', NEWBLOCKS_SORT_KEY_MID => 'mid', NEWBLOCKS_SORT_KEY_FUNC_NUM => 'func_num', @@ -46,63 +49,47 @@ NEWBLOCKS_SORT_KEY_BCACHETIME => 'bcachetime', NEWBLOCKS_SORT_KEY_LAST_MODIFIED => 'last_modified' ); - var $_mCriteria = null; function fetch() { $this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : NEWBLOCKS_SORT_KEY_DEFAULT; - if ($this->mSort > NEWBLOCKS_SORT_KEY_MAXVALUE) { + if (!isset($this->mSortKeys[abs($this->mSort)])) { $this->mSort = NEWBLOCKS_SORT_KEY_DEFAULT; } - if (isset($_REQUEST['bid'])) { - $this->_mNavi->addExtra('bid', xoops_getrequest('bid')); - $this->_mCriteria->add(new Criteria('bid', array(XOBJ_DTYPE_INT, xoops_getrequest('bid')))); - } - if (isset($_REQUEST['mid'])) { $this->_mNavi->addExtra('mid', xoops_getrequest('mid')); - $this->_mCriteria->add(new Criteria('mid', array(XOBJ_DTYPE_INT, xoops_getrequest('mid')))); - } - - if (isset($_REQUEST['name'])) { - $this->_mNavi->addExtra('name', xoops_getrequest('name')); - $this->_mCriteria->add(new Criteria('name', array(XOBJ_DTYPE_STRING, xoops_getrequest('name')))); - } - - if (isset($_REQUEST['title'])) { - $this->_mNavi->addExtra('title', xoops_getrequest('title')); - $this->_mCriteria->add(new Criteria('title', array(XOBJ_DTYPE_STRING, xoops_getrequest('title')))); + $this->_mCriteria->add(new Criteria('mid', xoops_getrequest('mid'))); } if (isset($_REQUEST['side'])) { $this->_mNavi->addExtra('side', xoops_getrequest('side')); - $this->_mCriteria->add(new Criteria('side', array(XOBJ_DTYPE_BOOL, xoops_getrequest('side')))); + $this->_mCriteria->add(new Criteria('side', xoops_getrequest('side'))); } if (isset($_REQUEST['weight'])) { $this->_mNavi->addExtra('weight', xoops_getrequest('weight')); - $this->_mCriteria->add(new Criteria('weight', array(XOBJ_DTYPE_INT, xoops_getrequest('weight')))); + $this->_mCriteria->add(new Criteria('weight', xoops_getrequest('weight'))); } if (isset($_REQUEST['block_type'])) { $this->_mNavi->addExtra('block_type', xoops_getrequest('block_type')); - $this->_mCriteria->add(new Criteria('block_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('block_type')))); + $this->_mCriteria->add(new Criteria('block_type', xoops_getrequest('block_type'))); } if (isset($_REQUEST['c_type'])) { $this->_mNavi->addExtra('c_type', xoops_getrequest('c_type')); - $this->_mCriteria->add(new Criteria('c_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('c_type')))); + $this->_mCriteria->add(new Criteria('c_type', xoops_getrequest('c_type'))); } if (isset($_REQUEST['dirname'])) { $this->_mNavi->addExtra('dirname', xoops_getrequest('dirname')); - $this->_mCriteria->add(new Criteria('dirname', array(XOBJ_DTYPE_STRING, xoops_getrequest('dirname')))); + $this->_mCriteria->add(new Criteria('dirname', xoops_getrequest('dirname'))); } - $this->_mCriteria->add(new Criteria('visible', array(XOBJ_DTYPE_BOOL, 1))); - $this->_mCriteria->add(new Criteria('isactive', array(XOBJ_DTYPE_BOOL, 1))); + $this->_mCriteria->add(new Criteria('visible', $this->_getVisible())); + $this->_mCriteria->add(new Criteria('isactive', 1)); // // Set sort conditions. @@ -124,6 +111,11 @@ $this->_mCriteria->addSort('weight', $this->getOrder()); } } + + function _getVisible() + { + return 1; + } } ?>