uuid.views.inc 1011 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @file
  4. * Views Implementation for UUID
  5. */
  6. /**
  7. * Implements hook_views_data_alter().
  8. */
  9. function uuid_views_data_alter(&$data) {
  10. foreach (entity_get_info() as $info) {
  11. if (isset($info['uuid']) && $info['uuid'] == TRUE && !empty($info['entity keys']['uuid'])) {
  12. $table = $info['base table'];
  13. $field = $info['entity keys']['uuid'];
  14. $data[$table][$field] = array(
  15. 'title' => t('@type UUID', array('@type' => $info['label'])),
  16. 'help' => t('The universally unique ID of the @type.', array('@type' => $info['label'])),
  17. 'field' => array(
  18. 'handler' => 'views_handler_field',
  19. 'click sortable' => TRUE,
  20. ),
  21. 'filter' => array(
  22. 'handler' => 'views_handler_filter_string',
  23. 'allow empty' => TRUE,
  24. ),
  25. 'argument' => array(
  26. 'handler' => 'views_handler_argument_string',
  27. ),
  28. 'sort' => array(
  29. 'handler' => 'views_handler_sort',
  30. ),
  31. );
  32. }
  33. }
  34. }