<?PHP
#
#   FILE:  RemoveTag.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 -----------------------------------------------------------------

$AF->SuppressHTMLOutput();

# get URL parameters
$ResourceId = GetFormValue("ResourceId");
$Tag = GetFormValue("Tag");

# valid parameter values
if (!is_null($ResourceId) && !is_null($Tag))
{
    # valid resource ID
    if (Resource::ItemExists($ResourceId))
    {
        $Resource = new Resource($ResourceId);
        $AF->SignalEvent("TAGS_REMOVE_TAG", array($User, $Resource, $Tag));
    }
}
