function panels_edit_cache_method_form in Panels 5.2
Same name and namespace in other branches
- 6.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_edit_cache_method_form()
- 6.2 includes/display-edit.inc \panels_edit_cache_method_form()
- 7.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_edit_cache_method_form()
Choose cache method form
1 string reference to 'panels_edit_cache_method_form'
- panels_ajax_cache in includes/
display_edit.inc - Entry point for AJAX modal: configure pane
File
- includes/
display_edit.inc, line 1216
Code
function panels_edit_cache_method_form($display, $pid) {
$conf = $pid ? $display->content[$pid]->cache : $display->cache;
// 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;
}