Fixed minor things and added missing file
[vanilla-miry.git] / post.php
blobfe37f3daec4b433cd093c11f1b270843cc67e257
1 <?php
2 /*
3 * Copyright 2003 Mark O'Sullivan
4 * This file is part of Vanilla.
5 * Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
6 * Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 * You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8 * The latest source code for Vanilla is available at www.lussumo.com
9 * Contact Mark O'Sullivan at mark [at] lussumo [dot] com
11 * Description: Web form that handles creating & editing discussion topics & comments
14 include("appg/settings.php");
15 $Configuration['SELF_URL'] = 'post.php';
16 include("appg/init_vanilla.php");
18 // 1. DEFINE VARIABLES AND PROPERTIES SPECIFIC TO THIS PAGE
20 // Ensure the user is allowed to view this page
21 $Context->Session->Check($Context);
23 // Create the comment form
24 $CommentForm = $Context->ObjectFactory->CreateControl($Context, "DiscussionForm");
26 // Only people with active sessions can post
27 if ($Context->Session->UserID == 0) {
28 $Context->WarningCollector->Add($Context->GetDefinition("ErrSignInToDiscuss"));
29 $CommentForm->FatalError = 1;
32 // Define properties of the page controls that are specific to this page
33 $Head->BodyId = 'PostPage';
34 $Menu->CurrentTab = "discussions";
35 $Panel->CssClass = "PostPanel";
36 $Panel->BodyCssClass = "StartDiscussion";
38 // 2. BUILD PAGE CONTROLS
40 // Build the control panel
41 $Panel->AddList($Context->GetDefinition("Options"), 10);
42 $Panel->AddListItem($Context->GetDefinition("Options"), $Context->GetDefinition("BackToDiscussions"), GetUrl($Configuration, "index.php"));
44 // 3. ADD CONTROLS TO THE PAGE
46 $Page->AddRenderControl($Head, $Configuration["CONTROL_POSITION_HEAD"]);
47 $Page->AddRenderControl($Menu, $Configuration["CONTROL_POSITION_MENU"]);
48 $Page->AddRenderControl($Panel, $Configuration["CONTROL_POSITION_PANEL"]);
49 $Page->AddRenderControl($NoticeCollector, $Configuration['CONTROL_POSITION_NOTICES']);
50 $Page->AddRenderControl($CommentForm, $Configuration["CONTROL_POSITION_BODY_ITEM"]);
51 $Page->AddRenderControl($Foot, $Configuration["CONTROL_POSITION_FOOT"]);
52 $Page->AddRenderControl($PageEnd, $Configuration["CONTROL_POSITION_PAGE_END"]);
55 // 4. FIRE PAGE EVENTS
57 $Page->FireEvents();