You are here

function panels_edit_style_type_form in Panels 7.3

Same name and namespace in other branches
  1. 6.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 1681
Class file to control the main Panels editor.

Code

function panels_edit_style_type_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'];
  $style = $form_state['style'];
  $type = $form_state['type'];
  $styles = panels_get_styles();
  $function = $type == 'pane' ? 'render pane' : '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;
}