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 * Copyright 2013, Franck Villaume - TrivialDev
9 * http://fusionforge.org
11 * This file is part of FusionForge. FusionForge is free software;
12 * you can redistribute it and/or modify it under the terms of the
13 * GNU General Public License as published by the Free Software
14 * Foundation; either version 2 of the Licence, or (at your option)
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 along
23 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 $request =& HTTPRequest::instance();
39 $request->set('group_id', $group_id);
41 $params['submenu'] = '';
43 if (session_loggedin()) {
44 $group = group_get_object($group_id);
45 if (!$group || !is_object($group)) {
47 } elseif ($group->isError()) {
48 exit_error($group->getErrorMessage(), 'home');
51 // Display with the preferred layout/theme of the user (if logged-in)
52 $perm =& $group->getPermission();
53 if ($perm && is_object($perm) && $perm->isAdmin()) {
55 FROM layouts AS l INNER JOIN owner_layouts AS o ON(l.id = o.layout_id)
56 WHERE o.owner_type = $1
60 $res = db_query_params($sql,array('g', $group_id));
61 if($res && db_numrows($res)<1) {
62 $lm = new WidgetLayoutManager();
63 $lm->createDefaultLayoutForProject($group_id,1);
64 $res = db_query_params($sql,array('g', $group_id));
66 $id = db_result($res, 0 , 'id');
67 $params['submenu'] = $HTML->subMenu(
68 array(_("Add widgets"),
69 _("Customize Layout")),
70 array('/widgets/widgets.php?owner=g'. $group_id .'&layout_id='. $id,
71 '/widgets/widgets.php?owner=g'. $group_id .'&layout_id='. $id.'&update=layout'));
76 site_project_header(array('title'=>$title, 'h1' => '', 'group'=>$group_id, 'toptab' => 'home',
77 'submenu' => $params['submenu']));
79 $params = array('group_id' => $group_id);
80 plugin_hook('project_before_widgets', $params);
82 $lm = new WidgetLayoutManager();
83 $lm->displayLayout($group_id, WidgetLayoutManager::OWNER_TYPE_GROUP);
85 site_project_footer(array());
89 // c-file-style: "bsd"