Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443915
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3443915
Commits
95346366
Commit
95346366
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#567064
follow-up by sun: Updated documentation.
parent
905d7c66
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/field/field.api.php
+20
-9
20 additions, 9 deletions
modules/field/field.api.php
with
20 additions
and
9 deletions
modules/field/field.api.php
+
20
−
9
View file @
95346366
...
...
@@ -606,12 +606,11 @@ function hook_field_widget_info_alter(&$info) {
}
/**
* Return a single form element for a f
orm
.
* Return a single form element for a f
ield widget
.
*
* It will be built out and validated in the callback(s) listed in
* hook_element_info(). We build it out in the callbacks rather than in
* hook_field_widget so it can be plugged into any module that can
* provide it with valid $field information.
* Field widget form elements should be based on the passed in $element, which
* contains the base form element properties derived from the field
* configuration.
*
* Field API will set the weight, field name and delta values for each
* form element. If there are multiple values for this field, the
...
...
@@ -633,11 +632,23 @@ function hook_field_widget_info_alter(&$info) {
* @param $delta
* The order of this item in the array of subelements (0, 1, 2, etc).
* @param $element
* A form element array containing basic properties for the widget: #title,
* #description, #required, #field, #field_instance, #field_name, #delta,
* #columns.
* A form element array containing basic properties for the widget:
* - #object_type: The name of the object the field is attached to.
* - #bundle: The name of the field bundle the field is contained in.
* - #field_name: The name of the field.
* - #columns: A list of field storage columns of the field.
* - #title: The sanitized element label for the field instance, ready for
* output.
* - #description: The sanitized element description for the field instance,
* ready for output.
* - #required: A Boolean indicating whether the element value is required;
* for required multiple value fields, only the first widget's values are
* required.
* - #delta: The order of this item in the array of subelements; see $delta
* above.
*
* @return
* The form
item
for a single
elemen
t for this field.
* The form
elements
for a single
widge
t for this field.
*/
function
hook_field_widget
(
&
$form
,
&
$form_state
,
$field
,
$instance
,
$langcode
,
$items
,
$delta
,
$element
)
{
$element
+=
array
(
...
...
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