[xoops-cvslog 3831] CVS update: xoops2jp/html/modules/base/admin/forms

Back to archive index

Minahito minah****@users*****
2006年 8月 1日 (火) 19:40:18 JST


Index: xoops2jp/html/modules/base/admin/forms/ImageFilterForm.class.php
diff -u xoops2jp/html/modules/base/admin/forms/ImageFilterForm.class.php:1.1.2.1 xoops2jp/html/modules/base/admin/forms/ImageFilterForm.class.php:1.1.2.2
--- xoops2jp/html/modules/base/admin/forms/ImageFilterForm.class.php:1.1.2.1	Wed May 10 19:25:33 2006
+++ xoops2jp/html/modules/base/admin/forms/ImageFilterForm.class.php	Tue Aug  1 19:40:18 2006
@@ -12,14 +12,13 @@
 define('IMAGE_SORT_KEY_IMAGE_DISPLAY', 6);
 define('IMAGE_SORT_KEY_IMAGE_WEIGHT', 7);
 define('IMAGE_SORT_KEY_IMGCAT_ID', 8);
-define('IMAGE_SORT_KEY_MAXVALUE', 8);
 
 define('IMAGE_SORT_KEY_DEFAULT', IMAGE_SORT_KEY_IMAGE_WEIGHT);
+define('IMAGE_SORT_KEY_MAXVALUE', 8);
 
 class Legacy_ImageFilterForm extends Legacy_AbstractFilterForm
 {
-	var $mSort = 0;
-	var $_mSortKeys = array(
+	var $mSortKeys = array(
 		IMAGE_SORT_KEY_IMAGE_ID => 'image_id',
 		IMAGE_SORT_KEY_IMAGE_NAME => 'image_name',
 		IMAGE_SORT_KEY_IMAGE_NICENAME => 'image_nicename',
@@ -29,34 +28,22 @@
 		IMAGE_SORT_KEY_IMAGE_WEIGHT => 'image_weight',
 		IMAGE_SORT_KEY_IMGCAT_ID => 'imgcat_id'
 	);
-	var $_mCriteria = null;
-
 	function fetch()
 	{
-		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : IMAGE_SORT_KEY_DEFAULT;
+		$this->mSort = isset($_REQUEST['sort']) ? intval(xoops_getrequest('sort')) : IMAGE_SORT_KEY_DEFAULT;
 	
-		if ($this->mSort > IMAGE_SORT_KEY_MAXVALUE) {
+		if (!isset($this->mSortKeys[abs($this->mSort)])) {
 			$this->mSort = IMAGE_SORT_KEY_DEFAULT;
 		}
 	
-//		if (isset($_REQUEST['image_name'])) {
-//			$this->_mNavi->addExtra('image_name', xoops_getrequest('image_name'));
-//			$this->_mCriteria->add(new Criteria('image_name', array(XOBJ_DTYPE_STRING, xoops_getrequest('image_name'))));
-//		}
-	
-//		if (isset($_REQUEST['image_nicename'])) {
-//			$this->_mNavi->addExtra('image_nicename', xoops_getrequest('image_nicename'));
-//			$this->_mCriteria->add(new Criteria('image_nicename', array(XOBJ_DTYPE_STRING, xoops_getrequest('image_nicename'))));
-//		}
-	
 		if (isset($_REQUEST['image_display'])) {
 			$this->_mNavi->addExtra('image_display', xoops_getrequest('image_display'));
-			$this->_mCriteria->add(new Criteria('image_display', array(XOBJ_DTYPE_BOOL, xoops_getrequest('image_display'))));
+			$this->_mCriteria->add(new Criteria('image_display', xoops_getrequest('image_display')));
 		}
 	
 		if (isset($_REQUEST['imgcat_id'])) {
 			$this->_mNavi->addExtra('imgcat_id', xoops_getrequest('imgcat_id'));
-			$this->_mCriteria->add(new Criteria('imgcat_id', array(XOBJ_DTYPE_INT, xoops_getrequest('imgcat_id'))));
+			$this->_mCriteria->add(new Criteria('imgcat_id', xoops_getrequest('imgcat_id')));
 		}
 		
 		$this->_mCriteria->addSort($this->getSort(), $this->getOrder());


xoops-cvslog メーリングリストの案内
Back to archive index