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

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;
}
