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

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

$ReturnTo = GetArrayValue($_POST, "ReturnTo", "Home");
$ResourceId = GetArrayValue($_POST, "ResourceId");
$Tags = GetArrayValue($_POST, "Tags");

# transform the tags into an array
$Tags = explode("\n", $Tags);

$AF->SuppressHtmlOutput();
$AF->SetJumpToPage($ReturnTo);

$Resource = new Resource($ResourceId);

if ($Resource->Status() == 1)
{
    $AF->SignalEvent("TAGS_EDIT_TAGS", array($User, $Resource, $Tags));
}
