You are here

function cache_actions_rules_cache_settings_form in Cache Actions 7

Same name and namespace in other branches
  1. 6.2 plugins/cache/rules.inc \cache_actions_rules_cache_settings_form()
  2. 7.2 plugins/cache/rules.inc \cache_actions_rules_cache_settings_form()
1 string reference to 'cache_actions_rules_cache_settings_form'
rules.inc in plugins/cache/rules.inc
Provides a simple time-based caching option for panel panes.

File

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

Code

function cache_actions_rules_cache_settings_form(&$conf, $display, $pid) {
  $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'],
  );
  $form['language'] = array(
    '#title' => t('Cache per language'),
    '#type' => 'checkbox',
    '#default_value' => $conf['language'],
    '#description' => t('Select this if you want to cache content per language'),
  );

  // This is a hack to make sure that we have the cache key for the panel
  // at all times when we need to invalidate the cache. When all caching options
  // are implemented in Panels for Drupal 7, we should be able to remove this.
  $form['cache_key'] = array(
    '#type' => 'value',
    '#value' => $display->cache_key,
  );
  return $form;
}