tripal_feature.views.inc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions for views integration of
  5. * chado/tripal organism tables. Supplementary functions can be found in
  6. * ./views/
  7. *
  8. * Documentation on views integration can be found at
  9. * http://views2.logrus.com/doc/html/index.html.
  10. */
  11. /**
  12. * Implements hook_views_data()
  13. *
  14. * Purpose: Describe chado/tripal tables & fields to views
  15. *
  16. * @return: a data array which follows the structure outlined in the
  17. * views2 documentation for this hook. Essentially, it's an array of table
  18. * definitions keyed by chado/tripal table name. Each table definition
  19. * includes basic details about the table, fields in that table and
  20. * relationships between that table and others (joins)
  21. *
  22. * @ingroup tripal_feature
  23. */
  24. require_once('views/feature.views.inc');
  25. require_once('views/chado_feature.views.inc');
  26. require_once('views/misc_tables.views.inc');
  27. function tripal_feature_views_data() {
  28. $data = array();
  29. $data = array_merge($data, retrieve_feature_views_data());
  30. $data = array_merge($data, retrieve_chado_feature_views_data());
  31. $data = array_merge($data, retrieve_feature_misc_tables_views_data());
  32. return $data;
  33. }
  34. /**
  35. * Implements hook_views_handlers()
  36. *
  37. * Purpose: Register all custom handlers with views
  38. * where a handler describes either "the type of field",
  39. * "how a field should be filtered", "how a field should be sorted"
  40. *
  41. * @return: An array of handler definitions
  42. *
  43. * @ingroup tripal_feature
  44. */
  45. function tripal_feature_views_handlers() {
  46. return array(
  47. 'info' => array(
  48. 'path' => drupal_get_path('module', 'tripal_feature') . '/views/handlers',
  49. ),
  50. 'handlers' => array(
  51. 'views_handler_field_computed_feature_nid' => array(
  52. 'parent' => 'views_handler_field_numeric',
  53. ),
  54. 'views_handler_field_readable_date' => array(
  55. 'parent' => 'views_handler_field',
  56. ),
  57. 'views_handler_field_residues' => array(
  58. 'parent' => 'views_handler_field',
  59. ),
  60. ),
  61. );
  62. }