You are here

function panels_page_wizard_add_layout in Panels 7.3

Same name and namespace in other branches
  1. 6.3 includes/page-wizard.inc \panels_page_wizard_add_layout()

Add layout form helper for panels page wizards.

This is not a proper form, it is meant to be called by a form to add elements to it.

1 call to panels_page_wizard_add_layout()
panels_landing_page_basic in plugins/page_wizards/landing_page.inc
First page of our page creator wizard.

File

includes/page-wizard.inc, line 14
Contains helper functions for the Panels page wizards.

Code

function panels_page_wizard_add_layout(&$form, &$form_state) {
  $form_state['allowed_layouts'] = 'panels_page';
  $form_state['display'] = $form_state['wizard cache']->display;

  // Tell the Panels form not to display buttons.
  $form_state['no buttons'] = TRUE;

  // Change the #id of the form so the CSS applies properly.
  $form['#id'] = 'panels-choose-layout';
  $form['layout_prefix'] = array(
    '#value' => '<fieldset><legend>' . t('Layout') . '</legend>',
  );
  ctools_include('common', 'panels');
  ctools_include('display-layout', 'panels');
  ctools_include('plugins', 'panels');
  $form = panels_choose_layout($form, $form_state);
  $form['layout_suffix'] = array(
    '#value' => '</fieldset>',
  );

  // $form_state['cache'] = FALSE;.
}