tripal_blast.module 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * @file
  4. * .module file of Tripal BLAST.
  5. */
  6. use Drupal\Core\Url;
  7. /**
  8. * Implements hook_theme().
  9. * Used by Tripal BLAST UI page.
  10. *
  11. * @see templates in /templates
  12. */
  13. function tripal_blast_theme($existing, $type, $theme, $path) {
  14. // Links rendered as a markup for the template file.
  15. $context_links = [
  16. // QUERY SEARCH TYPE:
  17. // blast/nucleotide, blast/protein.
  18. 'link_nucleotide' => \Drupal::l(t('Nucleotide'), Url::fromRoute('tripal_blast.nucleotide')),
  19. 'link_protein' => \Drupal::l(t('Protein'), Url::fromRoute('tripal_blast.protein')),
  20. // NUCLEOTIDE PROGRAM:
  21. // blast/nucleotide/nucleotide, blast/nucleotide/protein.
  22. 'link_blastn' => \Drupal::l(t('blastn'), Url::fromRoute('tripal_blast.nucleotide_nucleotide')),
  23. 'link_blastx' => \Drupal::l(t('blastx'), Url::fromRoute('tripal_blast.nucleotide_protein')),
  24. // PROTEIN PROGRAM:
  25. // blast/protein/nucleotide, blast/protein/protein.
  26. 'link_tblastn' => \Drupal::l(t('tblastn'), Url::fromRoute('tripal_blast.protein_nucleotide')),
  27. 'link_blastp' => \Drupal::l(t('blastp'), Url::fromRoute('tripal_blast.protein_protein')),
  28. // MISC/ADMIN.
  29. 'link_config' => '#',
  30. 'link_jobs' => '#',
  31. 'link_nodeadd' => '#',
  32. 'link_dbadd' => '#',
  33. 'link_dbfields' => '#',
  34. ];
  35. // Pass rendered links as variables and make available in the template file.
  36. $variables = [
  37. // Tripal BLAST UI page.
  38. 'theme-tripal-blast-ui' => [
  39. 'variables' => ['context_links' => $context_links],
  40. 'template' => 'template-tripal-blast-ui',
  41. ],
  42. // Tripal BLAST Configuration page.
  43. // Tripal BLAST Help page.
  44. 'theme-tripal-blast-help' => [
  45. 'variables' => ['context_links' => $context_links],
  46. 'template' => 'template-tripal-blast-help',
  47. ],
  48. ];
  49. return $variables;
  50. }