You are here

function flag_actions_form_validate in Flag 6.2

Same name and namespace in other branches
  1. 6 flag_actions.module \flag_actions_form_validate()
  2. 7.3 flag_actions.module \flag_actions_form_validate()
  3. 7.2 flag_actions.module \flag_actions_form_validate()

Generic submit handler for validating flag actions.

File

./flag_actions.module, line 517
Actions support for the Flag module.

Code

function flag_actions_form_validate($form, &$form_state) {

  // Special validation handlers may be needed to save this form properly.
  // Try to load the action's validation routine if needed.
  if (isset($form_state['values']['flag']['callback'])) {
    $callback = $form_state['values']['flag']['callback'];
    $validate_function = $callback . '_validate';
    if (function_exists($validate_function)) {
      $validate_function($form, $form_state);
    }
  }
}