$Discussion->GetPropertiesFromDataSet($Row, $Context->Configuration); $Discussion->FormatPropertiesForDisplay(); $Suffix = ""; if ($Discussion->NewComments > 0) { $Suffix .= str_replace('//1', $Discussion->NewComments, $Context->GetDefinition("XNew")); } $Panel->AddListItem($ListTitle, $Discussion->Name, GetUnreadQuerystring($Discussion, $Context->Configuration, $Context->Session->User->Preference('JumpToLastReadComment')), $Suffix); } if ($ActualRecords >= $MaxRecords) { $Panel->AddListItem($ListTitle, $Context->GetDefinition("ShowAll"), GetUrl($Context->Configuration, "index.php", "", "", "", "", "View=" . $UrlAction)); } } } } $DiscussionManager = $Context->ObjectFactory->NewContextObject($Context, "DiscussionManager"); AddBookmarksToPanel($Context, $Panel, $DiscussionManager, ForceIncomingInt("DiscussionID", 0)); AddDiscussionsToPanel($Context, $Panel, $DiscussionManager, "GetDiscussionsByUserID", $Configuration["PANEL_USER_DISCUSSIONS_COUNT"], $Context->GetDefinition("YourDiscussions"), "YourDiscussions", $Context->Session->User->Preference("ShowRecentDiscussions")); AddDiscussionsToPanel($Context, $Panel, $DiscussionManager, "GetViewedDiscussionsByUserID", $Configuration["PANEL_HISTORY_COUNT"], $Context->GetDefinition('BrowsingHistory'), "History", $Context->Session->User->Preference("ShowBrowsingHistory")); if ($Configuration["ENABLE_WHISPERS"] && $Context->Session->User->Preference("ShowPrivateDiscussions")) { AddDiscussionsToPanel($Context, $Panel, $DiscussionManager, "GetPrivateDiscussionsByUserID", $Configuration["PANEL_PRIVATE_COUNT"], $Context->GetDefinition("WhisperedDiscussions"), "Private", $Context->Session->User->Preference("ShowPrivateDiscussions")); } } if ($Context->SelfUrl == "comments.php") { if ($Context->Session->User->Preference("ShowBookmarks")) { // Include the js required to remove/add the discussions to the panel when // items are un/bookmarked $Head->AddScript('extensions/PanelLists/functions.js', '~', 390); $Context->PassThruVars['SetBookmarkOnClick'] .= ' SetBookmarkList(' . ForceIncomingInt('DiscussionID', 0) . ');'; } } // Apply discussion filters
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);