5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2004 (c) Guillaume Smet / Open Wide
7 * http://fusionforge.org
9 * This file is part of FusionForge.
11 * FusionForge is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with FusionForge; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 require_once $gfwww.'search/include/renderers/HtmlSearchRenderer.class.php';
28 class HtmlGroupSearchRenderer extends HtmlSearchRenderer {
30 /** TODO: Find what for is $offset, looks like it's not used, added to remove warning
49 * @param string $typeOfSearch type of the search (Software, Forum, People and so on)
50 * @param string $words words we are searching for
51 * @param int $offset offset
52 * @param boolean $isExact if we want to search for all the words or if only one matching the query is sufficient
53 * @param object $searchQuery SearchQuery instance
54 * @param int $groupId group id
56 function HtmlGroupSearchRenderer($typeOfSearch, $words, $isExact, $searchQuery, $groupId, $topTab = '') {
57 $this->HtmlSearchRenderer($typeOfSearch, $words, $isExact, $searchQuery);
58 $this->groupId = $groupId;
59 $this->topTab = $topTab;
63 * writeHeader - write the header of the output
65 function writeHeader() {
66 site_project_header(array('title' => _('Search'), 'group' => $this->groupId, 'toptab' => $this->topTab));
67 parent::writeHeader();
71 * getPreviousResultsUrl - get the url to go to see the previous results
73 * @return string url to previous results page
75 function getPreviousResultsUrl() {
76 return parent::getPreviousResultsUrl().'&group_id='.$this->groupId;
80 * getNextResultsUrl - get the url to go to see the next results
82 * @return string url to next results page
84 function getNextResultsUrl() {
85 return parent::getNextResultsUrl().'&group_id='.$this->groupId;
89 * isGroupMember - returns if the logged in user is member of the current group
91 * @param int $groupId group id
93 static function isGroupMember($groupId) {
94 $Group =& group_get_object($groupId);
95 if($Group && is_object($Group) && !$Group->isError() && session_loggedin()) {
96 $perm =& $Group->getPermission ();
97 if($perm && is_object($perm) && $perm->isMember()) {