You are here

function panelizer_settings_form in Panelizer 7

Same name and namespace in other branches
  1. 6 includes/common.inc \panelizer_settings_form()
  2. 7.3 includes/common.inc \panelizer_settings_form()
  3. 7.2 includes/common.inc \panelizer_settings_form()

Form to configure basic panelizer settings.

2 string references to 'panelizer_settings_form'
panelizer_default_settings_page in includes/admin.inc
Page to configure basic settings for a panelizer default.
panelizer_edit_node_settings_page in includes/node.inc
Page to edit basic settings on a panelized node.

File

includes/common.inc, line 13
Contains common forms and routines that different object types use.

Code

function panelizer_settings_form($form, &$form_state) {
  $panelizer = $form_state['panelizer'];
  $form['no_blocks'] = array(
    '#type' => 'checkbox',
    '#default_value' => $panelizer->no_blocks,
    '#title' => t('Disable Drupal blocks/regions'),
    '#description' => t('Check this to have the panel disable sidebars displayed in the theme. Note that some themes support this setting better than others. If in doubt, try with stock themes to see.'),
  );
  ctools_include('plugins', 'panels');
  $pipelines = panels_get_renderer_pipelines();

  // If there are no pipelines, that probably means we're operating in
  // legacy mode.
  if (empty($pipelines)) {

    // We retain the original pipeline so we don't wreck things by installing
    // old modules.
    $form['pipeline'] = array(
      '#type' => 'value',
      '#value' => $panelizer->pipeline,
    );
  }
  else {
    $options = array();
    foreach ($pipelines as $name => $pipeline) {
      $options[$name] = check_plain($pipeline->admin_title) . '<div class="description">' . check_plain($pipeline->admin_description) . '</div>';
    }
    $form['pipeline'] = array(
      '#type' => 'radios',
      '#options' => $options,
      '#title' => t('Renderer'),
      '#default_value' => $panelizer->pipeline,
    );
  }
  $form['css_id'] = array(
    '#type' => 'textfield',
    '#size' => 35,
    '#default_value' => $panelizer->css_id,
    '#title' => t('CSS ID'),
    '#description' => t('The CSS ID to apply to this panel'),
  );
  $form['css'] = array(
    '#type' => 'textarea',
    '#title' => t('CSS code'),
    '#description' => t('Enter well-formed CSS code here; this code will be embedded into the panel, and should only be used for minor adjustments; it is usually better to try to put CSS for the panel into the theme if possible. This CSS will be filtered for safety so some CSS may not work.'),
    '#default_value' => $panelizer->css,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  if (!empty($form_state['reset button'])) {
    $form['reset'] = array(
      '#type' => 'submit',
      '#value' => t('Reset to default'),
      '#reset' => TRUE,
    );
  }
  return $form;
}