<?PHP
#
#   FILE:  FieldDefinition.php
#
#   FUNCTIONS PROVIDED:
#       PrintDefinition()
#
#   FUNCTIONS EXPECTED:
#       None
#
#   Part of the Collection Workflow Integration System (CWIS)
#   Copyright 2011 Internet Scout Project
#   http://scout.wisc.edu/
#

PageTitle("Field Definition");
# provide relative path to base SPT directory

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

# print the heading
function PrintDefinition()
{
    global $Session;

    $Schema = new MetadataSchema();
    $FieldId = $Session->Get("FieldId");
    $Field = $Schema->GetField($FieldId);

    print $Field->Description();
}

function PrintFieldName()
{
    global $Session;

    $Schema = new MetadataSchema();
    $FieldId = $Session->Get("FieldId");
    $Field = $Schema->GetField($FieldId);

    print $Field->GetDisplayName();
}

function PrintReturnButton()
{
    $RFactory = new ResourceFactory();
    $ResourceId = $RFactory->GetCurrentEditedItemId();
    $Resource = new Resource($ResourceId);
    $IsTemp = $Resource->IsTempResource();
    $Label = $IsTemp ? "Add New Resource" : "Edit Resource";
    print "Return to ".$Label;
}
