Commit cfc06697 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1760322 by dawehner: Improve wizard build_form() docs.

parent 714b3320
...@@ -21,9 +21,20 @@ interface WizardInterface { ...@@ -21,9 +21,20 @@ interface WizardInterface {
function __construct(array $definition); function __construct(array $definition);
/** /**
* For AJAX callbacks to build other elements in the "show" form. * Form callback to build other elements in the "show" form.
*
* This method builds all form elements beside of the selection of the
* base table.
*
* @param array $form
* The full wizard form array.
* @param array $form_state
* The current state of the wizard form.
*
* @return array
* Returns the changed wizard form.
*/ */
function build_form($form, &$form_state); function build_form(array $form, array &$form_state);
/** /**
* Validate form and values. * Validate form and values.
......
...@@ -206,9 +206,9 @@ public function getSorts() { ...@@ -206,9 +206,9 @@ public function getSorts() {
} }
/** /**
* Form constructor for the wizard form structure. * Implements Drupal\views\Plugin\views\wizard\WizardInterface::build_form().
*/ */
function build_form($form, &$form_state) { function build_form(array $form, array &$form_state) {
$style_options = views_fetch_plugin_names('style', 'normal', array($this->base_table)); $style_options = views_fetch_plugin_names('style', 'normal', array($this->base_table));
$feed_row_options = views_fetch_plugin_names('row', 'feed', array($this->base_table)); $feed_row_options = views_fetch_plugin_names('row', 'feed', array($this->base_table));
$path_prefix = url(NULL, array('absolute' => TRUE)); $path_prefix = url(NULL, array('absolute' => TRUE));
...@@ -231,7 +231,7 @@ function build_form($form, &$form_state) { ...@@ -231,7 +231,7 @@ function build_form($form, &$form_state) {
); );
// All options for the page display are included in this container so they // All options for the page display are included in this container so they
// can be hidden en masse when the "Create a page" checkbox is unchecked. // can be hidden as a group when the "Create a page" checkbox is unchecked.
$form['displays']['page']['options'] = array( $form['displays']['page']['options'] = array(
'#type' => 'container', '#type' => 'container',
'#attributes' => array('class' => array('options-set')), '#attributes' => array('class' => array('options-set')),
...@@ -373,7 +373,7 @@ function build_form($form, &$form_state) { ...@@ -373,7 +373,7 @@ function build_form($form, &$form_state) {
); );
// All options for the block display are included in this container so they // All options for the block display are included in this container so they
// can be hidden en masse when the "Create a block" checkbox is unchecked. // can be hidden as a group when the "Create a page" checkbox is unchecked.
$form['displays']['block']['options'] = array( $form['displays']['block']['options'] = array(
'#type' => 'container', '#type' => 'container',
'#attributes' => array('class' => array('options-set')), '#attributes' => array('class' => array('options-set')),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment