link.diff.inc 492 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * @file
  4. * Provide diff field functions for the Link module.
  5. */
  6. /**
  7. * Diff field callback for parsing link fields comparative values.
  8. */
  9. function link_field_diff_view($items, $context) {
  10. $diff_items = array();
  11. foreach ($items as $delta => $item) {
  12. if ($item['url'] && $item['title']) {
  13. $diff_items[$delta] = $item['title'] . ' (' . $item['url'] . ')';
  14. }
  15. else {
  16. $diff_items[$delta] = $item['title'] . $item['url'];
  17. }
  18. }
  19. return $diff_items;
  20. }