3 * Forum Pending Messages Detail
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * Copyright 2002-2004 (c) GForge Team
7 * Copyright 2005 (c) Daniel Perez
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('../../env.inc.php');
27 require_once $gfcommon.'include/pre.php';
28 require_once $gfcommon.'forum/ForumHTML.class.php';
29 require_once $gfcommon.'forum/ForumAdmin.class.php';
30 require_once $gfcommon.'forum/Forum.class.php';
31 require_once $gfcommon.'forum/ForumMessage.class.php';
33 $msg_id = getIntFromRequest("msg_id");
34 $group_id = getIntFromRequest('group_id');
35 $forum_id = getIntFromRequest("forum_id");
39 $fa = new ForumAdmin($group_id);
41 if ( (!$forum_id) || (!$group_id) || (!$msg_id) ) {
42 exit_missing_param('',array(_('Forum ID'),_('Project ID'),_('Message ID')),'forums');
45 session_require_perm ('forum', $group_id, 'moderate') ;
48 $g =& $fa->GetGroupObject();
49 $f=new Forum($g,$forum_id);
50 if (!$f || !is_object($f)) {
51 exit_error(_('Error'),"Error getting new Forum");
52 } elseif ($f->isError()) {
53 exit_error(_('Error'),$f->getErrorMessage());
55 $fm = new ForumMessage($f,$msg_id,false,true); //create the pending message
56 if (!$fm || !is_object($fm)) {
57 exit_error(_('Error getting new ForumMessage'),'forums');
58 } elseif ($fm->isError()) {
59 exit_error(_('Error getting new ForumMessage: ').$fm->getErrorMessage(),'forums');
61 $fhtml = new ForumHTML($f);
62 if (!$fhtml || !is_object($fhtml)) {
63 exit_error(_('Error getting new ForumHTML'),'forums');
64 } elseif ($fhtml->isError()) {
65 exit_error($fhtml->getErrorMessage(),'forums');
67 forum_header(array());
68 echo $fhtml->showPendingMessage($fm);
69 $HTML->footer(array());
73 // c-file-style: "bsd"