1: <?php
2: 3: 4: 5:
6:
7: if (!defined('XOOPS_ROOT_PATH')) exit();
8:
9: require_once XOOPS_MODULE_PATH . "/user/class/AbstractFilterForm.class.php";
10:
11: define('USER_SORT_KEY_UID', 1);
12: define('USER_SORT_KEY_NAME', 2);
13: define('USER_SORT_KEY_UNAME', 3);
14: define('USER_SORT_KEY_EMAIL', 4);
15: define('USER_SORT_KEY_URL', 5);
16: define('USER_SORT_KEY_USER_AVATAR', 6);
17: define('USER_SORT_KEY_USER_REGDATE', 7);
18: define('USER_SORT_KEY_USER_ICQ', 8);
19: define('USER_SORT_KEY_USER_FROM', 9);
20: define('USER_SORT_KEY_USER_SIG', 10);
21: define('USER_SORT_KEY_USER_VIEWEMAIL', 11);
22: define('USER_SORT_KEY_ACTKEY', 12);
23: define('USER_SORT_KEY_USER_AIM', 13);
24: define('USER_SORT_KEY_USER_YIM', 14);
25: define('USER_SORT_KEY_USER_MSNM', 15);
26: define('USER_SORT_KEY_PASS', 16);
27: define('USER_SORT_KEY_POSTS', 17);
28: define('USER_SORT_KEY_ATTACHSIG', 18);
29: define('USER_SORT_KEY_RANK', 19);
30: define('USER_SORT_KEY_LEVEL', 20);
31: define('USER_SORT_KEY_THEME', 21);
32: define('USER_SORT_KEY_TIMEZONE_OFFSET', 22);
33: define('USER_SORT_KEY_LAST_LOGIN', 23);
34: define('USER_SORT_KEY_UMODE', 24);
35: define('USER_SORT_KEY_UORDER', 25);
36: define('USER_SORT_KEY_NOTIFY_METHOD', 26);
37: define('USER_SORT_KEY_NOTIFY_MODE', 27);
38: define('USER_SORT_KEY_USER_OCC', 28);
39: define('USER_SORT_KEY_BIO', 29);
40: define('USER_SORT_KEY_USER_INTREST', 30);
41: define('USER_SORT_KEY_USER_MAILOK', 31);
42: define('USER_SORT_KEY_MAXVALUE', 31);
43:
44: define('USER_SORT_KEY_DEFAULT', USER_SORT_KEY_UID);
45:
46: 47: 48: 49: 50:
51: class User_UserFilterForm extends User_AbstractFilterForm
52: {
53: var $mSortKeys = array(
54: USER_SORT_KEY_UID => 'uid',
55: USER_SORT_KEY_NAME => 'name',
56: USER_SORT_KEY_UNAME => 'uname',
57: USER_SORT_KEY_EMAIL => 'email',
58: USER_SORT_KEY_URL => 'url',
59: USER_SORT_KEY_USER_AVATAR => 'user_avatar',
60: USER_SORT_KEY_USER_REGDATE => 'user_regdate',
61: USER_SORT_KEY_USER_ICQ => 'user_icq',
62: USER_SORT_KEY_USER_FROM => 'user_from',
63: USER_SORT_KEY_USER_SIG => 'user_sig',
64: USER_SORT_KEY_USER_VIEWEMAIL => 'user_viewemail',
65: USER_SORT_KEY_ACTKEY => 'actkey',
66: USER_SORT_KEY_USER_AIM => 'user_aim',
67: USER_SORT_KEY_USER_YIM => 'user_yim',
68: USER_SORT_KEY_USER_MSNM => 'user_msnm',
69: USER_SORT_KEY_PASS => 'pass',
70: USER_SORT_KEY_POSTS => 'posts',
71: USER_SORT_KEY_ATTACHSIG => 'attachsig',
72: USER_SORT_KEY_RANK => 'rank',
73: USER_SORT_KEY_LEVEL => 'level',
74: USER_SORT_KEY_THEME => 'theme',
75: USER_SORT_KEY_TIMEZONE_OFFSET => 'timezone_offset',
76: USER_SORT_KEY_LAST_LOGIN => 'last_login',
77: USER_SORT_KEY_UMODE => 'umode',
78: USER_SORT_KEY_UORDER => 'uorder',
79: USER_SORT_KEY_NOTIFY_METHOD => 'notify_method',
80: USER_SORT_KEY_NOTIFY_MODE => 'notify_mode',
81: USER_SORT_KEY_USER_OCC => 'user_occ',
82: USER_SORT_KEY_BIO => 'bio',
83: USER_SORT_KEY_USER_INTREST => 'user_intrest',
84: USER_SORT_KEY_USER_MAILOK => 'user_mailok'
85: );
86:
87: var $mKeyword = "";
88: var $mOptionField = "";
89:
90: function getDefaultSortKey()
91: {
92: return USER_SORT_KEY_DEFAULT;
93: }
94:
95: function fetch()
96: {
97: parent::fetch();
98:
99: $root =& XCube_Root::getSingleton();
100: $uid = $root->mContext->mRequest->getRequest('uid');
101: $email = $root->mContext->mRequest->getRequest('email');
102: $attachsig = $root->mContext->mRequest->getRequest('attachsig');
103: $rank = $root->mContext->mRequest->getRequest('rank');
104: $level = $root->mContext->mRequest->getRequest('level');
105: $timezone_offset = $root->mContext->mRequest->getRequest('timezone_offset');
106: $user_mailok = $root->mContext->mRequest->getRequest('user_mailok');
107: $option_field = $root->mContext->mRequest->getRequest('option_field');
108: $search = $root->mContext->mRequest->getRequest('search');
109:
110: if (isset($_REQUEST['uid'])) {
111: $this->mNavi->addExtra('uid', xoops_getrequest('uid'));
112: $this->_mCriteria->add(new Criteria('uid', xoops_getrequest('uid')));
113: }
114:
115: if (isset($_REQUEST['email'])) {
116: $this->mNavi->addExtra('email', xoops_getrequest('email'));
117: $this->_mCriteria->add(new Criteria('email', xoops_getrequest('email')));
118: }
119:
120: if (isset($_REQUEST['attachsig'])) {
121: $this->mNavi->addExtra('attachsig', xoops_getrequest('attachsig'));
122: $this->_mCriteria->add(new Criteria('attachsig', xoops_getrequest('attachsig')));
123: }
124:
125: if (isset($_REQUEST['rank'])) {
126: $this->mNavi->addExtra('rank', xoops_getrequest('rank'));
127: $this->_mCriteria->add(new Criteria('rank', xoops_getrequest('rank')));
128: }
129:
130: if (isset($_REQUEST['level'])) {
131: $this->mNavi->addExtra('level', xoops_getrequest('level'));
132: $this->_mCriteria->add(new Criteria('level', xoops_getrequest('level')));
133: }
134:
135: if (isset($_REQUEST['timezone_offset'])) {
136: $this->mNavi->addExtra('timezone_offset', xoops_getrequest('timezone_offset'));
137: $this->_mCriteria->add(new Criteria('timezone_offset', xoops_getrequest('timezone_offset')));
138: }
139:
140: if (isset($_REQUEST['user_mailok'])) {
141: $this->mNavi->addExtra('user_mailok', xoops_getrequest('user_mailok'));
142: $this->_mCriteria->add(new Criteria('user_mailok', xoops_getrequest('user_mailok')));
143: }
144:
145:
146: if (isset($_REQUEST['option_field'])) {
147: $this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
148: $this->mOptionField = $option_field;
149:
150: if ( $option_field == "inactive" ) {
151:
152: $this->_mCriteria->add(new Criteria('level', '0'));
153: }
154: elseif ( $option_field == "active" ) {
155:
156: $this->_mCriteria->add(new Criteria('level', '0', '>'));
157: }
158: else {
159:
160: }
161: }
162:
163:
164: if (!empty($search)) {
165: $this->mKeyword = $search;
166: $this->mNavi->addExtra('search', $this->mKeyword);
167: $this->_mCriteria->add(new Criteria('uname', '%' . $this->mKeyword . '%', 'LIKE'));
168: }
169:
170: $this->_mCriteria->addSort($this->getSort(), $this->getOrder());
171: }
172: }
173:
174: ?>
175: