<?PHP
#
#   FILE:  PreviewComment.php
#
#   Part of the Collection Workflow Integration System (CWIS)
#   Copyright 2012 Internet Scout Project
#   http://scout.wisc.edu/
#

PageTitle("Preview Comment");

# ----- EXPORTED FUNCTIONS ---------------------------------------------------

function PrintSubmitButton()
{
    global $IsUpdate;

    print ($IsUpdate ? "Update Message" : "Post New Comment");
}

function PrintSubject()
{
    global $F_Subject;

    print defaulthtmlentities(stripslashes($F_Subject));
}

function PrintBody()
{
    global $F_Body;

    print nl2br(defaulthtmlentities(stripslashes($F_Body)));
}

/**
 * THIS FUNCTION IS DEPRECATED
 */
function PrintHeading()
{
    print "Preview Comment";
}

# ----- LOCAL FUNCTIONS ------------------------------------------------------

# ----- MAIN -----------------------------------------------------------------

# non-standard global variables
global $F_Body;
global $F_Subject;

$ResourceId = $_SESSION["ResourceId"];
$ParentId = $_SESSION["ParentId"];
$F_Subject = $_SESSION["F_Subject"];
$F_Body = $_SESSION["F_Body"];
$IsUpdate = $_SESSION["IsUpdate"];

if (isset($_POST["ForumId"]))
{
    $ForumId = intval($_POST["ForumId"]);
}
elseif (isset($_GET["ForumId"]))
{
    $ForumId = intval($_GET["ForumId"]);
}
elseif (isset($_SESSION["ForumId"]))
{
    $ForumId = $_SESSION["ForumId"];
}