title.views.inc 679 B

1234567891011121314151617181920
  1. <?php
  2. /**
  3. * Implements hook_views_data_alter().
  4. *
  5. * Replace field default handler (views_handler_field_field).
  6. */
  7. function title_field_views_data_alter(&$data) {
  8. foreach (entity_get_info() as $entity_type => $entity_info) {
  9. $replacements = title_field_replacement_info($entity_type);
  10. if ($replacements) {
  11. foreach ($replacements as $replacement) {
  12. $field = field_info_field($replacement['field']['field_name']);
  13. $table = _field_sql_storage_tablename($field);
  14. if (isset($data[$table][$field['field_name']])) {
  15. $data[$table][$field['field_name']]['field']['handler'] = 'views_handler_title_field';
  16. }
  17. }
  18. }
  19. }
  20. }