function MODULE_field_diff_view in Diff 7.3
Callback to the module that defined the field to generate items comparisons.
Parameters
array $items: An array of field items from the entity.
array $context: An associative array containing:
- entity: The entity being compared.
- entity_type: The entity type; e.g., 'node' or 'user'.
- bundle: The bundle name.
- field: The field that the items belong to.
- instance: The instance that the items belong to.
- language: The language associated with $items.
- old_entity: The older entity.
- new_entity: The newer entity.
See also
MODULE_field_diff_view_prepare()
File
- ./
diff.api.php, line 187 - Hooks provided by the diff module.
Code
function MODULE_field_diff_view($items, $context) {
$diff_items = array();
foreach ($items as $delta => $item) {
if (isset($item['file'])) {
$diff_items[$delta] = $item['file']->filename . ' [fid: ' . $item['fid'] . ']';
}
}
return $diff_items;
}