5 * Copyright 2004, Guillaume Smet
7 * This file is part of FusionForge. FusionForge is free software;
8 * you can redistribute it and/or modify it under the terms of the
9 * GNU General Public License as published by the Free Software
10 * Foundation; either version 2 of the Licence, or (at your option)
13 * FusionForge is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 require_once $gfwww.'search/include/engines/SearchEngine.class.php';
25 class GroupSearchEngine extends GFSearchEngine {
28 function GroupSearchEngine($type, $rendererClassName, $label) {
29 $this->GFSearchEngine($type, $rendererClassName, $label);
32 function isAvailable($parameters) {
33 if(isset($parameters[SEARCH__PARAMETER_GROUP_ID]) && $parameters[SEARCH__PARAMETER_GROUP_ID]) {
34 $Group = group_get_object($parameters[SEARCH__PARAMETER_GROUP_ID]);
35 if($Group && is_object($Group) && !$Group->isError()) {
36 $this->Group =& $Group;
43 function getSearchRenderer($words, $offset, $exact, $parameters) {
44 $this->includeSearchRenderer();
45 $rendererClassName = $this->rendererClassName;
46 $renderer = new $rendererClassName($words, $offset, $exact, $parameters[SEARCH__PARAMETER_GROUP_ID]);