<?PHP
#
#   FILE:  EditAboutText.php
#
#   Copyright 2011 Internet Scout Project
#   http://scout.wisc.edu/
#

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

function PrintAboutText() { PrintValue("AboutText"); }
function PrintPortalName() {  PrintValue("PortalName");  }

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

function PrintValue($ValueName)
{
    global $SysConfig, $Session;

    $FormFieldName = "F_" . $ValueName;
    $Value = $Session->Get($FormFieldName);

    if (!is_null($Value))
    {
        $Session->UnregisterVariable($FormFieldName);
    }

    else if (method_exists($SysConfig, $ValueName))
    {
        $Value = $SysConfig->{$ValueName}();
    }

    print $Value;
}

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

PageTitle("Edit About Text");

# check if current user is authorized
CheckAuthorization(PRIV_SYSADMIN);

if (isset($_GET["FromSysConfig"]))
{
    $Session->PassVariable("FromSysConfig", "true");
}
