-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
64 lines (52 loc) · 3.2 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/*
* Copyright 2003 - 2005 Mark O'Sullivan
* This file is part of Vanilla.
* 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.
* 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.
* 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
* The latest source code for Vanilla is available at www.lussumo.com
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
*
* Description: Display and manipulate discussions
*/
include("appg/settings.php");
include_once(sgLIBRARY."Vanilla.Discussion.class.php");
include_once(sgLIBRARY."Vanilla.Comment.class.php");
include_once(sgLIBRARY."Vanilla.Search.class.php");
include_once(sgLIBRARY."Utility.Pagelist.class.php");
include_once(sgLIBRARY."Input.Validator.class.php");
include("appg/init_internal.php");
// 1. DEFINE VARIABLES AND PROPERTIES SPECIFIC TO THIS PAGE
// Ensure the user is allowed to view this page
$Context->Session->Check(agSAFE_REDIRECT);
// Instantiate data managers to be used in this page
$DiscussionManager = $Context->ObjectFactory->NewContextObject($Context, "DiscussionManager");
$SearchManager = $Context->ObjectFactory->NewContextObject($Context, "SearchManager");
// Define properties of the page controls that are specific to this page
$Menu->CurrentTab = "discussions";
$Panel->CssClass = "DiscussionPanel";
$Body->CssClass = "Discussions";
// 2. BUILD PAGE CONTROLS
// Panel
AddDiscussionOptionsToPanel($Context, $Panel);
AddBookmarksToPanel($Context, $Panel, $DiscussionManager);
AddDiscussionsToPanel($Context, $Panel, $DiscussionManager, "GetDiscussionsByUserID", agPANEL_USERDISCUSSIONS_COUNT, $Context->GetDefinition("YourDiscussions"), "Recent", $Context->Session->User->Setting("ShowRecentDiscussions"));
AddDiscussionsToPanel($Context, $Panel, $DiscussionManager, "GetViewedDiscussionsByUserID", agPANEL_HISTORY_COUNT, $Context->GetDefinition("History"), "History", $Context->Session->User->Setting("ShowBrowsingHistory"));
AddSearchesToPanel($Context, $Panel, $SearchManager, agPANEL_SEARCH_COUNT);
//AddAppendixToPanel($Context, $Panel, "Discussion");
//AddTextModeToPanel($Context, $Panel);
AddGuestInfoToPanel($Context, $Panel);
// Add the discussion grid to the body
$CategoryID = ForceIncomingInt("CategoryID", 0);
$View = ForceIncomingString("View", "");
$DiscussionGrid = $Context->ObjectFactory->NewContextObject($Context, "DiscussionGrid", $DiscussionManager, $CategoryID, $View);
$Body->AddControl($DiscussionGrid);
// 3. ADD CONTROLS TO THE PAGE
$Page->AddControl("Head_Render", $Head);
$Page->AddControl("Menu_Render", $Menu);
$Page->AddControl("Panel_Render", $Panel);
$Page->AddControl("Body_Render", $Body);
// 4. FIRE PAGE EVENTS
$Page->FireEvents();
?>