You are here

function panels_edit_cache_method_form in Panels 6.2

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. 7.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_edit_cache_method_form()

Choose cache method form

Related topics

1 string reference to 'panels_edit_cache_method_form'
panels_ajax_cache_method in includes/display-edit.inc
Entry point for AJAX modal: configure pane cache method

File

includes/display-edit.inc, line 778

Code

function panels_edit_cache_method_form(&$form_state) {
  $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;
}