3 * FusionForge Project Home
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2010, FusionForge Team
7 * Copyright (C) 2011-2012 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 require_once $gfwww.'news/news_utils.php';
27 require_once $gfwww.'include/trove.php';
28 require_once $gfwww.'include/project_summary.php';
29 require_once $gfcommon.'include/tag_cloud.php';
30 require_once $gfcommon.'include/HTTPRequest.class.php';
31 require_once $gfcommon.'widget/WidgetLayoutManager.class.php';
33 session_require_perm ('project_read', $group_id) ;
35 $title = _('Project Home');
37 use_javascript('/scripts/prototype/prototype.js');
38 use_javascript('/scripts/scriptaculous/scriptaculous.js');
39 use_javascript('/scripts/codendi/Tooltip.js');
40 use_javascript('/scripts/codendi/LayoutManager.js');
41 use_javascript('/scripts/codendi/ReorderColumns.js');
43 $request =& HTTPRequest::instance();
44 $request->set('group_id', $group_id);
46 $params['submenu'] = '';
48 if (session_loggedin()) {
49 $group = group_get_object($group_id);
50 if (!$group || !is_object($group)) {
52 } elseif ($group->isError()) {
53 exit_error($group->getErrorMessage(), 'home');
56 // Display with the preferred layout/theme of the user (if logged-in)
57 $perm =& $group->getPermission();
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 $params = array('group_id' => $group_id);
84 plugin_hook('project_before_widgets', $params);
86 $lm = new WidgetLayoutManager();
87 $lm->displayLayout($group_id, WidgetLayoutManager::OWNER_TYPE_GROUP);
89 site_project_footer(array());
93 // c-file-style: "bsd"