You are here

function cache_actions_rules_cache_settings_form_validate in Cache Actions 7.2

Validates the cache settings.

1 string reference to 'cache_actions_rules_cache_settings_form_validate'
rules.inc in plugins/cache/rules.inc
Provides a simple time-based caching option for panel panes.

File

plugins/cache/rules.inc, line 245
Provides a simple time-based caching option for panel panes.

Code

function cache_actions_rules_cache_settings_form_validate($form, $values) {
  $args = func_get_args();
  $display = $form['display']['#value'];
  $pid = $form['pid']['#value'];
  foreach ($display->content as $pane) {
    if (!empty($pane->cache['method']) && $pane->cache['method'] == 'rules' && $pid != $pane->pid && $pane->cache['settings']['cache_key'] == $values['advanced']['cache_key']) {
      form_set_error('cache_key', t('The cache key must be unique'));
    }
  }
}