function mvf_field_widget_info in Measured Value Field 7
Implements hook_field_widget_info().
File
- ./
mvf.module, line 184 - Define a field type of measured value.
Code
function mvf_field_widget_info() {
// We need info about units_unit entity type.
$units_entity_info = entity_get_info('units_unit');
return array(
'mvf_widget_default' => array(
'label' => t('Configurable sub widgets'),
'description' => t('Default widget for unit measured field. Allows you to choose widgets independently for value and unit measure sub fields.'),
'field types' => mvf_field_types(),
'settings' => array(
'meta_info' => array(
'value' => array(
'weight' => 0,
),
'unit' => array(
'weight' => 1,
// What property of units_unit entity to use for human readable
// label, when generating options array for the widget.
'label_property' => $units_entity_info['entity keys']['label'],
),
),
),
),
);
}