Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
cfc06697
Commit
cfc06697
authored
12 years ago
by
Daniel Wehner
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1760322
by dawehner: Improve wizard build_form() docs.
parent
714b3320
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Drupal/views/Plugin/views/wizard/WizardInterface.php
+13
-2
13 additions, 2 deletions
lib/Drupal/views/Plugin/views/wizard/WizardInterface.php
lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
+4
-4
4 additions, 4 deletions
lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
with
17 additions
and
6 deletions
lib/Drupal/views/Plugin/views/wizard/WizardInterface.php
+
13
−
2
View file @
cfc06697
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
+
4
−
4
View file @
cfc06697
...
@@ -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'
)),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment