You are here

function revisioning_revisions_summary_validate in Revisioning 6.4

Same name and namespace in other branches
  1. 8 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.

_state

Parameters

$form:

Return value

void

File

./revisioning_theme.inc, line 108
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,
    )));
  }
}