/
survey_utils.php
100 lines (88 loc) · 2.44 KB
/
survey_utils.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
/**
* GForge Survey Facility
*
* Portions Copyright 1999-2001 (c) VA Linux Systems
* The rest Copyright 2002-2004 (c) GForge Team
* http://gforge.org/
*
* @version $Id$
*
* This file is part of GForge.
*
* GForge is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GForge; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
Survey System
By Tim Perdue, Sourceforge, 11/99
*/
function survey_header($params) {
global $group_id,$is_admin_page,$HTML,$sys_use_survey;
if (!$sys_use_survey) {
exit_disabled();
}
$params['toptab']='surveys';
$params['group']=$group_id;
if ($project =& group_get_object($group_id)){
if (!$project->usesSurvey()) {
exit_error(_('Error'), _('This Group Has Turned Off Surveys.'));
}
site_project_header($params);
if ($is_admin_page && $group_id) {
echo ($HTML->subMenu(
array(
_('Surveys'),
_('Admin'),
_('Add Survey'),
_('Edit Survey'),
_('Add Questions'),
_('Edit Questions'),
_('Show Results')
),
array(
'/survey/?group_id='.$group_id,
'/survey/admin/?group_id='.$group_id,
'/survey/admin/add_survey.php?group_id='.$group_id,
'/survey/admin/edit_survey.php?group_id='.$group_id,
'/survey/admin/add_question.php?group_id='.$group_id,
'/survey/admin/show_questions.php?group_id='.$group_id,
'/survey/admin/show_results.php?group_id='.$group_id
)
));
} else {
if (session_loggedin()) {
$perm =& $project->getPermission(session_get_user());
if ($perm && is_object($perm) && !$perm->isError() && $perm->isAdmin()) {
echo ($HTML->subMenu(
array(
_('Admin')
),
array(
'/survey/admin/?group_id='.$group_id
)
));
}
}
}
}// end if (valid group id)
}
function survey_footer($params) {
site_project_footer($params);
}
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
?>