tripal_jbrowse.module 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * Core functions of this module.
  5. */
  6. /**
  7. * Implements hook_theme().
  8. */
  9. function tripal_jbrowse_theme($existing, $type, $theme, $path) {
  10. $items = array(
  11. 'node__jbrowse_instance' => array(
  12. // Don't specify the path in the template name.
  13. // Unless you have your template inside a directory within this module.
  14. 'template' => 'theme/node--jbrowse-instance',
  15. 'variables' => array('node' => (object)array()),
  16. ),
  17. );
  18. return $items;
  19. }
  20. /**
  21. * Implements node preprocess hook.
  22. */
  23. function tripal_jbrowse_preprocess_node(&$vars) {
  24. if ($vars['node']->type == 'jbrowse_instance') {
  25. $path = $vars['node']->field_jburl['und'][0]['url'];
  26. $files = array(
  27. 'combination_tracks.css',
  28. 'faceted_track_selector.css',
  29. 'icons.css',
  30. 'maker.css',
  31. 'sequence.css',
  32. 'tristate.css',
  33. 'export_dialog.css',
  34. 'file_dialog.css',
  35. 'hierarchical_track_selector.css',
  36. 'main.css',
  37. 'menubar.css',
  38. 'track_styles.css'
  39. );
  40. foreach ($files as $filename) {
  41. $sheets = drupal_add_css($path . '/' . $filename, array('group' => CSS_THEME, 'type' => 'external'));
  42. }
  43. }
  44. }