views_bulk_operations.views.inc 1.3 KB

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