tripal_ds.views.inc 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * Implements hook_views_data().
  4. */
  5. function tripal_ds_views_data() {
  6. $data = [];
  7. $data['tripal_ds']['table']['group'] = t('Tripal Panes');
  8. $data['tripal_ds']['table']['base'] = [
  9. 'title' => t('Tripal Panes'),
  10. 'help' => t('Contains Tripal Pane records we want exposed to Views.'),
  11. ];
  12. $data['tripal_ds']['bundle'] = [
  13. 'title' => t('Bundle ID'),
  14. 'help' => t('This the unque bundle name, eg bio_data_1.'),
  15. 'relationship' => [
  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. 'handler' => 'views_handler_relationship',
  19. 'label' => t('Bundle relationship with tripal_entity table'),
  20. 'title' => t('Bundle and tripal_entity relationship'),
  21. 'help' => t('This relationship links the tripal_ds table with the tripal_entity table via the bundle.'),
  22. ],
  23. 'filter' => [
  24. 'handler' => 'views_handler_filter_bundle',
  25. ],
  26. 'argument' => [
  27. 'handler' => 'views_handler_argument_string',
  28. ],
  29. 'field' => [
  30. 'handler' => 'views_handler_field',
  31. ],
  32. ];
  33. $data['tripal_ds']['tripal_ds_field_name'] = [
  34. 'title' => t('Field Name'),
  35. 'help' => t('This the field name, it is not necessarily unique, like "summary" which might feature across several bundles.'),
  36. 'field' => [
  37. 'handler' => 'views_handler_field',
  38. 'click sortable' => TRUE, // This is use by the table display plugin.
  39. ],
  40. 'sort' => [
  41. 'handler' => 'views_handler_sort',
  42. ],
  43. 'filter' => [
  44. 'handler' => 'views_handler_filter_string',
  45. ],
  46. 'argument' => [
  47. 'handler' => 'views_handler_argument_string',
  48. ],
  49. ];
  50. $data['tripal_ds']['tripal_ds_field_label'] = [
  51. 'title' => t('Field Label'),
  52. 'help' => t('The human readable name of the field, like "Sequences".'),
  53. 'field' => [
  54. 'handler' => 'views_handler_field',
  55. 'click sortable' => TRUE, // This is use by the table display plugin.
  56. ],
  57. 'sort' => [
  58. 'handler' => 'views_handler_sort',
  59. ],
  60. 'filter' => [
  61. 'handler' => 'views_handler_filter_string',
  62. ],
  63. 'argument' => [
  64. 'handler' => 'views_handler_argument_string',
  65. ],
  66. ];
  67. $data['tripal_ds']['weight'] = [
  68. 'title' => t('Weight'),
  69. 'help' => t('The weight as determined by the order in the Manage Display tab of the content type.'),
  70. 'field' => [
  71. 'handler' => 'views_handler_field',
  72. 'click sortable' => TRUE, // This is use by the table display plugin.
  73. ],
  74. 'sort' => [
  75. 'handler' => 'views_handler_sort',
  76. ],
  77. 'filter' => [
  78. 'handler' => 'views_handler_filter_string',
  79. ],
  80. 'argument' => [
  81. 'handler' => 'views_handler_argument_string',
  82. ],
  83. ];
  84. return $data;
  85. }