tripal_ds.views.inc 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * Implements hook_views_data().
  4. */
  5. function tripal_ds_views_data() {
  6. $data = array();
  7. $data['tripal_ds']['table']['group'] = t('Tripal Panes');
  8. $data['tripal_ds']['table']['base'] = array(
  9. 'title' => t('Tripal Panes'),
  10. 'help' => t('Contains Tripal Pane records we want exposed to Views.'),
  11. );
  12. $data['tripal_ds']['bundle'] = array(
  13. 'title' => t('Bundle ID'),
  14. 'help' => t('This the unque bundle name, eg bio_data_1.'),
  15. 'relationship' => array(
  16. 'base' => 'tripal_entity', // The name of the table to join with.
  17. 'base field' => 'bundle', // The name of the field on the joined table.
  18. // 'field' => 'nid' -- see hook_views_data_alter(); not needed here.
  19. 'handler' => 'views_handler_relationship',
  20. 'label' => t('Default label for the relationship'),
  21. 'title' => t('Title shown when adding the relationship'),
  22. 'help' => t('More information on this relationship'),
  23. ),
  24. 'filter' => array(
  25. 'handler' => 'views_handler_filter_bundle',
  26. ),
  27. 'argument' => array(
  28. 'handler' => 'views_handler_argument_string',
  29. ),
  30. 'field' => array(
  31. 'handler' => 'views_handler_field',
  32. ),
  33. );
  34. $data['tripal_ds']['tripal_ds_field_name'] = array(
  35. 'title' => t('Field Name'),
  36. 'help' => t('This the field name, it is not necessarily unique, like "summary" which might feature across several bundles.'),
  37. 'field' => array(
  38. 'handler' => 'views_handler_field',
  39. 'click sortable' => TRUE, // This is use by the table display plugin.
  40. ),
  41. 'sort' => array(
  42. 'handler' => 'views_handler_sort',
  43. ),
  44. 'filter' => array(
  45. 'handler' => 'views_handler_filter_string',
  46. ),
  47. 'argument' => array(
  48. 'handler' => 'views_handler_argument_string',
  49. ),
  50. );
  51. $data['tripal_ds']['tripal_ds_field_label'] = array(
  52. 'title' => t('Field Label'),
  53. 'help' => t('The human readable name of the field, like "Data Sequences".'),
  54. 'field' => array(
  55. 'handler' => 'views_handler_field',
  56. 'click sortable' => TRUE, // This is use by the table display plugin.
  57. ),
  58. 'sort' => array(
  59. 'handler' => 'views_handler_sort',
  60. ),
  61. 'filter' => array(
  62. 'handler' => 'views_handler_filter_string',
  63. ),
  64. 'argument' => array(
  65. 'handler' => 'views_handler_argument_string',
  66. ),
  67. );
  68. return $data;
  69. }