misc_tables.views.inc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Purpose: Allows the library module to add fields to other module views
  4. *
  5. * For example, a field counting the number of libraries associted with a given feature would be
  6. * added to the feature view as follows:
  7. * @code
  8. $data['feature']['num_libraries'] = array(
  9. 'title' => "Number of Libraries",
  10. 'help' => "Provides a count of the number of libraries associated with a given feature",
  11. 'field' => array(
  12. 'handler' => 'views_handler_field_chado_count',
  13. 'table_to_query' => 'library_feature',
  14. ),
  15. );
  16. * @endcode
  17. */
  18. function retrieve_library_misc_tables_views_data() {
  19. $data = array();
  20. // Table: Feature---------------------------------------------------------------------------------
  21. // Calculated Field: Number of Libraries (Count -Int)
  22. // Provides the number of libraries for a given feature
  23. $data['feature']['num_libraries'] = array(
  24. 'title' => "Number of Libraries",
  25. 'help' => "Provides a count of the number of libraries associated with a given feature",
  26. 'field' => array(
  27. 'handler' => 'views_handler_field_chado_count',
  28. 'table_to_query' => 'library_feature',
  29. ),
  30. );
  31. // Table: Organism--------------------------------------------------------------------------------
  32. // Calculated Field: Number of Libraries (Count -Int)
  33. // Provides the number of libraries for a given organism
  34. $data['organism']['num_libraries'] = array(
  35. 'title' => 'Number of Libraries',
  36. 'help' => 'Provides a count of the number of libraries associated with a given organism',
  37. 'field' => array(
  38. 'handler' => 'views_handler_field_chado_count',
  39. 'table_to_query' => 'library',
  40. ),
  41. );
  42. return $data;
  43. }