[xoops-cvslog 3575] CVS update: xoops2jp/html/modules/user/admin/forms

アーカイブの一覧に戻る

Minahito minah****@users*****
2006年 7月 13日 (木) 19:48:57 JST


Index: xoops2jp/html/modules/user/admin/forms/AvatarFilterForm.class.php
diff -u xoops2jp/html/modules/user/admin/forms/AvatarFilterForm.class.php:1.1.2.2 xoops2jp/html/modules/user/admin/forms/AvatarFilterForm.class.php:1.1.2.3
--- xoops2jp/html/modules/user/admin/forms/AvatarFilterForm.class.php:1.1.2.2	Tue Mar 28 22:32:04 2006
+++ xoops2jp/html/modules/user/admin/forms/AvatarFilterForm.class.php	Thu Jul 13 19:48:57 2006
@@ -1,10 +1,13 @@
 <?php
+/**
+ * @package user
+ * @version $Id: AvatarFilterForm.class.php,v 1.1.2.3 2006/07/13 10:48:57 minahito Exp $
+ */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
 require_once XOOPS_MODULE_PATH . "/user/class/AbstractFilterForm.class.php";
 
-define('AVATAR_SORT_KEY_DEFAULT', 0);
 define('AVATAR_SORT_KEY_AVATAR_ID', 1);
 define('AVATAR_SORT_KEY_AVATAR_FILE', 2);
 define('AVATAR_SORT_KEY_AVATAR_NAME', 3);
@@ -15,11 +18,11 @@
 define('AVATAR_SORT_KEY_AVATAR_TYPE', 8);
 define('AVATAR_SORT_KEY_MAXVALUE', 8);
 
+define('AVATAR_SORT_KEY_DEFAULT', AVATAR_SORT_KEY_AVATAR_ID);
+
 class User_AvatarFilterForm extends User_AbstractFilterForm
 {
-	var $mSort = 0;
-	var $_mSortKeys = array(
-		AVATAR_SORT_KEY_DEFAULT => 'avatar_id',
+	var $mSortKeys = array(
 		AVATAR_SORT_KEY_AVATAR_ID => 'avatar_id',
 		AVATAR_SORT_KEY_AVATAR_FILE => 'avatar_file',
 		AVATAR_SORT_KEY_AVATAR_NAME => 'avatar_name',
@@ -29,47 +32,26 @@
 		AVATAR_SORT_KEY_AVATAR_WEIGHT => 'avatar_weight',
 		AVATAR_SORT_KEY_AVATAR_TYPE => 'avatar_type'
 	);
-	var $_mCriteria = null;
 
 	function fetch()
 	{
 		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : 0;
 	
-		if ($this->mSort > AVATAR_SORT_KEY_MAXVALUE) {
+		if (!isset($this->mSortKeys[abs($this->mSort)]) {
 			$this->mSort = AVATAR_SORT_KEY_DEFAULT;
 		}
 	
-		if (isset($_REQUEST['avatar_id'])) {
-			$this->_mCriteria->add(new Criteria('avatar_id', array(XOBJ_DTYPE_INT, xoops_getrequest('avatar_id'))));
-		}
-	
-		if (isset($_REQUEST['avatar_file'])) {
-			$this->_mCriteria->add(new Criteria('avatar_file', array(XOBJ_DTYPE_STRING, xoops_getrequest('avatar_file'))));
-		}
-	
-		if (isset($_REQUEST['avatar_name'])) {
-			$this->_mCriteria->add(new Criteria('avatar_name', array(XOBJ_DTYPE_STRING, xoops_getrequest('avatar_name'))));
-		}
-	
-		if (isset($_REQUEST['avatar_mimetype'])) {
-			$this->_mCriteria->add(new Criteria('avatar_mimetype', array(XOBJ_DTYPE_STRING, xoops_getrequest('avatar_mimetype'))));
-		}
-	
-		if (isset($_REQUEST['avatar_created'])) {
-			$this->_mCriteria->add(new Criteria('avatar_created', array(XOBJ_DTYPE_INT, xoops_getrequest('avatar_created'))));
-		}
-	
 		if (isset($_REQUEST['avatar_display'])) {
+			$this->_mNavi->addExtra('avatar_display', xoops_getrequest('avatar_display'));
 			$this->_mCriteria->add(new Criteria('avatar_display', array(XOBJ_DTYPE_BOOL, xoops_getrequest('avatar_display'))));
 		}
 	
-		if (isset($_REQUEST['avatar_weight'])) {
-			$this->_mCriteria->add(new Criteria('avatar_weight', array(XOBJ_DTYPE_INT, xoops_getrequest('avatar_weight'))));
-		}
-	
 		if (isset($_REQUEST['avatar_type'])) {
+			$this->_mNavi->addExtra('avatar_type', xoops_getrequest('avatar_type'));
 			$this->_mCriteria->add(new Criteria('avatar_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('avatar_type'))));
 		}
+		
+		$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 	}
 }
 


xoops-cvslog メーリングリストの案内
アーカイブの一覧に戻る