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