You are here

function panels_stylizer_edit_pane_style_form in Panels 6.3

Same name and namespace in other branches
  1. 7.3 plugins/styles/stylizer.inc \panels_stylizer_edit_pane_style_form()

The form for determining if a pane should create a local style or a preconfigured style.

1 string reference to 'panels_stylizer_edit_pane_style_form'
panels_stylizer_pane_add_style in plugins/styles/stylizer.inc
Allow on-the-fly creation of styles in panes.

File

plugins/styles/stylizer.inc, line 251
Definition of the 'stylizer' panel style.

Code

function panels_stylizer_edit_pane_style_form(&$form, &$form_state) {
  if (!user_access('administer panels styles') || !module_exists('stylizer')) {
    return;
  }
  ctools_include('dependent');
  $settings = $form_state['owner info']['owner settings'];
  $form['panels']['admin_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Administrative title'),
    '#description' => t('The name of this style. This will appear in the administrative interface to easily identify it.'),
    '#default_value' => $settings['admin_title'],
    '#process' => array(
      'ctools_dependent_process',
    ),
    '#dependency' => array(
      'edit-preconfigured' => array(
        1,
      ),
    ),
  );
  $form['panels']['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Machine name'),
    '#description' => t('The machine readable name of this page. It must be unique, and it must contain only alphanumeric characters and underscores. Once created, you will not be able to change this value!'),
    '#default_value' => $settings['name'],
    '#process' => array(
      'ctools_dependent_process',
    ),
    '#dependency' => array(
      'edit-preconfigured' => array(
        1,
      ),
    ),
  );
  $form['panels']['admin_description'] = array(
    '#type' => 'textarea',
    '#title' => t('Administrative description'),
    '#description' => t('A description of what this style is, does or is for, for administrative use.'),
    '#default_value' => $settings['admin_description'],
    '#process' => array(
      'ctools_dependent_process',
    ),
    '#dependency' => array(
      'edit-preconfigured' => array(
        1,
      ),
    ),
  );

  // Add the checkbox, set the weight early
  $form['panels']['preconfigured'] = array(
    '#type' => 'checkbox',
    '#title' => t('Make this style available to other regions or panes'),
    '#default_value' => $settings['name'],
    '#weight' => -1,
  );
}