You are here

function highcharttable_admin_configure_form_validate in HighchartTable 7

Validate the configuration form submission.

Parameters

array $form: The submitted configuration form.

array $form_state: The submitted configuration form state.

File

./highcharttable.admin.inc, line 329
highcharttable.admin.inc

Code

function highcharttable_admin_configure_form_validate(&$form, &$form_state) {

  // Clear out the form of stuff we do not wish to save, like buttons.
  form_state_values_clean($form_state);
  foreach ($form_state['values']['decorations'] as $key => $decoration) {
    if (empty($decoration['pages-and-selector']['include-pages'])) {

      // If a decoration has no pages to show itself on, remove it altogether.
      unset($form_state['values']['decorations'][$key]);
    }
  }

  // Make sure that keys are numeric, consecutive and start at 0.
  $form_state['values']['decorations'] = array_values($form_state['values']['decorations']);
}