You are here

function panels_common_style_settings_form in Panels 5.2

Form for the style settings modal.

1 string reference to 'panels_common_style_settings_form'
panels_panel_settings_ajax in includes/display_edit.inc
AJAX incoming to deal with the style settings modal

File

includes/display_edit.inc, line 1598

Code

function panels_common_style_settings_form($did, $style, $style_settings) {
  $form['start_form'] = array(
    '#value' => '<div class="modal-form">',
  );
  $form['description'] = array(
    '#prefix' => '<div class="description">',
    '#suffix' => '</div>',
    '#value' => check_plain($style['description']),
  );
  if (isset($style['settings form']) && function_exists($style['settings form'])) {
    $form['style_settings'] = $style['settings form']($style_settings);
    $form['style_settings']['#tree'] = TRUE;
  }
  else {
    $form['markup'] = array(
      '#value' => t('This style does not have any settings.'),
    );
  }
  $form['end_form'] = array(
    '#value' => '</div>',
  );
  if (!isset($form['markup'])) {
    $form['style'] = array(
      '#type' => 'value',
      '#value' => $style,
    );
    $form['did'] = array(
      '#type' => 'value',
      '#value' => $did,
    );
    $form['next'] = array(
      '#type' => 'submit',
      '#value' => t('Save'),
    );
  }
  return $form;
}