file_entity.views.inc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * @file
  4. * Views integration for the file_entity module.
  5. */
  6. /**
  7. * Implements hook_views_data().
  8. */
  9. function file_entity_views_data() {
  10. // File type
  11. $data['file_managed']['type'] = array(
  12. 'title' => t('Type'),
  13. 'help' => t('The type of the file (for example, "audio", "image", "video", etc).'),
  14. 'field' => array(
  15. 'handler' => 'views_handler_field_file_type',
  16. 'click sortable' => TRUE,
  17. ),
  18. 'sort' => array(
  19. 'handler' => 'views_handler_sort',
  20. ),
  21. 'filter' => array(
  22. 'handler' => 'views_handler_filter_file_type',
  23. ),
  24. 'argument' => array(
  25. 'handler' => 'views_handler_argument_file_type',
  26. ),
  27. );
  28. return $data;
  29. }
  30. /**
  31. * Implements hook_views_plugins().
  32. */
  33. function file_entity_views_plugins() {
  34. return array(
  35. 'module' => 'views', // This just tells our themes are elsewhere.
  36. 'row' => array(
  37. 'file' => array(
  38. 'title' => t('File'),
  39. 'help' => t('Display the file with standard file view.'),
  40. 'handler' => 'views_plugin_row_file_view',
  41. 'base' => array('file_managed'), // only works with 'file' as base.
  42. 'uses options' => TRUE,
  43. 'type' => 'normal',
  44. 'help topic' => 'style-file',
  45. ),
  46. ),
  47. );
  48. }