You are here

function cacheflush_ui_tab_validation in CacheFlush 8

Same name and namespace in other branches
  1. 7.3 modules/cacheflush_ui/includes/cacheflush_ui.presets.inc \cacheflush_ui_tab_validation()

Callback for tab validation.

1 string reference to 'cacheflush_ui_tab_validation'
cacheflush_ui_cacheflush_ui_tabs in modules/cacheflush_ui/cacheflush_ui.module
Implements hook_cacheflush_ui_tabs().

File

modules/cacheflush_ui/cacheflush_ui.module, line 82
Cacheflush User Interface.

Code

function cacheflush_ui_tab_validation($tab, &$form, &$form_state) {
  $values = $form_state
    ->getValue($tab);
  if ($values) {
    $storage = $form_state
      ->getStorage();
    foreach ($values as $preset => $value) {
      if ($value) {
        $storage['presets'][$preset]['functions'] = $storage['preset_options'][$preset]['functions'];
        $form_state
          ->setStorage($storage);
      }
    }
  }
}