You are here

function _votingapi_validate_action_condition in Voting API 5

1 call to _votingapi_validate_action_condition()
_votingapi_validate_action_set in ./votingapi_actions.module

File

./votingapi_actions.module, line 415

Code

function _votingapi_validate_action_condition($condition) {
  $errors = array();
  if (!is_array($condition)) {
    $errors[] = "The condition is not an array!";
    return $errors;
  }
  if (!isset($condition['handler'])) {
    $errors[] = "The condition has no handler.";
  }
  if (!function_exists($condition['handler'])) {
    $handler = $condition['handler'];
    $errors[] = "The condition has an invalid handler ({$handler}).";
  }
  return $errors;
}