function _vud_field_load in Vote Up/Down 7
Same name and namespace in other branches
- 7.2 vud_field/vud_field.module \_vud_field_load()
Get the item to use.
2 calls to _vud_field_load()
- vud_field_field_prepare_view in vud_field/
vud_field.module - Implements hook_field_prepare_view().
- vud_field_field_widget_form in vud_field/
vud_field.module - Implements hook_field_widget_form().
File
- vud_field/
vud_field.module, line 93 - Defines field type which contains a voting widget.
Code
function _vud_field_load($field, $item, $instance) {
$keys = array(
'vud_widget',
'votingapi_tag',
);
$value = array();
foreach ($keys as $key) {
if (isset($item[$key])) {
$value[$key] = $item[$key];
}
elseif (isset($instance['settings'][$key])) {
$value[$key] = $instance['settings'][$key];
}
else {
$value[$key] = $field['settings'][$key];
}
}
return $value;
}