You are here

function revisioning_revisions_summary_validate in Revisioning 8

Same name and namespace in other branches
  1. 6.4 revisioning_theme.inc \revisioning_revisions_summary_validate()
  2. 6.3 revisioning_theme.inc \revisioning_revisions_summary_validate()
  3. 7 revisioning_theme.inc \revisioning_revisions_summary_validate()

Validation for input form to select two revisions.

Parameters

array $form: The form

array $form_state: the form state

File

./revisioning_theme.inc, line 147
Include file for revisioning.module; deals with all theming aspects.

Code

function revisioning_revisions_summary_validate($form, &$form_state) {

  // Strip out all unchecked boxes.
  $form_state['values']['tickbox'] = array_filter($form_state['values']['tickbox']);
  $count = count($form_state['values']['tickbox']);
  if ($count != 2) {
    form_set_error('tickbox', t('Please select 2 revisions rather than @count', array(
      '@count' => $count,
    )));
  }
}