3 * FusionForge SCM Library
5 * Copyright 2004-2005 (c) GForge LLC, Tim Perdue
6 * Copyright 2010 (c), Franck Villaume
7 * Copyright (C) 2010-2011 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
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 along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 function scm_header($params) {
28 if (!forge_get_config('use_scm')) {
32 $project = group_get_object($params['group']);
33 if (!$project || !is_object($project)) {
35 } elseif ($project->isError()) {
36 exit_error($project->getErrorMessage(),'scm');
39 if (!$project->usesSCM()) {
45 if (session_loggedin()) {
46 if (forge_check_perm ('project_admin', $project->getID())) {
47 $params['submenu'] = $HTML->subMenu(
49 _('View Source Code'),
54 '/scm/?group_id='.$params['group'],
55 '/scm/reporting/?group_id='.$params['group'],
56 '/scm/admin/?group_id='.$params['group']
62 $params['toptab'] = 'scm';
63 site_project_header($params);
64 echo '<div id="scm" class="scm">';
67 function scm_footer() {
69 site_project_footer(array());
74 // c-file-style: "bsd"