From cfc066976d144e0b38aed182d84c3b8b24b5d897 Mon Sep 17 00:00:00 2001 From: dereine Date: Thu, 6 Sep 2012 10:46:44 +0200 Subject: [PATCH] Issue #1760322 by dawehner: Improve wizard build_form() docs. --- .../views/Plugin/views/wizard/WizardInterface.php | 15 +++++++++++++-- .../Plugin/views/wizard/WizardPluginBase.php | 8 ++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php b/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php index 3887311f78..f6d3f4cda1 100644 --- a/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardInterface.php @@ -21,9 +21,20 @@ interface WizardInterface { 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. diff --git a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index 768b1c2586..ad5c285f06 100644 --- a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -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)); $feed_row_options = views_fetch_plugin_names('row', 'feed', array($this->base_table)); $path_prefix = url(NULL, array('absolute' => TRUE)); @@ -231,7 +231,7 @@ function build_form($form, &$form_state) { ); // 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( '#type' => 'container', '#attributes' => array('class' => array('options-set')), @@ -373,7 +373,7 @@ function build_form($form, &$form_state) { ); // 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( '#type' => 'container', '#attributes' => array('class' => array('options-set')), -- GitLab