tripal_phylogeny.admin.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Administrative settings form
  4. *
  5. * @ingroup tripal_legacy_phylogeny
  6. */
  7. function tripal_phylogeny_admin() {
  8. $form = array();
  9. // PHYLOTREE NODE TITLES
  10. // If your module is using the Chado Node: Title & Path API to allow
  11. // custom titles for your node type then you need to add the
  12. // configuration form for this functionality.
  13. $details = array(
  14. 'module' => 'tripal_phylogeny',
  15. 'content_type' => 'chado_phylotree',
  16. // An array of options to use under "Page Titles"
  17. // the key should be the token and the value should be the human-readable option
  18. 'options' => array(
  19. '[phylotree.name]' => 'Tree Name Only',
  20. // there should always be one options matching the unique constraint.
  21. '[phylotree.phylotree_id]' => 'The Chado ID for Phylotrees'
  22. ),
  23. // the token indicating the unique constraint in the options array
  24. 'unique_option' => '[phylotree.phylotree_id]'
  25. );
  26. // This call adds the configuration form to your current form
  27. // This sub-form handles it's own validation & submit
  28. chado_add_admin_form_set_title($form, $form_state, $details);
  29. // PHYLOTREE NODE URL
  30. // Using the Chado Node: Title & Path API
  31. $details = array(
  32. 'module' => 'tripal_phylogeny',
  33. 'content_type' => 'chado_phylotree',
  34. // An array of options to use under "Page URL"
  35. // the key should be the token and the value should be the human-readable option
  36. 'options' => array(
  37. '/tree/[phylotree.name]' => 'Tree Name Only',
  38. // there should always be one options matching the unique constraint.
  39. '/tree/[phylotree.phylotree_id]' => 'The Chado ID for Phylotrees',
  40. )
  41. );
  42. // This call adds the configuration form to your current form
  43. // This sub-form handles it's own validation & submit
  44. chado_add_admin_form_set_url($form, $form_state, $details);
  45. return system_settings_form($form);
  46. }