function views_plugin_cache_time::options_form

Same name in other branches
  1. 7.x-3.x plugins/views_plugin_cache_time.inc \views_plugin_cache_time::options_form()

Overrides views_plugin::options_form

File

plugins/views_plugin_cache_time.inc, line 15

Class

views_plugin_cache_time
Simple caching of query results for Views displays.

Code

function options_form(&$form, &$form_state) {
    $options = array(
        60,
        300,
        1800,
        3600,
        21600,
        518400,
    );
    $options = drupal_map_assoc($options, 'format_interval');
    $options = array(
        -1 => t('Never cache'),
    ) + $options;
    $form['results_lifespan'] = array(
        '#type' => 'select',
        '#title' => t('Query results'),
        '#description' => t('The length of time raw query results should be cached.'),
        '#options' => $options,
        '#default_value' => $this->options['results_lifespan'],
    );
    $form['output_lifespan'] = array(
        '#type' => 'select',
        '#title' => t('Rendered output'),
        '#description' => t('The length of time rendered HTML output should be cached.'),
        '#options' => $options,
        '#default_value' => $this->options['output_lifespan'],
    );
}