function name_field_diff_view in Name Field 7
Diff field callback for parsing name field comparative values.
File
- ./
name.diff.inc, line 11 - Provide diff field functions for the Name Field module.
Code
function name_field_diff_view($items, $context) {
$field = $context['field'];
$instance = $context['instance'];
$settings = $context['settings'];
$diff_items = array();
$format = name_get_format_by_machine_name($settings['format']);
if (empty($format)) {
$format = name_get_format_by_machine_name('default');
}
foreach ($items as $delta => $item) {
$name = name_format($item, $format);
$diff_items[$delta] = _name_value_sanitize($name, NULL, $settings['output']);
}
return $diff_items;
}