tripal_chado_views_search_biological_content.tpl.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. *
  4. */
  5. $biological_views = module_invoke_all('search_biological_data_views');
  6. $disabled_views = variable_get('views_defaults', []);
  7. ?>
  8. <p>Use the following to search the various types of biological content available
  9. by
  10. this site:</p>
  11. <DL>
  12. <?php foreach ($biological_views as $view) { ?>
  13. <?php if (!isset($disabled_views[$view['machine_name']]) OR ($disabled_views[$view['machine_name']] == FALSE)) { ?>
  14. <DT><?php print l($view['human_name'], $view['link']); ?></DT>
  15. <DD><?php print $view['description']; ?></DD>
  16. <?php }
  17. } ?>
  18. </DL>
  19. <?php
  20. // How to disable/remove views from this list
  21. print tripal_set_message(
  22. "To remove a view from this list, simply navigate to the Views UI (Administer ->
  23. Structure -> Views; admin/structure/views) and choose 'disable' from the action
  24. drop-down to the right of the view you would like to remove.",
  25. TRIPAL_INFO,
  26. ['return_html' => 1]
  27. );
  28. // Tell Tripal admin how to add views to this list
  29. print tripal_set_message(
  30. "Developers: To add a view or other search tool to the above list you need to
  31. implement hook_search_biological_data_views() in your custom module.
  32. This hook should return an array as follows: <code><pre>array(
  33. '[view-machine-name]' => array(
  34. 'machine_name' => '[view-machine-name]',
  35. 'human_name' => '[Human-readable title to show in above list]',
  36. 'description' => '[description to show in above list]',
  37. 'link' => '[path to the view]'
  38. ),
  39. );</pre></code>
  40. Where you should replace all instructions in square-brackets([]) with the details of your view.",
  41. TRIPAL_INFO,
  42. ['return_html' => 1]
  43. );
  44. // Tell Tripal Admin which template to change
  45. print tripal_set_message(
  46. "Administrators, you can customize the way the content above is presented. Tripal
  47. provides a template file for each block of content. To customize, copy the template
  48. file to your site's default theme, edit then " .
  49. l('clear the Drupal cache', 'admin/config/development/performance', ['attributes' => ['target' => '_blank']]) .
  50. ". Currently, the content above is provided by this template: <br><br>$template_file",
  51. TRIPAL_INFO,
  52. ['return_html' => 1]
  53. );
  54. ?>