You are here

public function views_plugin_cache_time::options_validate in Views (for Drupal 7) 7.3

Validate the options form.

Overrides views_plugin::options_validate

File

plugins/views_plugin_cache_time.inc, line 80
Definition of views_plugin_cache_time.

Class

views_plugin_cache_time
Simple caching of query results for Views displays.

Code

public function options_validate(&$form, &$form_state) {
  $custom_fields = array(
    'output_lifespan',
    'results_lifespan',
  );
  foreach ($custom_fields as $field) {
    if ($form_state['values']['cache_options'][$field] == 'custom' && !is_numeric($form_state['values']['cache_options'][$field . '_custom'])) {
      form_error($form[$field . '_custom'], t('Custom time values must be numeric.'));
    }
  }
}