tripal_project.views.inc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions for views integration of
  5. * chado/tripal_project 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. require_once('views/project.views.inc');
  12. require_once('views/project.views.inc');
  13. /*************************************************************************
  14. * Implements hook_views_data()
  15. * Purpose: Describe chado/tripal tables & fields to views
  16. *
  17. * @return: a data array which follows the structure outlined in the
  18. * views2 documentation for this hook. Essentially, it's an array of table
  19. * definitions keyed by chado/tripal table name. Each table definition
  20. * includes basic details about the table, fields in that table and
  21. * relationships between that table and others (joins)
  22. */
  23. function tripal_project_views_data() {
  24. $data = array();
  25. //$data = array_merge($data, retrieve_project_views_data());
  26. //$data = array_merge($data, retrieve_project_views_data());
  27. if (module_exists('tripal_views')) {
  28. $tables = array(
  29. 'project'
  30. );
  31. foreach ($tables as $tablename) {
  32. if (!tripal_views_is_integrated($tablename, 10)) {
  33. $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename,TRUE);
  34. tripal_views_integration_add_entry($table_integration_array);
  35. }
  36. }
  37. $tables = array(
  38. );
  39. foreach ($tables as $tablename) {
  40. if (!tripal_views_is_integrated($tablename, 10)) {
  41. $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename,FALSE);
  42. tripal_views_integration_add_entry($table_integration_array);
  43. }
  44. }
  45. }
  46. return $data;
  47. }
  48. /*************************************************************************
  49. * Implements hook_views_handlers()
  50. * Purpose: Register all custom handlers with views
  51. * where a handler describes either "the type of field",
  52. * "how a field should be filtered", "how a field should be sorted"
  53. *
  54. * @return: An array of handler definitions
  55. */
  56. function tripal_project_views_handlers() {
  57. return array(
  58. 'info' => array(
  59. 'path' => drupal_get_path('module', 'tripal_project') . '/views/handlers',
  60. ),
  61. 'handlers' => array(
  62. ),
  63. );
  64. }