function _dimension_field_widget_form_field in Dimension 7
Callback called by dimension_field_widget_form() to define the field settings for one of the dimension components.
Parameters
array $form_fields: The form fragment which contains all the field definitions to which the dimension component is supposed to be added.
string $name: The internal name of the dimension component. Supported values are 'length', 'width' and 'height'.
bool $access: If TRUE, the field will be visible, FALSE otherwise.
array $item: An array containing all the dimension values.
array $settings: An array containing the field settings.
1 call to _dimension_field_widget_form_field()
- dimension_field_widget_form in ./
dimension.module - Implements hook_field_widget_form().
File
- ./
dimension.module, line 506
Code
function _dimension_field_widget_form_field(&$form_fields, $name, $access, $item, $settings) {
$settings = drupal_array_merge_deep(_dimension_default_field_instance_settings(), $settings);
$field_settings = $settings['fields'][$name];
$form_fields[$name] = array(
'#type' => 'textfield',
'#title' => $field_settings['label'],
'#field_prefix' => $field_settings['prefix'],
'#field_suffix' => $field_settings['suffix'],
'#description' => $field_settings['descr'],
'#default_value' => isset($item[$name]) ? $item[$name] : 1,
'#size' => 6,
'#access' => $access,
);
}