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

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

$ReturnTo = GetFormValue("ReturnTo", "Home");
$ResourceId = GetFormValue("ResourceId");
$Tags = GetFormValue("Tags");

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

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

if (Resource::ItemExists($ResourceId))
{
    $Resource = new Resource($ResourceId);
    $AF->SignalEvent("TAGS_EDIT_TAGS", array($User, $Resource, $Tags));
}
