3 * FusionForge Project Home
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2010, FusionForge Team
7 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org
10 * This file is part of FusionForge.
12 * FusionForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with FusionForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 require_once $gfwww.'news/news_utils.php';
28 require_once $gfwww.'include/trove.php';
29 require_once $gfwww.'include/project_summary.php';
30 require_once $gfcommon.'include/tag_cloud.php';
31 require_once $gfcommon.'include/HTTPRequest.class.php';
32 require_once $gfcommon.'widget/WidgetLayoutManager.class.php';
34 session_require_perm ('project_read', $group_id) ;
36 $title = _('Project Home');
38 use_javascript('/scripts/prototype/prototype.js');
39 use_javascript('/scripts/scriptaculous/scriptaculous.js');
40 use_javascript('/scripts/codendi/Tooltip.js');
41 use_javascript('/scripts/codendi/LayoutManager.js');
42 use_javascript('/scripts/codendi/ReorderColumns.js');
44 $request =& HTTPRequest::instance();
45 $request->set('group_id',$group_id);
47 $params['submenu'] = '';
49 if (session_loggedin()) {
50 $group = group_get_object($group_id);
51 if (!$group || !is_object($group)) {
53 } elseif ($group->isError()) {
54 exit_error($group->getErrorMessage(), 'home');
57 $perm =& $group->getPermission( session_get_user() );
58 if ($perm && is_object($perm) && $perm->isAdmin()) {
60 FROM layouts AS l INNER JOIN owner_layouts AS o ON(l.id = o.layout_id)
61 WHERE o.owner_type = $1
65 $res = db_query_params($sql,array('g', $group_id));
66 if($res && db_numrows($res)<1) {
67 $lm = new WidgetLayoutManager();
68 $lm->createDefaultLayoutForProject($group_id,1);
69 $res = db_query_params($sql,array('g', $group_id));
71 $id = db_result($res, 0 , 'id');
72 $params['submenu'] = $HTML->subMenu(
73 array(_("Add widgets"),
74 _("Customize Layout")),
75 array('/widgets/widgets.php?owner=g'. $group_id .'&layout_id='. $id,
76 '/widgets/widgets.php?owner=g'. $group_id .'&layout_id='. $id.'&update=layout'));
80 site_project_header(array('title'=>$title, 'h1' => '', 'group'=>$group_id, 'toptab' => 'home',
81 'submenu' => $params['submenu']));
83 $lm = new WidgetLayoutManager();
84 $lm->displayLayout($group_id, WidgetLayoutManager::OWNER_TYPE_GROUP);
86 site_project_footer(array());
90 // c-file-style: "bsd"