You are here

function views_navigation_views_data_alter in Views navigation 7

Implements hook_views_data_alter().

Replace views field handler class with our own subclass.

File

./views_navigation.module, line 58
Views navigation module.

Code

function views_navigation_views_data_alter(&$data) {
  foreach ($data as &$table) {
    foreach ($table as &$item) {
      if (isset($item['field']) && isset($item['field']['handler'])) {
        switch ($item['field']['handler']) {
          case 'views_handler_field_node':
            $item['field']['handler'] = 'views_navigation_handler_field_node';
            break;
          case 'views_handler_field_node_path':
            $item['field']['handler'] = 'views_navigation_handler_field_node_path';
            break;
          case 'views_handler_field_node_link':
            $item['field']['handler'] = 'views_navigation_handler_field_node_link';
            break;
          case 'views_handler_field_field':
            $item['field']['handler'] = 'views_navigation_handler_field_field';
            break;
          case 'entity_views_handler_field_text':
            $item['field']['handler'] = 'views_navigation_handler_entity_field_text';
            break;
          case 'entity_views_handler_field_field':
            $item['field']['handler'] = 'views_navigation_handler_entity_field_field';
            break;
          case 'entity_views_handler_field_uri':
            $item['field']['handler'] = 'views_navigation_handler_entity_field_uri';
            break;
          case 'entity_views_handler_field_entity':
            $item['field']['handler'] = 'views_navigation_handler_entity_field_entity';
            break;
        }
      }
    }
  }
}