tripal_library.views.inc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. * 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_once('views/library.views.inc');
  21. require_once('views/chado_library.views.inc');
  22. require_once('views/misc_tables.views.inc');
  23. function tripal_library_views_data() {
  24. $data = array();
  25. $data = array_merge($data, retrieve_library_views_data());
  26. $data = array_merge($data, retrieve_library_misc_tables_views_data());
  27. return $data;
  28. }
  29. /*************************************************************************
  30. * Implements hook_views_handlers()
  31. * Purpose: Register all custom handlers with views
  32. * where a handler describes either "the type of field",
  33. * "how a field should be filtered", "how a field should be sorted"
  34. * @return: An array of handler definitions
  35. */
  36. function tripal_library_views_handlers() {
  37. return array(
  38. 'info' => array(
  39. 'path' => drupal_get_path('module', 'tripal_library') . '/views/handlers',
  40. ),
  41. 'handlers' => array(
  42. 'views_handler_field_computed_library_nid' => array(
  43. 'parent' => 'views_handler_field_numeric',
  44. ),
  45. 'views_handler_field_tf_boolean' => array(
  46. 'parent' => 'views_handler_field',
  47. ),
  48. 'views_handler_field_readable_date' => array(
  49. 'parent' => 'views_handler_field',
  50. ),
  51. ),
  52. );
  53. }