XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
SearchShowallbyuserAction.class.php
1<?php
11
12if (!defined('XOOPS_ROOT_PATH')) {
13 exit();
14}
15
16require_once XOOPS_MODULE_PATH . '/legacy/actions/SearchShowallAction.class.php';
17require_once XOOPS_MODULE_PATH . '/legacy/forms/SearchShowallbyuserForm.class.php';
18
19
21{
22 public function _setupActionForm()
23 {
24 $this->mActionForm =new Legacy_SearchShowallbyuserForm(0);
25 $this->mActionForm->prepare();
26 }
27
28 public function _getTemplateName()
29 {
30 return 'legacy_search_showallbyuser.html';
31 }
32
33 public function _getSelectedMids()
34 {
35 $ret = [];
36 $ret[] = $this->mActionForm->get('mid');
37
38 return $ret;
39 }
40
41 public function _doSearch(&$client, &$xoopsUser, &$params)
42 {
43 return $client->call('searchItemsOfUser', $params);
44 }
45
46 public function _getMaxHit()
47 {
48 return LEGACY_SEARCH_SHOWALL_MAXHIT;
49 }
50
51 public function executeViewIndex(&$controller, &$xoopsUser, &$render)
52 {
53 parent::executeViewIndex($controller, $xoopsUser, $render);
54
55 $handler =& xoops_gethandler('user');
56 $user =& $handler->get($this->mActionForm->get('uid'));
57
58 $render->setAttribute('targetUser', $user);
59
60 $prevStart = $this->mActionForm->get('start') - LEGACY_SEARCH_SHOWALL_MAXHIT;
61 if ($prevStart < 0) {
62 $prevStart = 0;
63 }
64
65 $render->setAttribute('prevStart', $prevStart);
66 $render->setAttribute('nextStart', $this->mActionForm->get('start') + LEGACY_SEARCH_SHOWALL_MAXHIT);
67 }
68}