#!/usr/bin/perl
# ----------------------------------------------------------------------------
# This software is Copyright (C) 2007, All Rights Reserved
# ----------------------------------------------------------------------------
# This program is protected by local and international copyright laws. Any
# use of this program is subject to the the terms of the license agreement
# included as part of this distribution archive. Any other uses are strictly
# prohibited without the written permission of the Vendor and all
# other rights are reserved.
# -----------------------------------------------------------------------------
# Warning : Modifying this program violates your license agreement!
# -----------------------------------------------------------------------------

package IT::ArtMan::CustomFields::Admin::PublishRules::SelectedCategories;

# load modules
use strict;

use IT::Globals;

# ------------------------------------------------------------------------------
# Function    : createFieldHtml
# Description :
# Usage       : &IT::ArtMan::CustomFields::Admin::PublishRules::SelectedCategories::createFieldHtml($tableNameWithPrefix, $fieldName, $placeholders)
# ------------------------------------------------------------------------------

sub createFieldHtml {
  my $tableName         = shift;
  my $fieldName         = shift;
  my $placeholders      = shift;
  my $template          = "admin/menus/_customEditFields.html";
  my $categoryTableName = $TABLE_PREFIX . "category";

  $placeholders = { %{$placeholders} };  # copy hash values so we don't modify global

  ### NOTE: This field is hard coded in the template, we don't need to auto generate html for it!

  return '';
}

# ------------------------------------------------------------------------------
# Function    : getRecordFieldFromFormInput
# Description : return record value for category rights data
# Usage       : my $recordFieldValue = &IT::ArtMan::CustomFields::Admin::PublishRules::SelectedCategories::getRecordFieldFromFormInput($fieldName)
# ------------------------------------------------------------------------------

sub getRecordFieldFromFormInput {
  my $fieldName = shift || die "no fieldname specified!";

  my $recordValue = join "\t", @{$FORM_ARRAYS->{$fieldName}};

  return $recordValue;
}

# ------------------------------------------------------------------------------
# Function    : getPlaceholderFromRecordField
# Description :
# Usage       : my $placeholderValue = &IT::ArtMan::CustomFields::Admin::PublishRules::SelectedCategories::getPlaceholderFromRecordField($recordFieldValue)
# ------------------------------------------------------------------------------

sub getPlaceholderFromRecordField {
  my $recordFieldValue = shift;
  my $placeholderValue;

  $placeholderValue = $recordFieldValue;

  return $placeholderValue;
}

# ------------------------------------------------------------------------------
# Function    : errorCheckingForUserInput
# Description :
# Usage       : &IT::ArtMan::CustomFields::Admin::PublishRules::SelectedCategories::errorCheckingForUserInput()
# ------------------------------------------------------------------------------

sub errorCheckingForUserInput {
  my($fieldLabelOrName, $fieldValue, $fieldName, $tableName, $recordNum) = @_;
  my $error;

  # NOTE: No input checking required

  # return errors
  if ($error) { return $error; }
  else        { return; } # return empty list so nothing is added to errors array
}

# ----------------------------------------------------------------------------
# end of file
1;

