tripal_ds.views.inc 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. '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' => array(
  24. 'handler' => 'views_handler_filter_bundle',
  25. ),
  26. 'argument' => array(
  27. 'handler' => 'views_handler_argument_string',
  28. ),
  29. 'field' => array(
  30. 'handler' => 'views_handler_field',
  31. ),
  32. );
  33. $data['tripal_ds']['tripal_ds_field_name'] = array(
  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' => array(
  37. 'handler' => 'views_handler_field',
  38. 'click sortable' => TRUE, // This is use by the table display plugin.
  39. ),
  40. 'sort' => array(
  41. 'handler' => 'views_handler_sort',
  42. ),
  43. 'filter' => array(
  44. 'handler' => 'views_handler_filter_string',
  45. ),
  46. 'argument' => array(
  47. 'handler' => 'views_handler_argument_string',
  48. ),
  49. );
  50. $data['tripal_ds']['tripal_ds_field_label'] = array(
  51. 'title' => t('Field Label'),
  52. 'help' => t('The human readable name of the field, like "Sequences".'),
  53. 'field' => array(
  54. 'handler' => 'views_handler_field',
  55. 'click sortable' => TRUE, // This is use by the table display plugin.
  56. ),
  57. 'sort' => array(
  58. 'handler' => 'views_handler_sort',
  59. ),
  60. 'filter' => array(
  61. 'handler' => 'views_handler_filter_string',
  62. ),
  63. 'argument' => array(
  64. 'handler' => 'views_handler_argument_string',
  65. ),
  66. );
  67. $data['tripal_ds']['weight'] = array(
  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' => array(
  71. 'handler' => 'views_handler_field',
  72. 'click sortable' => TRUE, // This is use by the table display plugin.
  73. ),
  74. 'sort' => array(
  75. 'handler' => 'views_handler_sort',
  76. ),
  77. 'filter' => array(
  78. 'handler' => 'views_handler_filter_string',
  79. ),
  80. 'argument' => array(
  81. 'handler' => 'views_handler_argument_string',
  82. ),
  83. );
  84. return $data;
  85. }