You are here

function panels_panel_context_edit_settings in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/task_handlers/panel_context.inc \panels_panel_context_edit_settings()

General settings for the panel.

1 string reference to 'panels_panel_context_edit_settings'
panel_context.inc in plugins/task_handlers/panel_context.inc
This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.

File

plugins/task_handlers/panel_context.inc, line 762
This is the task handler plugin to handle attaching a panel to any task that advertises itself as a 'context' type, which all of the basic page tasks provided by page_manager.module do by default.

Code

function panels_panel_context_edit_settings($form, &$form_state) {
  $conf = $form_state['handler']->conf;
  $form['conf']['title'] = array(
    '#type' => 'textfield',
    '#default_value' => $conf['title'],
    '#title' => t('Administrative title'),
    '#description' => t('Administrative title of this variant.'),
  );
  $form['conf']['no_blocks'] = array(
    '#type' => 'checkbox',
    '#default_value' => $conf['no_blocks'],
    '#title' => t('Disable Drupal blocks/regions'),
    '#description' => t('Check this to have the page disable all regions displayed in the theme. Note that some themes support this setting better than others. If in doubt, try with stock themes to see.'),
  );
  $form['conf']['body_classes_to_remove'] = array(
    '#type' => 'textfield',
    '#size' => 128,
    '#default_value' => empty($conf['body_classes_to_remove']) ? '' : $conf['body_classes_to_remove'],
    '#title' => t('Remove body CSS classes'),
    '#description' => t('The CSS classes to remove from the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars. Keywords from context are allowed.'),
  );
  $form['conf']['body_classes_to_add'] = array(
    '#type' => 'textfield',
    '#size' => 128,
    '#default_value' => empty($conf['body_classes_to_add']) ? '' : $conf['body_classes_to_add'],
    '#title' => t('Add body CSS classes'),
    '#description' => t('The CSS classes to add to the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars. Keywords from context are allowed.'),
  );
  ctools_include('plugins', 'panels');
  $pipelines = panels_get_renderer_pipelines();

  // Handle backward compatibility with the IPE checkbox.
  if (empty($conf['pipeline'])) {
    $conf['pipeline'] = !empty($conf['use_ipe']) ? 'ipe' : 'standard';
  }

  // 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['conf']['pipeline'] = array(
      '#type' => 'value',
      '#value' => $conf['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['conf']['pipeline'] = array(
      '#type' => 'radios',
      '#options' => $options,
      '#title' => t('Renderer'),
      '#default_value' => $conf['pipeline'],
    );
  }
  $form['conf']['css_id'] = array(
    '#type' => 'textfield',
    '#size' => 35,
    '#default_value' => $conf['css_id'],
    '#title' => t('CSS ID'),
    '#description' => t('The CSS ID to apply to this page. Keywords from context are allowed.'),
  );
  $form['conf']['css'] = array(
    '#type' => 'textarea',
    '#title' => t('CSS code'),
    '#description' => t('Enter well-formed CSS code here; this code will be embedded into the page, and should only be used for minor adjustments; it is usually better to try to put CSS for the page into the theme if possible. This CSS will be filtered for safety so some CSS may not work. Keywords from context are allowed.'),
    '#default_value' => $conf['css'],
  );
  return $form;
}