1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* Implements hook_views_data_alter().
|
5 |
|
|
*/
|
6 |
|
|
function views_bulk_operations_views_data_alter(&$data) {
|
7 |
|
|
foreach (entity_get_info() as $entity_type => $info) {
|
8 |
|
|
if (isset($info['base table']) && isset($data[$info['base table']]['table'])) {
|
9 |
|
|
$data[$info['base table']]['views_bulk_operations'] = array(
|
10 |
|
|
'title' => $data[$info['base table']]['table']['group'],
|
11 |
|
|
'group' => t('Bulk operations'),
|
12 |
|
|
'help' => t('Provide a checkbox to select the row for bulk operations.'),
|
13 |
|
|
'real field' => $info['entity keys']['id'],
|
14 |
|
|
'field' => array(
|
15 |
|
|
'handler' => 'views_bulk_operations_handler_field_operations',
|
16 |
|
|
'click sortable' => FALSE,
|
17 |
|
|
),
|
18 |
|
|
);
|
19 |
|
|
}
|
20 |
|
|
if (isset($info['revision table']) && isset($data[$info['revision table']]['table'])) {
|
21 |
|
|
$data[$info['revision table']]['views_bulk_operations'] = array(
|
22 |
|
|
'title' => $data[$info['revision table']]['table']['group'],
|
23 |
|
|
'group' => t('Bulk operations'),
|
24 |
|
|
'help' => t('Provide a checkbox to select the row for bulk operations.'),
|
25 |
|
|
'real field' => $info['entity keys']['revision'],
|
26 |
|
|
'field' => array(
|
27 |
|
|
'handler' => 'views_bulk_operations_handler_field_operations',
|
28 |
|
|
'click sortable' => FALSE,
|
29 |
|
|
),
|
30 |
|
|
);
|
31 |
|
|
}
|
32 |
|
|
}
|
33 |
|
|
} |