<?php
#
#   FILE:  SPT--PreviewComment.php
#
#   FUNCTIONS PROVIDED:
#
#   FUNCTIONS EXPECTED:
#
#   Part of the Scout Portal Toolkit
#   Copyright 2001 Internet Scout Project
#   http://scout.cs.wisc.edu
#

PageTitle("Preview Comment");

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

function PrintHeading()
{
    print "Preview Comment";
}

function PrintSubmitButton()
{
    global $IsUpdate;
    
    print ($IsUpdate ? "Update Message" : "Post New Comment");
}

function PrintSubject()
{
    global $F_Subject;

    print StripXSSThreats(stripslashes($F_Subject));
}

function PrintBody()
{
    global $F_Body;

    print StripXSSThreats(stripslashes($F_Body));
}

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

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

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

$ResourceId = $Session->Get("ResourceId");
$ParentId = $Session->Get("ParentId");
$F_Subject = $Session->Get("F_Subject");
$F_Body = $Session->Get("F_Body");
$IsUpdate = $Session->Get("IsUpdate");

# pass along variables for processing
$Session->PassVariable("ResourceId", $ResourceId);
$Session->PassVariable("ParentId", $ParentId);
$Session->PassVariable("F_Subject", $F_Subject);
$Session->PassVariable("F_Body", $F_Body);
$Session->PassVariable("IsUpdate",$IsUpdate);

if ($IsUpdate)
{
    $MessageId = $Session->Get("MessageId");
    $Session->PassVariable("MessageId", $MessageId);
}
?>
