Browse Source

Changed module TOC URL to include content type. This way if a module provides more than one content type the module can support multiple TOCs

Stephen Ficklin 10 years ago
parent
commit
e028703591

+ 1 - 1
tripal_analysis/tripal_analysis.module

@@ -81,7 +81,7 @@ function tripal_analysis_menu() {
     'weight' => 2
   );
 
-  $items['admin/tripal/chado/tripal_analysis/toc'] = array(
+  $items['admin/tripal/chado/tripal_analysis/chado_analysis_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for analysis nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_contact/tripal_contact.module

@@ -89,7 +89,7 @@ function tripal_contact_menu() {
     'weight' => 0
   );
 
-  $items['admin/tripal/chado/tripal_contact/toc'] = array(
+  $items['admin/tripal/chado/tripal_contact/chado_contact_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for contact nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_core/includes/tripal_core.toc.inc

@@ -19,7 +19,7 @@ function tripal_core_node_toc_form($form, &$form_state, $node) {
   );
   $admin_link = l(
     $type_info->name . " TOC administrative page", 
-    "admin/tripal/chado/" . $type_info->module . "/toc",
+    "admin/tripal/chado/" . $type_info->module . "/" . $node->type . "toc",
     array('attributes' => array('target' => '_blank'))
   );
   $form["instructions"]["main"] = array(

+ 6 - 2
tripal_example/tripal_example.module

@@ -152,8 +152,12 @@ function tripal_example_menu() {
   // specific.  To provide a tab in the module's administrative pages add the
   // following menu item. This menu will provide a form similar to the one
   // found on the node that allows the user to set global TOC settings for the
-  // content type.
-  $items['admin/tripal/chado/tripal_example/toc'] = array(
+  // content type.  Be sure to always use a menu path of the form:
+  //   admin/tripal/chado/[module name]/[content type name]_toc
+  // this allows for a module to support TOC management when there are multiple
+  // content types provided by the module, as the content type is specified
+  // in the menu path.
+  $items['admin/tripal/chado/tripal_example/chado_example_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for example nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_feature/tripal_feature.module

@@ -162,7 +162,7 @@ function tripal_feature_menu() {
     'type' => MENU_LOCAL_TASK,
     'weight' => 1
   );
-  $items['admin/tripal/chado/tripal_feature/toc'] = array(
+  $items['admin/tripal/chado/tripal_feature/chado_feature_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for feature nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_featuremap/tripal_featuremap.module

@@ -129,7 +129,7 @@ function tripal_featuremap_menu() {
     'weight' => 0
   );
 
-  $items['admin/tripal/chado/tripal_featuremap/toc'] = array(
+  $items['admin/tripal/chado/tripal_featuremap/chado_featuremap_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for feature map nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_library/tripal_library.module

@@ -102,7 +102,7 @@ function tripal_library_menu() {
     'weight' => 2
   );
   
-  $items['admin/tripal/chado/tripal_library/toc'] = array(
+  $items['admin/tripal/chado/tripal_library/chado_library_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for library nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_organism/tripal_organism.module

@@ -69,7 +69,7 @@ function tripal_organism_menu() {
     'weight' => 2
   );
   
-  $items['admin/tripal/chado/tripal_organism/toc'] = array(
+  $items['admin/tripal/chado/tripal_organism/chado_organism_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for organism nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_project/tripal_project.module

@@ -77,7 +77,7 @@ function tripal_project_menu() {
     'weight' => 0
   );
   
-  $items['admin/tripal/chado/tripal_project/toc'] = array(
+  $items['admin/tripal/chado/tripal_project/chado_project_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for project nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_pub/tripal_pub.module

@@ -113,7 +113,7 @@ function tripal_pub_menu() {
     'weight' => 2
   );
   
-  $items['admin/tripal/chado/tripal_pub/toc'] = array(
+  $items['admin/tripal/chado/tripal_pub/chado_pub_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for pub nodes.',
     'page callback' => 'drupal_get_form',

+ 1 - 1
tripal_stock/tripal_stock.module

@@ -79,7 +79,7 @@ function tripal_stock_menu() {
     'weight' => 0
   );
   
-  $items['admin/tripal/chado/tripal_stock/toc'] = array(
+  $items['admin/tripal/chado/tripal_stock/chado_stock_toc'] = array(
     'title' => ' TOC',
     'description' => 'Manage the table of contents for stock nodes.',
     'page callback' => 'drupal_get_form',