You are here

function panels_edit_cache_method_form in Panels 7.3

Same name and namespace in other branches
  1. 5.2 includes/display_edit.inc \panels_edit_cache_method_form()
  2. 6.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_edit_cache_method_form()
  3. 6.2 includes/display-edit.inc \panels_edit_cache_method_form()

Choose cache method form.

1 string reference to 'panels_edit_cache_method_form'
panels_renderer_editor::ajax_cache_method in plugins/display_renderers/panels_renderer_editor.class.php
AJAX entry point to configure the cache method for a pane or the display.

File

plugins/display_renderers/panels_renderer_editor.class.php, line 1569
Class file to control the main Panels editor.

Code

function panels_edit_cache_method_form($form, &$form_state) {
  ctools_form_include($form_state, 'plugins', 'panels');
  form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class');
  $display =& $form_state['display'];
  $conf =& $form_state['conf'];

  // Set to 0 to ensure we get a selected radio.
  if (!isset($conf['method'])) {
    $conf['method'] = 0;
  }
  $caches = panels_get_caches();
  if (empty($caches)) {
    $form['markup'] = array(
      '#value' => t('No caching options are available at this time. Please enable a panels caching module in order to use caching options.'),
    );
    return $form;
  }
  $options[0] = t('No caching');
  foreach ($caches as $cache => $info) {
    $options[$cache] = check_plain($info['title']);
  }
  $form['method'] = array(
    '#prefix' => '<div class="no-float">',
    '#suffix' => '</div>',
    '#type' => 'radios',
    '#title' => t('Method'),
    '#options' => $options,
    '#default_value' => $conf['method'],
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
  );
  return $form;
}