function panels_edit_style_type_form in Panels 6.3
Same name and namespace in other branches
- 7.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_edit_style_type_form()
Choose style form
1 string reference to 'panels_edit_style_type_form'
- panels_renderer_editor::ajax_style_type in plugins/
display_renderers/ panels_renderer_editor.class.php - AJAX entry point to select the style for a display, region or pane.
File
- plugins/
display_renderers/ panels_renderer_editor.class.php, line 1617 - Class file to control the main Panels editor.
Code
function panels_edit_style_type_form(&$form_state) {
$display =& $form_state['display'];
$style = $form_state['style'];
$type = $form_state['type'];
$styles = panels_get_styles();
$function = $type == 'pane' ? 'render pane' : (variable_get('panels_legacy_rendering_mode', TRUE) ? 'render panel' : 'render region');
$options = array();
if ($type == 'region') {
$options[-1] = t('Use display default style');
}
uasort($styles, 'ctools_plugin_sort');
foreach ($styles as $id => $info) {
if (empty($info['hidden']) && (!empty($info[$function]) || $id == 'default')) {
$options[$id] = check_plain($info['title']);
}
}
$form['style'] = array(
'#prefix' => '<div class="no-float">',
'#suffix' => '</div>',
'#type' => 'radios',
'#title' => t('Style'),
'#options' => $options,
'#default_value' => $style,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Next'),
);
return $form;
}