You are here

function dimension_field_widget_form in Dimension 7

Implements hook_field_widget_form().

File

./dimension.module, line 238

Code

function dimension_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  $settings = $instance['settings'];
  list($has_length, $has_more) = _dimension_get_modes($field['settings']['mode']);
  $item = isset($items[$delta]) ? $items[$delta] : array();
  $dimensions = array();
  _dimension_field_widget_form_field($dimensions, 'length', $has_length, $item, $settings);
  _dimension_field_widget_form_field($dimensions, 'width', $has_more, $item, $settings);
  _dimension_field_widget_form_field($dimensions, 'height', $has_more, $item, $settings);
  $element['#type'] = 'fieldset';
  $element += $dimensions;
  return $element;
}