You are here

function panels_simple_cache_settings_form in Panels 6.3

Same name and namespace in other branches
  1. 5.2 panels_simple_cache/panels_simple_cache.module \panels_simple_cache_settings_form()
  2. 6.2 panels_simple_cache/panels_simple_cache.module \panels_simple_cache_settings_form()
  3. 7.3 plugins/cache/simple.inc \panels_simple_cache_settings_form()
1 string reference to 'panels_simple_cache_settings_form'
simple.inc in plugins/cache/simple.inc
Provides a simple time-based caching option for panel panes.

File

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

Code

function panels_simple_cache_settings_form($conf, $display, $pid) {
  $options = drupal_map_assoc(array(
    15,
    30,
    60,
    120,
    180,
    240,
    300,
    600,
    900,
    1200,
    1800,
    3600,
    7200,
    14400,
    28800,
    43200,
    86400,
    172800,
    259200,
    345600,
    604800,
  ), 'format_interval');
  $form['lifetime'] = array(
    '#title' => t('Lifetime'),
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => $conf['lifetime'],
  );
  $form['granularity'] = array(
    '#title' => t('Granularity'),
    '#type' => 'select',
    '#options' => array(
      'args' => t('Arguments'),
      'context' => t('Context'),
      'none' => t('None'),
    ),
    '#description' => t('If "arguments" are selected, this content will be cached per individual argument to the entire display; if "contexts" are selected, this content will be cached per unique context in the pane or display; if "neither" there will be only one cache for this pane.'),
    '#default_value' => $conf['granularity'],
  );
  return $form;
}