tripal_analysis.views.inc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions for views integration of
  5. * chado/tripal analysis 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. * Purpose: Describe chado/tripal tables & fields to views
  14. * @return: a data array which follows the structure outlined in the
  15. * views2 documentation for this hook. Essentially, it's an array of table
  16. * definitions keyed by chado/tripal table name. Each table definition
  17. * includes basic details about the table, fields in that table and
  18. * relationships between that table and others (joins)
  19. */
  20. require('views/analysis.views.inc');
  21. require('views/chado_analysis.views.inc');
  22. require('views/misc_tables.views.inc');
  23. function tripal_analysis_views_data() {
  24. $data = array();
  25. $data = array_merge($data, retrieve_analysis_views_data());
  26. $data = array_merge($data, retrieve_chado_analysis_views_data());
  27. $data = array_merge($data, retrieve_analysis_misc_tables_views_data());
  28. return $data;
  29. }
  30. /*************************************************************************
  31. * Implements hook_views_handlers()
  32. * Purpose: Register all custom handlers with views
  33. * where a handler describes either "the type of field",
  34. * "how a field should be filtered", "how a field should be sorted"
  35. * @return: An array of handler definitions
  36. */
  37. function chado_analysis_views_views_handlers() {
  38. return array(
  39. 'info' => array(
  40. 'path' => drupal_get_path('module', 'tripal_analysis') . '/views/handlers',
  41. ),
  42. 'handlers' => array(
  43. 'views_handler_field_computed_analysis_nid' => array(
  44. 'parent' => 'views_handler_field_numeric',
  45. ),
  46. 'views_handler_field_readable_date' => array(
  47. 'parent' => 'views_handler_field',
  48. ),
  49. ),
  50. );
  51. }