tripal_jbrowse_page.listing.inc 873 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Builds the public jbrowse listing.
  5. */
  6. /**
  7. * Builds the public jbrowse listing.
  8. */
  9. function tripal_jbrowse_page_listing_page() {
  10. $settings = tripal_jbrowse_mgmt_get_settings();
  11. // Retrieve all the instances...
  12. $instances = tripal_jbrowse_mgmt_get_instances();
  13. drupal_add_css(drupal_get_path('module', 'tripal_jbrowse_page') . '/theme/tripal_jbrowse_page.css');
  14. // Add the URL for each to link to.
  15. foreach($instances as $k => $instance) {
  16. if (tripal_jbrowse_page_is_instance_public($instance->id)) {
  17. $instances[$k]->url = url('jbrowse/'.$instance->organism->genus . '-' . $instance->organism->species.'/'.$instance->id, ['absolute' => TRUE]);
  18. }
  19. else {
  20. unset($instances[$k]);
  21. }
  22. }
  23. // Use the template to render the page.
  24. return theme('jbrowse_instance_public_listing', ['instances' => $instances]);
  25. }