Minahito
minah****@users*****
2006年 7月 27日 (木) 18:35:08 JST
Index: xoops2jp/html/modules/base/service/LegacySearchService.class.php diff -u xoops2jp/html/modules/base/service/LegacySearchService.class.php:1.1.2.4 xoops2jp/html/modules/base/service/LegacySearchService.class.php:1.1.2.5 --- xoops2jp/html/modules/base/service/LegacySearchService.class.php:1.1.2.4 Sat May 27 22:09:41 2006 +++ xoops2jp/html/modules/base/service/LegacySearchService.class.php Thu Jul 27 18:35:08 2006 @@ -7,30 +7,32 @@ /** * Sample class */ -class LegacySearchService extends XCube_Service +class Legacy_SearchService extends XCube_Service { + function prepare() + { + $this->register('GetItems'); + } + /** * @param $parameters['uid'] Target user's id * @param $parameters['current_uid'] Current user's id * @param $parameters['maxhit'] Max hit count of each modules. The default value is 5. * @param $parameters['mid'] If this is specified, search only one module. */ - function doGetItems(&$parameters) + function GetItems($uid = 0, $current_uid = 0, $queries = null, $andor = null, $max_hit = 5, $start = null, $mids = null) { $ret = array(); - $uid = isset($parameters['uid']) ? intval($parameters['uid']) : 0; - $queries = isset($parameters['queries']) ? $parameters['queries'] : null; - $andor = isset($parameters['andor']) ? $parameters['andor'] : null; + $uid = intval($uid); + $current_uid = intval($current_uid); + if ($andor == null) { $andor == "AND"; } - $maxhit = isset($parameters['maxhit']) ? intval($parameters['maxhit']) : 5; - $start = isset($parameters['offset']) ? intval($parameters['offset']) : null; - $userHandler =& xoops_gethandler('user'); - $currentUser =& $userHandler->get($parameters['current_uid']); + $currentUser =& $userHandler->get($current_uid); $gpermHandler = & xoops_gethandler( 'groupperm' ); $groups = is_object($currentUser) ? $currentUser->getGroups() : XOOPS_GROUP_ANONYMOUS; @@ -40,14 +42,7 @@ // $moduleHandler =& xoops_gethandler('module'); - $mids = array(); - if (isset($parameters['mids']) && is_array($parameters['mids'])) { - $mids = $parameters['mids']; - } - elseif (isset($parameters['mid'])) { - $mids[] = intval($parameters['mid']); - } - else { + if (!is_array($mids) || (is_array($mids) && count($mids) == 0)) { $criteria =& new CriteriaCompo(new Criteria('hassearch', 1)); $criteria->add(new Criteria('isactive', 1)); $mids =& array_keys($moduleHandler->getList($criteria)); @@ -107,6 +102,11 @@ return $ret; } + + function isOuterService() + { + return false; + } } ?> \ No newline at end of file