tripal_library.admin.inc

  1. 2.x tripal_library/includes/tripal_library.admin.inc
  2. 3.x legacy/tripal_library/includes/tripal_library.admin.inc
  3. 1.x tripal_library/includes/tripal_library.admin.inc

Admin launchpad

File

legacy/tripal_library/includes/tripal_library.admin.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Admin launchpad
  5. */
  6. /**
  7. * Admin launchpad
  8. *
  9. * @ingroup tripal_legacy_library
  10. */
  11. function tripal_library_admin_libraries_listing() {
  12. $output = '';
  13. // set the breadcrumb
  14. $breadcrumb = array();
  15. $breadcrumb[] = l('Home', '<front>');
  16. $breadcrumb[] = l('Administration', 'admin');
  17. $breadcrumb[] = l('Tripal', 'admin/tripal');
  18. $breadcrumb[] = l('Chado', 'admin/tripal/legacy');
  19. $breadcrumb[] = l('Libraries', 'admin/tripal/legacy/tripal_library');
  20. drupal_set_breadcrumb($breadcrumb);
  21. // Add the view
  22. $view = views_embed_view('tripal_library_admin_libraries','default');
  23. if (isset($view)) {
  24. $output .= $view;
  25. }
  26. else {
  27. $output .= '<p>The Tripal Library Module uses primarily views to provide an '
  28. . 'administrative interface. Currently one or more views needed for this '
  29. . 'administrative interface are disabled. <strong>Click each of the following links to '
  30. . 'enable the pertinent views</strong>:</p>';
  31. $output .= '<ul>';
  32. $output .= '<li>'.l('Library Admin', 'admin/tripal/legacy/tripal_library/views/libraries/enable').'</li>';
  33. $output .= '</ul>';
  34. }
  35. return $output;
  36. }
  37. /**
  38. * Administrative settings form
  39. *
  40. * @ingroup tripal_legacy_library
  41. */
  42. function tripal_library_admin() {
  43. $form = array();
  44. // If your module is using the Chado Node: Title & Path API to allow custom titles
  45. // for your node type then you need to add the configuration form for this functionality.
  46. $details = array(
  47. 'module' => 'tripal_library', // the name of the MODULE implementing the content type
  48. 'content_type' => 'chado_library', // the name of the content type
  49. // An array of options to use under "Page Titles"
  50. // the key should be the token and the value should be the human-readable option
  51. 'options' => array(
  52. '[library.name]' => 'Library Name Only',
  53. // there should always be one options matching the unique constraint.
  54. '[library.name], [library.uniquename] ([library.type_id>cvterm.name]) [library.organism_id>organism.genus] [library.organism_id>organism.species]' => 'Unique Contraint: Includes the name, type and organism scientific name'
  55. ),
  56. // the token indicating the unique constraint in the options array
  57. 'unique_option' => '[library.name], [library.uniquename] ([library.type_id>cvterm.name]) [library.organism_id>organism.genus] [library.organism_id>organism.species]'
  58. );
  59. // This call adds the configuration form to your current form
  60. // This sub-form handles it's own validation & submit
  61. chado_add_admin_form_set_title($form, $form_state, $details);
  62. // URL ALIAS
  63. $details = array(
  64. 'module' => 'tripal_library',
  65. 'content_type' => 'chado_library',
  66. 'options' => array(
  67. '/library/[library.library_id]' => 'Library ID',
  68. '/library/[library.organism_id>organism.genus]/[library.organism_id>organism.species]/[library.type_id>cvterm.name]/[library.uniquename]' => 'Unique Contraint: Includes the name, uniquename, type and scientific name'
  69. ),
  70. );
  71. // This call adds the configuration form to your current form
  72. // This sub-form handles it's own validation & submit
  73. chado_add_admin_form_set_url($form, $form_state, $details);
  74. return system_settings_form($form);
  75. }