1: <?php
2: 3: 4: 5:
6:
7: if (!defined('XOOPS_ROOT_PATH')) exit();
8:
9: require_once XOOPS_MODULE_PATH . "/user/admin/forms/UserSearchForm.class.php";
10:
11: class User_UserSearchAction extends User_Action
12: {
13: var $mActionForm = null;
14:
15: function prepare(&$controller, &$xoopsUser)
16: {
17: $this->mActionForm =new User_UserSearchForm();
18: $this->mActionForm->prepare();
19: }
20:
21: function getDefaultView(&$controller, &$xoopsUser)
22: {
23: $this->mActionForm->fetch();
24:
25: return USER_FRAME_VIEW_INPUT;
26: }
27:
28: function executeViewInput(&$controller, &$xoopsUser, &$render)
29: {
30: $render->setTemplateName("user_search.html");
31: $render->setAttribute("actionForm", $this->mActionForm);
32:
33: $groupHandler =& xoops_gethandler('group');
34: $groups =& $groupHandler->getObjects(null, true);
35:
36: $groupOptions = array();
37: foreach ($groups as $gid => $group) {
38: $groupOptions[$gid] = $group->getVar('name');
39: }
40:
41: $matchOptions = array();
42: $matchArray = array(XOOPS_MATCH_START => _STARTSWITH, XOOPS_MATCH_END => _ENDSWITH, XOOPS_MATCH_EQUAL => _MATCHES, XOOPS_MATCH_CONTAIN => _CONTAINS);
43: foreach ($matchArray as $key => $value) {
44: $matchOptions[$key] = $value;
45: }
46:
47: $render->setAttribute('groupOptions', $groupOptions);
48: $render->setAttribute('matchOptions', $matchOptions);
49:
50: $member_handler =& xoops_gethandler('member');
51: $active_total = $member_handler->getUserCount(new Criteria('level', 0, '>'));
52: $inactive_total = $member_handler->getUserCount(new Criteria('level', 0));
53: $render->setAttribute('activeUserTotal', $active_total);
54: $render->setAttribute('inactiveUserTotal', $inactive_total);
55: $render->setAttribute('UserTotal', $active_total+$inactive_total);
56:
57: }
58: }
59:
60: ?>
61: