You are here

function blockanimate_validate_infinite_loop_checkbox in BlockAnimate 7

Helper function.

Validates the infinite loop checkbox. This option can't be checked if the Animate Iteration option is set.

1 string reference to 'blockanimate_validate_infinite_loop_checkbox'
_blockanimate_add_form_animate_css_fields in ./blockanimate.module
Helper function.

File

./blockanimate.module, line 213
Add CSS3 cross-browser animation to any Drupal block.

Code

function blockanimate_validate_infinite_loop_checkbox($element, &$form_state, $form) {
  $field_value = $element['#value'];
  if ($field_value) {
    $animate_css_iteration = $form_state['values']['animate_css_wow_iteration'];
    if (strlen($animate_css_iteration) > 0) {
      form_error($element, t("@field_name This option can't be checked when you set the Animation Iteration option.", array(
        '@field_name' => $element['#title'],
      )));
    }
  }
}