Projet

Général

Profil

Paste
Télécharger (1013 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / uuid / uuid.views.inc @ bf6fb0ee

1
<?php
2

    
3
/**
4
 * @file
5
 * Views Implementation for UUID.
6
 */
7

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