<?PHP
#
#   FILE:  EditAboutText.php
#
#   Part of the Collection Workflow Integration System (CWIS)
#   Copyright 2011-2013 Edward Almasy and Internet Scout Research Group
#   http://scout.wisc.edu/cwis/
#

# ----- 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");
}
