blast_ui.module 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * @file
  4. * .module file of BLAST UI.
  5. */
  6. use Drupal\Core\Url;
  7. /**
  8. * Implements hook_theme().
  9. * Used by BLAST UI submission forms.
  10. *
  11. * @see templates in /templates
  12. */
  13. function blast_ui_theme($existing, $type, $theme, $path) {
  14. $context_links = [
  15. // blast/nucleotide.
  16. 'link_Nucleotide' => \Drupal::l(t('Nucleotide'), Url::fromRoute('blast_ui.nucleotide')),
  17. // blast/protein.
  18. 'link_Protein' => \Drupal::l(t('Protein'), Url::fromRoute('blast_ui.protein')),
  19. // NUCLEOTIDE PROGRAM.
  20. // blast/nucleotide/nucleotide
  21. 'link_blastn' => \Drupal::l(t('blastn'), Url::fromRoute('blast_ui.nucleotide_nucleotide')),
  22. // blast/nucleotide/protein
  23. 'link_blastx' => \Drupal::l(t('blastx'), Url::fromRoute('blast_ui.nucleotide_protein')),
  24. // PROTEIN PROGRAM.
  25. // blast/protein/nucleotide.
  26. 'link_tblastn' => \Drupal::l(t('tblastn'), Url::fromRoute('blast_ui.protein_nucleotide')),
  27. // blast/protein/protein.
  28. 'link_blastp' => \Drupal::l(t('blastp'), Url::fromRoute('blast_ui.protein_protein')),
  29. // MISC/ADMIN.
  30. 'link_config' => \Drupal::l(t('configuration'), Url::fromUri('admin/tripal/extension/tripal_blast/blast_ui')),
  31. 'link_jobs' => \Drupal::l(t('tripal jobs'), Url::fromUri('blast_ui.protein_nucleotide')),
  32. 'link_nodeadd' => \Drupal::l(t('create BLAST database'), Url::fromUri('node/add/blastdb')),
  33. 'link_dbadd' => \Drupal::l(t('configuration'), Url::fromUri('admin/tripal/chado/tripal_db/add')),
  34. 'link_dbfields' => \Drupal::l(t('drupal field API'), Url::fromUri('admin/structure/types/manage/blastdb/fields'))
  35. ];
  36. $variables = [
  37. // BLAST UI Menupage.
  38. 'theme-blast-ui-menupage' => [
  39. 'variables' => ['context_links' => $context_links],
  40. 'template' => 'template-blast-ui-menupage',
  41. ],
  42. // BLAST Help page.
  43. 'theme-blast-ui-help' => [
  44. 'variables' => ['context_links' => $context_links],
  45. 'template' => 'template-blast-ui-help',
  46. ],
  47. ];
  48. return $variables;
  49. }