diff options
author | Jennifer Hodgdon <yahgrp@poplarware.com> | 2012-08-02 09:54:12 -0700 |
---|---|---|
committer | Jennifer Hodgdon <yahgrp@poplarware.com> | 2012-08-02 09:54:12 -0700 |
commit | dd3d2f4917f8540420b6a7ab610f10a971f3172a (patch) | |
tree | 2360a68e743c426c981750bfc0c7078d26bac77b /modules | |
parent | 04ce5dcece1d888399281bdcec9fe1175329e568 (diff) | |
download | brdo-dd3d2f4917f8540420b6a7ab610f10a971f3172a.tar.gz brdo-dd3d2f4917f8540420b6a7ab610f10a971f3172a.tar.bz2 |
Issue #1681468 by eddie_c: Add params and return to documentation for field_default_form function
Diffstat (limited to 'modules')
-rw-r--r-- | modules/field/field.form.inc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index 6c27c4329..49417ee94 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -6,7 +6,38 @@ */ /** - * Create a separate form element for each field. + * Creates a form element for a field and can populate it with a default value. + * + * If the form element is not associated with an entity (i.e., $entity is NULL) + * field_get_default_value will be called to supply the default value for the + * field. Also allows other modules to alter the form element by implementing + * their own hooks. + * + * @param $entity_type + * The type of entity (for example 'node' or 'user') that the field belongs + * to. + * @param $entity + * The entity object that the field belongs to. This may be NULL if creating a + * form element with a default value. + * @param $field + * An array representing the field whose editing element is being created. + * @param $instance + * An array representing the structure for $field in its current context. + * @param $langcode + * The language associated with the field. + * @param $items + * An array of the field values. When creating a new entity this may be NULL + * or an empty array to use default values. + * @param $form + * An array representing the form that the editing element will be attached + * to. + * @param $form_state + * An array containing the current state of the form. + * @param $get_delta + * Used to get only a specific delta value of a multiple value field. + * + * @return + * The form element array created for this field. */ function field_default_form($entity_type, $entity, $field, $instance, $langcode, $items, &$form, &$form_state, $get_delta = NULL) { // This could be called with no entity, as when a UI module creates a |