title.views.inc 874 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Provides support for the Views module.
  5. */
  6. /**
  7. * Implements hook_field_views_data_alter().
  8. */
  9. function title_field_views_data_alter(&$result, $field, $module) {
  10. // Replace field default handler (views_handler_field_field).
  11. foreach (entity_get_info() as $entity_type => $entity_info) {
  12. $entity_info += array(
  13. 'field replacement' => array(),
  14. );
  15. foreach ($entity_info['field replacement'] as $replacement) {
  16. if (isset($replacement['field']['field_name'])) {
  17. $field = field_info_field($replacement['field']['field_name']);
  18. if (!empty($field)) {
  19. $table = _field_sql_storage_tablename($field);
  20. if (isset($result[$table][$field['field_name']])) {
  21. $result[$table][$field['field_name']]['field']['handler'] = 'views_handler_title_field';
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }