Browse Source

Fixed merge conflict

Stephen Ficklin 9 years ago
parent
commit
210802ce70
31 changed files with 320 additions and 161 deletions
  1. 1 1
      legacy/tripal_analysis/includes/tripal_analysis.chado_node.inc
  2. 1 1
      legacy/tripal_example/includes/tripal_example.chado_node.inc
  3. 1 1
      legacy/tripal_feature/includes/tripal_feature.chado_node.inc
  4. 1 1
      legacy/tripal_feature/includes/tripal_feature.delete.inc
  5. 1 1
      legacy/tripal_feature/includes/tripal_feature.fasta_loader.inc
  6. 2 2
      legacy/tripal_feature/includes/tripal_feature.seq_extract.inc
  7. 1 1
      legacy/tripal_feature/theme/templates/tripal_organism_feature_counts.tpl.php
  8. 1 1
      legacy/tripal_feature/theme/tripal_feature.theme.inc
  9. 1 1
      legacy/tripal_featuremap/includes/tripal_featuremap.chado_node.inc
  10. 1 1
      legacy/tripal_library/includes/tripal_library.chado_node.inc
  11. 1 1
      legacy/tripal_project/includes/tripal_project.chado_node.inc
  12. 1 1
      legacy/tripal_stock/includes/tripal_stock.chado_node.inc
  13. 2 2
      tripal_chado/includes/fields/kvproperty_adder.inc
  14. 2 2
      tripal_core/api/tripal_core.DEPRECATED.inc
  15. 3 3
      tripal_core/api/tripal_core.chado_nodes.properties.api.inc
  16. 3 3
      tripal_core/api/tripal_core.chado_nodes.relationships.api.inc
  17. 2 2
      tripal_core/api/tripal_core.custom_tables.api.inc
  18. 13 13
      tripal_core/includes/tripal_core.custom_tables.inc
  19. 12 12
      tripal_core/includes/tripal_core.mviews.inc
  20. 48 46
      tripal_core/tripal_core.module
  21. 11 11
      tripal_core/tripal_core.views_default.inc
  22. 2 2
      tripal_cv/api/tripal_cv.api.inc
  23. 6 6
      tripal_cv/includes/tripal_cv.admin.inc
  24. 1 1
      tripal_cv/tripal_cv.info
  25. 17 16
      tripal_cv/tripal_cv.module
  26. 10 10
      tripal_cv/tripal_cv.views_default.inc
  27. 161 6
      tripal_entities/includes/TripalBundleUIController.inc
  28. 1 0
      tripal_entities/includes/TripalEntityUIController.inc
  29. 1 1
      tripal_entities/includes/tripal_entities.admin.inc
  30. 11 11
      tripal_entities/tripal_entities.module
  31. 1 1
      tripal_views/tripal_views.module

+ 1 - 1
legacy/tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -267,7 +267,7 @@ function chado_analysis_form($node, &$form_state) {
 
   // Properties Form
   // ----------------------------------
-  $instructions = t('To add additional properties to the drop down. ' . l("Add terms to the analysis_property vocabulary", "admin/tripal/chado/tripal_cv/cvterm/add") . ".");
+  $instructions = t('To add additional properties to the drop down. ' . l("Add terms to the analysis_property vocabulary", "admin/tripal/vocab/cvterm/add") . ".");
   $prop_cv = tripal_get_default_cv('analysisprop', 'type_id');
   $cv_id = $prop_cv ? $prop_cv->cv_id : NULL;
   $details = array(

+ 1 - 1
legacy/tripal_example/includes/tripal_example.chado_node.inc

@@ -205,7 +205,7 @@ function chado_example_form($node, &$form_state) {
     '#description' => t("Choose the example type (e.g. Test Type)."),
     '#required'    => TRUE,
     '#default_value' => $example_type,
-    '#autocomplete_path' => "admin/tripal/chado/tripal_cv/cvterm/auto_name/$cv_id",
+    '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name/$cv_id",
   );
 
   // add a select box of organisms

+ 1 - 1
legacy/tripal_feature/includes/tripal_feature.chado_node.inc

@@ -151,7 +151,7 @@ function chado_feature_form($node, &$form_state) {
    '#description' => t("Choose the feature type."),
    '#required'    => TRUE,
    '#default_value' => $feature_type,
-   '#autocomplete_path' => "admin/tripal/chado/tripal_cv/cvterm/auto_name/$cv_id",
+   '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name/$cv_id",
   );
 
   // get the list of organisms

+ 1 - 1
legacy/tripal_feature/includes/tripal_feature.delete.inc

@@ -32,7 +32,7 @@ function tripal_feature_delete_form() {
    '#title'       => t('Feature Type'),
    '#type'        => 'textfield',
    '#description' => t("Choose the feature type."),
-   '#autocomplete_path' => "admin/tripal/chado/tripal_cv/cvterm/auto_name/$cv->cv_id",
+   '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name/$cv->cv_id",
   );
 
   $organisms = tripal_get_organism_select_options(FALSE);

+ 1 - 1
legacy/tripal_feature/includes/tripal_feature.fasta_loader.inc

@@ -48,7 +48,7 @@ function tripal_feature_fasta_load_form() {
   $form['seqtype'] = array('#type' => 'textfield','#title' => t('Sequence Type'),
     '#required' => TRUE,
     '#description' => t('Please enter the Sequence Ontology (SO) term name that describes the sequences in the FASTA file (e.g. gene, mRNA, polypeptide, etc...)'),
-    '#autocomplete_path' => "admin/tripal/chado/tripal_cv/cvterm/auto_name/$cv_id"
+    '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name/$cv_id"
   );
 
   $form['method'] = array('#type' => 'radios','#title' => 'Method','#required' => TRUE,

+ 2 - 2
legacy/tripal_feature/includes/tripal_feature.seq_extract.inc

@@ -57,8 +57,8 @@ function tripal_feature_seq_extract_page() {
   $output .= '';
   if (user_access('administer tripal')) {
     $output .= tripal_set_message("Administrators, the " . 
-        l('organism_feature_count', 'admin/tripal/schema/mviews') . " and " .
-        l('analysis_organism', 'admin/tripal/schema/mviews') . " materialized
+        l('organism_feature_count', 'admin/tripal/storage/chado/mviews') . " and " .
+        l('analysis_organism', 'admin/tripal/storage/chado/mviews') . " materialized
         views must be populated before using this form.  Those views should be re-populated
         when new data is added.");
   }

+ 1 - 1
legacy/tripal_feature/theme/templates/tripal_organism_feature_counts.tpl.php

@@ -16,7 +16,7 @@ print tripal_set_message("
   l('Tripal feature configuration page', 'admin/tripal/chado/tripal_feature/configuration', array('attributes' => array('target' => '_blank'))) . "
   opening the section \"Feature Summary Report\" and adding the list of
   terms you want to appear in the list. You can rename terms as well. To refresh the data,re-populate the " .
-  l('organism_feature_count', 'admin/tripal/schema/mviews', array('attributes' => array('target' => '_blank'))) . " 
+  l('organism_feature_count', 'admin/tripal/storage/chado/mviews', array('attributes' => array('target' => '_blank'))) . " 
   materialized view.",
   TRIPAL_INFO,
   array('return_html' => 1)

+ 1 - 1
legacy/tripal_feature/theme/tripal_feature.theme.inc

@@ -1016,7 +1016,7 @@ function tripal_feature_preprocess_tripal_feature_bar_chart_type_organism_summar
     'organisms' => $organism_names,
     'legendPosition' => 'top',
     'maxBarHeight' => $max_bar_height,
-    'mviewUrl' => url('admin/tripal/schema/mviews/update/' . $mview->mview_id),
+    'mviewUrl' => url('admin/tripal/storage/chado/mviews/update/' . $mview->mview_id),
     'mviewTable' => $mview->name,
     'mviewLastUpdate' => $mview->last_update ? format_date($mview->last_update) : '',
   );

+ 1 - 1
legacy/tripal_featuremap/includes/tripal_featuremap.chado_node.inc

@@ -123,7 +123,7 @@ function chado_featuremap_form($node, &$form_state) {
   // ----------------------------------
   $prop_cv = tripal_get_default_cv('featuremap_property', 'type_id');
   $cv_id = $prop_cv ? $prop_cv->cv_id : NULL;
-  $instructions = t('To add additional properties to the drop down. ' . l("Add terms to the featuremap_property vocabulary", "admin/tripal/chado/tripal_cv/cvterm/add") . ".");
+  $instructions = t('To add additional properties to the drop down. ' . l("Add terms to the featuremap_property vocabulary", "admin/tripal/vocab/cvterm/add") . ".");
   $details = array(
     'property_table' => 'featuremapprop',
     'chado_id' => $featuremap_id,

+ 1 - 1
legacy/tripal_library/includes/tripal_library.chado_node.inc

@@ -128,7 +128,7 @@ function chado_library_form($node, &$form_state) {
   $lt_message = tripal_set_message("To add additional items to the library type drop down list,
      add a term to the " .
      l($lt_cv->name . " controlled vocabulary",
-       "admin/tripal/chado/tripal_cv/cv/" . $lt_cv->cv_id . "/cvterm/add",
+       "admin/tripal/vocab/cv/" . $lt_cv->cv_id . "/cvterm/add",
        array('attributes' => array('target' => '_blank'))
       ),
      TRIPAL_INFO, array('return_html' => TRUE)

+ 1 - 1
legacy/tripal_project/includes/tripal_project.chado_node.inc

@@ -156,7 +156,7 @@ function chado_project_form(&$node, $form_state) {
     unset($select_options[$descrip_id]);
   }
 
-  $instructions = t('To add properties to the drop down list, you must ' . l("add terms to the project_property vocabulary", "admin/tripal/chado/tripal_cv/cvterm/add") . ".");
+  $instructions = t('To add properties to the drop down list, you must ' . l("add terms to the project_property vocabulary", "admin/tripal/vocab/cvterm/add") . ".");
   $details = array(
     'property_table' => 'projectprop',
     'chado_id' => $project_id,

+ 1 - 1
legacy/tripal_stock/includes/tripal_stock.chado_node.inc

@@ -202,7 +202,7 @@ function chado_stock_form($node, $form_state) {
   $st_message = tripal_set_message("To add additional items to the stock type drop down list,
      add a term to the " .
     l($st_cv->name . " controlled vocabulary",
-      "admin/tripal/chado/tripal_cv/cv/" . $st_cv->cv_id . "/cvterm/add",
+      "admin/tripal/vocab/cv/" . $st_cv->cv_id . "/cvterm/add",
       array('attributes' => array('target' => '_blank'))
     ),
     TRIPAL_INFO, array('return_html' => TRUE)

+ 2 - 2
tripal_chado/includes/fields/kvproperty_adder.inc

@@ -44,11 +44,11 @@ function tripal_chado_kvproperty_adder_widget(&$widget, $form, $form_state,
     '#type' => 'textfield',
     '#description' => t("Please enter the type of property that you want to
         add.  As you type, suggestions will be provided."),
-    '#autocomplete_path' => "admin/tripal/chado/tripal_cv/cvterm/auto_name/",
+    '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name/",
   );
   $widget['kvproperty_adder_link'] = array(
     '#type' => 'item',
-    '#markup' => '<span class="kvproperty-adder-link">' . l('Add a term', 'admin/tripal/chado/tripal_cv/cvterm/add', array('attributes' => array('target' => '_blank'))) . '</span>',
+    '#markup' => '<span class="kvproperty-adder-link">' . l('Add a term', 'admin/tripal/vocab/cvterm/add', array('attributes' => array('target' => '_blank'))) . '</span>',
   );
   // When this button is clicked, the form will be validated and submitted.
   // Therefore, we set custom submit and validate functions to override the

+ 2 - 2
tripal_core/api/tripal_core.DEPRECATED.inc

@@ -815,7 +815,7 @@ function tripal_mviews_action($op, $mview_id, $redirect = FALSE) {
     //New API Function
     $ret = tripal_refresh_mview($mview_id, $redirect);
     if ($redirect) {
-      drupal_goto("admin/tripal/schema/mviews");
+      drupal_goto("admin/tripal/storage/chado/mviews");
     }
     return $ret;
   }
@@ -833,7 +833,7 @@ function tripal_mviews_action($op, $mview_id, $redirect = FALSE) {
     //New API Function
     $ret = tripal_delete_mview($mview_id, $redirect);
     if ($redirect) {
-      drupal_goto("admin/tripal/schema/mviews");
+      drupal_goto("admin/tripal/storage/chado/mviews");
     }
     return $ret;
   }

+ 3 - 3
tripal_core/api/tripal_core.chado_nodes.properties.api.inc

@@ -220,7 +220,7 @@ function chado_add_node_form_properties(&$form, &$form_state, $details) {
     else {
 
       $default_form_link = l('vocabulary defaults configuration page',
-          'admin/tripal/chado/tripal_cv/defaults',
+          'admin/tripal/vocab/defaults',
           array('attributes' => array('target' => '_blank')));
       $message = "There is not a default vocabulary set for Property Types. Please set one using the $default_form_link.";
 
@@ -293,7 +293,7 @@ function chado_add_node_form_properties(&$form, &$form_state, $details) {
         to the %cv_name controlled vocabulary.',
         array(
           '%cv_name' => $details['cv_name'],
-          '@cvtermlink' => url('admin/tripal/chado/tripal_cv/cv/' . $details['cv_id'] . '/cvterm/add')
+          '@cvtermlink' => url('admin/tripal/vocab/cv/' . $details['cv_id'] . '/cvterm/add')
         )
       ),
       TRIPAL_NOTICE,
@@ -306,7 +306,7 @@ function chado_add_node_form_properties(&$form, &$form_state, $details) {
         a controlled vocabulary term</a> to the %cv_name controlled vocabulary.',
         array(
           '%cv_name' => $details['cv_name'],
-          '@cvtermlink' => url('admin/tripal/chado/tripal_cv/cv/' . $details['cv_id'] . '/cvterm/add')
+          '@cvtermlink' => url('admin/tripal/vocab/cv/' . $details['cv_id'] . '/cvterm/add')
         )
       ),
       TRIPAL_INFO,

+ 3 - 3
tripal_core/api/tripal_core.chado_nodes.relationships.api.inc

@@ -174,7 +174,7 @@ function chado_add_node_form_relationships(&$form, &$form_state, $details) {
     else {
 
       $default_form_link = l('vocabulary defaults configuration page',
-          'admin/tripal/chado/tripal_cv/defaults',
+          'admin/tripal/vocab/defaults',
           array('attributes' => array('target' => '_blank')));
 
       $table = ucwords(str_replace('_',' ',$details['base_table']));
@@ -254,7 +254,7 @@ function chado_add_node_form_relationships(&$form, &$form_state, $details) {
         to the %cv_name controlled vocabulary.',
         array(
           '%cv_name' => $details['cv_name'],
-          '@cvtermlink' => url('admin/tripal/chado/tripal_cv/cv/'.$details['cv_id'].'/cvterm/add')
+          '@cvtermlink' => url('admin/tripal/vocab/cv/'.$details['cv_id'].'/cvterm/add')
         )
       ),
       TRIPAL_WARNING,
@@ -267,7 +267,7 @@ function chado_add_node_form_relationships(&$form, &$form_state, $details) {
         a controlled vocabulary term</a> to the %cv_name controlled vocabulary.',
         array(
           '%cv_name' => $details['cv_name'],
-          '@cvtermlink' => url('admin/tripal/chado/tripal_cv/cv/' . $details['cv_id'] . '/cvterm/add')
+          '@cvtermlink' => url('admin/tripal/vocab/cv/' . $details['cv_id'] . '/cvterm/add')
         )
       ),
       TRIPAL_INFO,

+ 2 - 2
tripal_core/api/tripal_core.custom_tables.api.inc

@@ -47,7 +47,7 @@ function chado_edit_custom_table($table_id, $table_name, $schema, $skip_if_exist
     // if this is a materialized view then don't allow editing with this function
     if ($custom_table->mview_id) {
       tripal_report_error('tripal_core', TRIPAL_ERROR, "Please use the tripal_edit_mview() function to edit this custom table as it is a materialized view.", array());
-      drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/schema/mviews') . " interface to edit it.", 'error');
+      drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/storage/chado/mviews') . " interface to edit it.", 'error');
       return FALSE;
     }
 
@@ -330,7 +330,7 @@ function chado_delete_custom_table($table_id) {
   // if this is a materialized view then don't allow deletion with this function
   if ($custom_table->mview_id) {
     tripal_report_error('tripal_core', TRIPAL_ERROR, "Please use the tripal_delete_mview() function to delete this custom table as it is a materialized view. Table not deleted.", array());
-    drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/schema/mviews') . " interface to delete it.", 'error');
+    drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/storage/chado/mviews') . " interface to delete it.", 'error');
     return FALSE;
   }
 

+ 13 - 13
tripal_core/includes/tripal_core.custom_tables.inc

@@ -29,8 +29,8 @@ function tripal_custom_table_admin_view() {
   $breadcrumb[] = l('Home', '<front>');
   $breadcrumb[] = l('Administration', 'admin');
   $breadcrumb[] = l('Tripal', 'admin/tripal');
-  $breadcrumb[] = l('Chado Schema', 'admin/tripal/schema');
-  $breadcrumb[] = l('Custom Tables', 'admin/tripal/schema/custom_tables');
+  $breadcrumb[] = l('Chado Schema', 'admin/tripal/storage/chado');
+  $breadcrumb[] = l('Custom Tables', 'admin/tripal/storage/chado/custom_tables');
   drupal_set_breadcrumb($breadcrumb);
 
   // Add the view
@@ -44,7 +44,7 @@ function tripal_custom_table_admin_view() {
       . 'administrative interface are disabled. <strong>Click each of the following links to '
       . 'enable the pertinent views</strong>:</p>';
     $output .= '<ul>';
-      $output .= '<li>'.l('Custom Tables View', 'admin/tripal/schema/custom_tables/views/tables/enable').'</li>';
+      $output .= '<li>'.l('Custom Tables View', 'admin/tripal/storage/chado/custom_tables/views/tables/enable').'</li>';
     $output .= '</ul>';
   }
 
@@ -79,7 +79,7 @@ function tripal_custom_table_view($table_id) {
 
   // create a table with each row containig stats for
   // an individual job in the results set.
-  $return_url = url("admin/tripal/schema/custom_tables");
+  $return_url = url("admin/tripal/storage/chado/custom_tables");
   $output = "<p><a href=\"$return_url\">" . t("Return to list of custom tables") . "</a></p>";
   $output .= "<br />";
   $output .= "<p>Details for <b>$custom_table->table_name</b>:</p>";
@@ -100,8 +100,8 @@ function tripal_custom_table_view($table_id) {
 
   // build the URLs using the url function so we can handle installations where
   // clean URLs are or are not used
-  $delete_url = url("admin/tripal/schema/custom_tables/delete/$custom_table->table_id");
-  $edit_url = url("admin/tripal/schema/custom_tables/edit/$custom_table->table_id");
+  $delete_url = url("admin/tripal/storage/chado/custom_tables/delete/$custom_table->table_id");
+  $edit_url = url("admin/tripal/storage/chado/custom_tables/edit/$custom_table->table_id");
   $output .= "<tr><th>Actions</th>" .
             "<td>" .
             "     <a href='$edit_url'>Edit</a>, " .
@@ -143,8 +143,8 @@ function tripal_custom_tables_form($form, &$form_state = NULL, $table_id = NULL)
 
     // if this is a materialized view then don't allow editing with this function
     if (property_exists($custom_table, 'mview_id') and $custom_table->mview_id) {
-      drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/schema/mviews') . " interface to edit it.", 'error');
-      drupal_goto("admin/tripal/schema/custom_tables");
+      drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/storage/chado/mviews') . " interface to edit it.", 'error');
+      drupal_goto("admin/tripal/storage/chado/custom_tables");
       return array();
     }
 
@@ -164,7 +164,7 @@ function tripal_custom_tables_form($form, &$form_state = NULL, $table_id = NULL)
 
   $form['return'] = array(
     '#type' => 'markup',
-    '#markup' => "<p>" . l("Return to list of custom tables", "admin/tripal/schema/custom_tables") . "</p>",
+    '#markup' => "<p>" . l("Return to list of custom tables", "admin/tripal/storage/chado/custom_tables") . "</p>",
   );
 
   // Build the form
@@ -373,7 +373,7 @@ function tripal_custom_tables_form_submit($form, &$form_state) {
     drupal_set_message(t("No action performed."));
   }
 
-  drupal_goto("admin/tripal/schema/custom_tables");
+  drupal_goto("admin/tripal/storage/chado/custom_tables");
 }
 
 /**
@@ -390,8 +390,8 @@ function tripal_custom_tables_delete_form($form, &$form_state, $table_id) {
 
   // if this is a materialized view then don't allow editing with this function
   if ($entry->mview_id) {
-    drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/schema/mviews') . " interface to delete it.", 'error');
-    drupal_goto("admin/tripal/schema/custom_tables");
+    drupal_set_message("This custom table is a materialized view. Please use the "  . l('Materialized View', 'admin/tripal/storage/chado/mviews') . " interface to delete it.", 'error');
+    drupal_goto("admin/tripal/storage/chado/custom_tables");
     return array();
   }
 
@@ -433,7 +433,7 @@ function tripal_custom_tables_delete_form_submit($form, &$form_state) {
   else {
     drupal_set_message(t("No action performed."));
   }
-  drupal_goto("admin/tripal/schema/custom_tables");
+  drupal_goto("admin/tripal/storage/chado/custom_tables");
 }
 
 

+ 12 - 12
tripal_core/includes/tripal_core.mviews.inc

@@ -27,8 +27,8 @@ function tripal_mview_admin_view() {
   $breadcrumb[] = l('Home', '<front>');
   $breadcrumb[] = l('Administration', 'admin');
   $breadcrumb[] = l('Tripal', 'admin/tripal');
-  $breadcrumb[] = l('Chado Schema', 'admin/tripal/schema');
-  $breadcrumb[] = l('Materialized Views', 'admin/tripal/schema/mviews');
+  $breadcrumb[] = l('Chado Schema', 'admin/tripal/storage/chado');
+  $breadcrumb[] = l('Materialized Views', 'admin/tripal/storage/chado/mviews');
   drupal_set_breadcrumb($breadcrumb);
 
   // Add the view
@@ -42,7 +42,7 @@ function tripal_mview_admin_view() {
       . 'administrative interface are disabled. <strong>Click each of the following links to '
       . 'enable the pertinent views</strong>:</p>';
     $output .= '<ul>';
-      $output .= '<li>'.l('MViews View', 'admin/tripal/schema/mviews/views/mviews/enable').'</li>';
+      $output .= '<li>'.l('MViews View', 'admin/tripal/storage/chado/mviews/views/mviews/enable').'</li>';
     $output .= '</ul>';
   }
 
@@ -68,15 +68,15 @@ function tripal_mview_report($mview_id) {
 
   // create a table with each row containig stats for
   // an individual job in the results set.
-  $output  = "<p>" . l("Return to table of materialized views", "admin/tripal/schema/mviews/") . "</p>";
+  $output  = "<p>" . l("Return to table of materialized views", "admin/tripal/storage/chado/mviews/") . "</p>";
   $output .= "<p>Details for <b>$mview->name</b>:</p>";
 
   // build the URLs using the url function so we can handle installations where
   // clean URLs are or are not used
-  $update_url = url("admin/tripal/schema/mviews/action/update/$mview->mview_id");
-  $delete_url = url("admin/tripal/schema/mviews/action/delete/$mview->mview_id");
-  $edit_url = url("admin/tripal/schema/mviews/edit/$mview->mview_id");
-  $export_url = url("admin/tripal/schema/mviews/export/$mview->mview_id");
+  $update_url = url("admin/tripal/storage/chado/mviews/action/update/$mview->mview_id");
+  $delete_url = url("admin/tripal/storage/chado/mviews/action/delete/$mview->mview_id");
+  $edit_url = url("admin/tripal/storage/chado/mviews/edit/$mview->mview_id");
+  $export_url = url("admin/tripal/storage/chado/mviews/export/$mview->mview_id");
   $rows[] = array('Actions', "<a href='$update_url'>Populate</a>, <a href='$edit_url'>Edit</a>,  <a href='$delete_url'>Delete</a>");
 
   if ($mview->last_update > 0) {
@@ -256,7 +256,7 @@ function tripal_mviews_form($form, &$form_state = NULL, $mview_id = NULL) {
 
   $form['return_link'] = array(
     '#type' => 'item',
-    '#description' => l("Return to table of materialized views", "admin/tripal/schema/mviews/"),
+    '#description' => l("Return to table of materialized views", "admin/tripal/storage/chado/mviews/"),
   );
 
   $form['instructions'] = array(
@@ -583,7 +583,7 @@ function tripal_mviews_form_submit($form, &$form_state) {
     $schema_arr = array();
     eval("\$schema_arr = $schema;");
     tripal_add_mview($name, $modulename, $schema_arr, $query, $comment);
-    drupal_goto("admin/tripal/schema/mviews");
+    drupal_goto("admin/tripal/storage/chado/mviews");
   }
   else {
     drupal_set_message(t("No action performed."));
@@ -642,7 +642,7 @@ function tripal_mviews_delete_form_submit($form, &$form_state) {
   else {
     drupal_set_message(t("No action performed."));
   }
-  drupal_goto("admin/tripal/schema/mviews");
+  drupal_goto("admin/tripal/storage/chado/mviews");
 }
 
 /**
@@ -654,5 +654,5 @@ function tripal_mviews_delete_form_submit($form, &$form_state) {
 function tripal_mviews_add_populate_job($mview_id) {
 
   tripal_refresh_mview($mview_id);
-  drupal_goto("admin/tripal/schema/mviews");
+  drupal_goto("admin/tripal/storage/chado/mviews");
 }

+ 48 - 46
tripal_core/tripal_core.module

@@ -132,7 +132,7 @@ function tripal_core_init() {
 function tripal_core_menu() {
   $items = array();
 
-  // Triapl setting groups
+  // Tripal setting groups
   $items['admin/tripal'] = array(
     'title' => 'Tripal',
     'description' => t("Manage the behavior or Tripal and its various modules."),
@@ -142,32 +142,40 @@ function tripal_core_menu() {
     'file' => 'system.admin.inc',
     'file path' => drupal_get_path('module', 'system'),
   );
-  $items['admin/tripal/schema'] = array(
-    'title' => 'Chado Schema',
-    'description' => t("Tools to extend the chado schema through custom tables & materialized views."),
-    'weight' => -2,
+  $items['admin/tripal/tripal_jobs'] = array(
+    'title' => 'Jobs',
+    'description' => t('Jobs managed by Tripal'),
+    'page callback' => 'tripal_jobs_admin_view',
     'access arguments' => array('administer tripal'),
+    'type' => MENU_NORMAL_ITEM,
+    'weight' => 0
   );
-  $items['admin/tripal/chado'] = array(
-    'title' => 'Chado Modules',
-    'description' => t('Configuration for specific chado data types such as Vocabularies, Features, etc.'),
+  $items['admin/tripal/loaders'] = array(
+    'title' => 'Data Loaders',
+    'description' => t('Tools facilitating loading data. Includes a generic tab-delimited loader (Bulk Loader).'),
     'access arguments' => array('administer tripal'),
     'type' => MENU_NORMAL_ITEM,
-    'weight' => -6
+    'weight' => 6
   );
-  $items['admin/tripal/loaders'] = array(
-    'title' => 'Chado Data Loaders',
-    'description' => t('Tools facilitating loading data into the chado database. Includes a generic tab-delimited loader (Bulk Loader).'),
+  $items['admin/tripal/storage'] = array(
+    'title' => 'Storage Backend',
+    'description' => t("Functionality related to data storage and tools to interact with the storage backend."),
+    'weight' => 8,
+    'access arguments' => array('administer tripal'),
+  );
+  $items['admin/tripal/chado'] = array(
+    'title' => 'Legacy Tripal',
+    'description' => t('Tools related to Tripal2 Legacy chado-based node types.'),
     'access arguments' => array('administer tripal'),
     'type' => MENU_NORMAL_ITEM,
-    'weight' => -4
+    'weight' => 20
   );
   $items['admin/tripal/extension'] = array(
     'title' => 'Extensions',
     'description' => t('Configuration for Tripal extensions.'),
     'access arguments' => array('administer tripal'),
     'type' => MENU_NORMAL_ITEM,
-    'weight' => 0
+    'weight' => 100
   );
   $items['admin/tripal/extension/import'] = array(
     'title' => 'Import Extensions',
@@ -181,22 +189,23 @@ function tripal_core_menu() {
     'weight' => -100,
   );
 
-  // Tripal Setup
-  $items['admin/tripal/setup'] = array(
-    'title' => 'Setup Tripal',
-    'description' => t('Tools for setup of Tripal'),
+  // Chado Storage Backend
+  $items['admin/tripal/storage/chado'] = array(
+    'title' => 'Chado Schema',
+    'description' => t("Tools to extend the chado schema through custom tables & materialized views."),
+    'weight' => -100,
     'access arguments' => array('administer tripal'),
-    'weight' => -8
   );
-  $items['admin/tripal/setup/chado_install'] = array(
+  $items['admin/tripal/storage/chado/chado_install'] = array(
     'title' => 'Install Chado Schema',
     'description' => t('Installs the Chado database tables, views, etc., inside the current Drupal database'),
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_core_chado_load_form'),
     'access arguments' => array('install chado'),
     'type' => MENU_NORMAL_ITEM,
-    'weight' => -10
+    'weight' => -100
   );
+/*
   $items['admin/tripal/setup/customize'] = array(
     'title' => 'Customize Tripal',
     'description' => t('Information on how to customize tripal'),
@@ -205,16 +214,9 @@ function tripal_core_menu() {
     'access arguments' => array('administer tripal'),
     'weight' => 10
   );
+*/
 
   // Jobs Management
-  $items['admin/tripal/tripal_jobs'] = array(
-    'title' => 'Jobs',
-    'description' => t('Jobs managed by Tripal'),
-    'page callback' => 'tripal_jobs_admin_view',
-    'access arguments' => array('administer tripal'),
-    'type' => MENU_NORMAL_ITEM,
-    'weight' => -10
-  );
   $items['admin/tripal/tripal_jobs/help'] = array(
     'title' => 'Help',
     'description' => t('Help for the tripal job management system'),
@@ -257,7 +259,7 @@ function tripal_core_menu() {
   );
 
   // Materialized Views
-  $items['admin/tripal/schema/mviews'] = array(
+  $items['admin/tripal/storage/chado/mviews'] = array(
     'title' => 'Materialized Views',
     'description' => t('Materialized views are used to improve speed of large or complex queries.'),
     'page callback' => 'tripal_mview_admin_view',
@@ -265,7 +267,7 @@ function tripal_core_menu() {
     'type' => MENU_NORMAL_ITEM,
     'weight' => -10
   );
-  $items['admin/tripal/schema/mviews/help'] = array(
+  $items['admin/tripal/storage/chado/mviews/help'] = array(
     'title' => 'Help',
     'description' => t('Help for the materialized views management system'),
     'page callback' => 'theme',
@@ -274,7 +276,7 @@ function tripal_core_menu() {
     'type' => MENU_LOCAL_TASK,
     'weight' => 10
   );
-  $items['admin/tripal/schema/mviews/report/%'] = array(
+  $items['admin/tripal/storage/chado/mviews/report/%'] = array(
     'title' => 'Materialized View',
     'description' => t('Materialized views are used to improve speed of large or complex queries. These are database views as compared to Drupal views.'),
     'page callback' => 'tripal_mview_report',
@@ -282,7 +284,7 @@ function tripal_core_menu() {
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/mviews/new'] = array(
+  $items['admin/tripal/storage/chado/mviews/new'] = array(
     'title' => 'Create Materialized View',
     'description' => t('Create a new materialized view.'),
     'page callback' => 'drupal_get_form',
@@ -290,14 +292,14 @@ function tripal_core_menu() {
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/mviews/edit/%'] = array(
+  $items['admin/tripal/storage/chado/mviews/edit/%'] = array(
     'title' => 'Edit Materialized View',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_mviews_form', 5),
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/mviews/update/%'] = array(
+  $items['admin/tripal/storage/chado/mviews/update/%'] = array(
     'title' => 'Create Materialized View',
     'description' => t('Materialized views are used to improve speed of large or complex queries.'),
     'page callback' => 'tripal_mviews_add_populate_job',
@@ -305,7 +307,7 @@ function tripal_core_menu() {
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/mviews/delete/%'] = array(
+  $items['admin/tripal/storage/chado/mviews/delete/%'] = array(
     'title' => 'Create Materialized View',
     'description' => t('Materialized views are used to improve speed of large or complex queries.'),
     'page callback' => 'drupal_get_form',
@@ -315,7 +317,7 @@ function tripal_core_menu() {
   );
   // TODO: complete the code for exporting and importing of MViews.
   // Need to address security issues of sharing SQL.
-  $items['admin/tripal/schema/mviews/import'] = array(
+  $items['admin/tripal/storage/chado/mviews/import'] = array(
     'title' => 'Import MView',
     'description' => 'Import a materialized view from another Tripal instance.',
     'page callback' => 'drupal_get_form',
@@ -323,7 +325,7 @@ function tripal_core_menu() {
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/mviews/%tblid/export'] = array(
+  $items['admin/tripal/storage/chado/mviews/%tblid/export'] = array(
     'title' => 'Export MView',
     'description' => 'Export a materialized view for use by another Tripal instance.',
     'page callback' => 'drupal_get_form',
@@ -333,7 +335,7 @@ function tripal_core_menu() {
   );
 
   // Custom Tables
-  $items['admin/tripal/schema/custom_tables'] = array(
+  $items['admin/tripal/storage/chado/custom_tables'] = array(
     'title' => 'Custom Tables',
     'description' => t('Creation of custom tables that are added to Chado database.'),
     'page callback' => 'tripal_custom_table_admin_view',
@@ -341,7 +343,7 @@ function tripal_core_menu() {
     'type' => MENU_NORMAL_ITEM,
     'weight' => -10
   );
-  $items['admin/tripal/schema/custom_tables/help'] = array(
+  $items['admin/tripal/storage/chado/custom_tables/help'] = array(
     'title' => 'Help',
     'description' => t('Help for the tripal job management system'),
     'page callback' => 'theme',
@@ -350,7 +352,7 @@ function tripal_core_menu() {
     'type' => MENU_LOCAL_TASK,
     'weight' => 10
   );
-  $items['admin/tripal/schema/custom_tables/view/%'] = array(
+  $items['admin/tripal/storage/chado/custom_tables/view/%'] = array(
     'title' => 'Custom Tables',
     'description' => t('Custom tables are added to Chado.'),
     'page callback' => 'tripal_custom_table_view',
@@ -358,21 +360,21 @@ function tripal_core_menu() {
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/custom_tables/new'] = array(
+  $items['admin/tripal/storage/chado/custom_tables/new'] = array(
     'title' => 'Create Custom Table',
     'description' => t('An interface for creating your own custom tables.'),
     'page callback' => 'tripal_custom_table_new_page',
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/custom_tables/edit/%'] = array(
+  $items['admin/tripal/storage/chado/custom_tables/edit/%'] = array(
     'title' => 'Edit Custom Table',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_custom_tables_form', 5),
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/custom_tables/delete/%'] = array(
+  $items['admin/tripal/storage/chado/custom_tables/delete/%'] = array(
     'title' => 'Create Custom Table',
     'description' => t('Custom tables are added to Chado.'),
     'page callback' => 'drupal_get_form',
@@ -380,10 +382,10 @@ function tripal_core_menu() {
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/schema/custom_tables/views/tables/enable'] = array(
+  $items['admin/tripal/storage/chado/custom_tables/views/tables/enable'] = array(
     'title' => 'Enable Custom Tables Administrative View',
     'page callback' => 'tripal_enable_view',
-    'page arguments' => array('tripal_core_admin_custom_table', 'admin/tripal/schema/custom_tables'),
+    'page arguments' => array('tripal_core_admin_custom_table', 'admin/tripal/storage/chado/custom_tables'),
     'access arguments' => array('administer tripal'),
     'type' => MENU_CALLBACK,
   );

+ 11 - 11
tripal_core/tripal_core.views_default.inc

@@ -338,7 +338,7 @@ function tripal_core_admin_defaultview_custom_tables() {
   $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
   $handler->display->display_options['header']['action_links_area']['link-1'] = array(
     'label-1' => 'Add Custom Table',
-    'path-1' => 'admin/tripal/schema/custom_tables/new',
+    'path-1' => 'admin/tripal/storage/chado/custom_tables/new',
   );
   $handler->display->display_options['header']['action_links_area']['link-2'] = array(
     'label-2' => '',
@@ -367,7 +367,7 @@ function tripal_core_admin_defaultview_custom_tables() {
   $handler->display->display_options['fields']['table_name']['field'] = 'table_name';
   $handler->display->display_options['fields']['table_name']['label'] = 'Name';
   $handler->display->display_options['fields']['table_name']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['table_name']['alter']['path'] = 'admin/tripal/schema/custom_tables/view/[table_id]';
+  $handler->display->display_options['fields']['table_name']['alter']['path'] = 'admin/tripal/storage/chado/custom_tables/view/[table_id]';
   /* Field: Tripal Custom Tables: Materialized View ID */
   $handler->display->display_options['fields']['mview_id']['id'] = 'mview_id';
   $handler->display->display_options['fields']['mview_id']['table'] = 'tripal_custom_tables';
@@ -385,7 +385,7 @@ function tripal_core_admin_defaultview_custom_tables() {
   $handler->display->display_options['fields']['nothing']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing']['alter']['text'] = 'Edit';
   $handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/schema/custom_tables/edit/[table_id]';
+  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/storage/chado/custom_tables/edit/[table_id]';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
   $handler->display->display_options['fields']['nothing_1']['table'] = 'views';
@@ -394,7 +394,7 @@ function tripal_core_admin_defaultview_custom_tables() {
   $handler->display->display_options['fields']['nothing_1']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing_1']['alter']['text'] = 'Delete';
   $handler->display->display_options['fields']['nothing_1']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/schema/custom_tables/delete/[table_id]';
+  $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/storage/chado/custom_tables/delete/[table_id]';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_2']['id'] = 'nothing_2';
   $handler->display->display_options['fields']['nothing_2']['table'] = 'views';
@@ -419,7 +419,7 @@ function tripal_core_admin_defaultview_custom_tables() {
   
   /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page');
-  $handler->display->display_options['path'] = 'admin/tripal/schema/custom_tables/tables';
+  $handler->display->display_options['path'] = 'admin/tripal/storage/chado/custom_tables/tables';
   $handler->display->display_options['menu']['type'] = 'default tab';
   $handler->display->display_options['menu']['title'] = 'Custom Tables';
   $handler->display->display_options['menu']['description'] = 'A list of existing custom tables';
@@ -537,7 +537,7 @@ function tripal_core_admin_defaultview_mviews() {
   $handler->display->display_options['header']['action_links_area']['label'] = 'Action Links';
   $handler->display->display_options['header']['action_links_area']['link-1'] = array(
     'label-1' => 'Add Materialized View',
-    'path-1' => 'admin/tripal/schema/mviews/new',
+    'path-1' => 'admin/tripal/storage/chado/mviews/new',
   );
   $handler->display->display_options['header']['action_links_area']['link-2'] = array(
     'label-2' => '',
@@ -565,7 +565,7 @@ function tripal_core_admin_defaultview_mviews() {
   $handler->display->display_options['fields']['name']['table'] = 'tripal_mviews';
   $handler->display->display_options['fields']['name']['field'] = 'name';
   $handler->display->display_options['fields']['name']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['name']['alter']['path'] = 'admin/tripal/schema/mviews/report/[mview_id]';
+  $handler->display->display_options['fields']['name']['alter']['path'] = 'admin/tripal/storage/chado/mviews/report/[mview_id]';
   /* Field: Tripal Materialized Views: Table */
   $handler->display->display_options['fields']['mv_table']['id'] = 'mv_table';
   $handler->display->display_options['fields']['mv_table']['table'] = 'tripal_mviews';
@@ -594,7 +594,7 @@ function tripal_core_admin_defaultview_mviews() {
   $handler->display->display_options['fields']['nothing']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing']['alter']['text'] = 'Edit';
   $handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/schema/mviews/edit/[mview_id]';
+  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/storage/chado/mviews/edit/[mview_id]';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
   $handler->display->display_options['fields']['nothing_1']['table'] = 'views';
@@ -603,7 +603,7 @@ function tripal_core_admin_defaultview_mviews() {
   $handler->display->display_options['fields']['nothing_1']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing_1']['alter']['text'] = 'Delete';
   $handler->display->display_options['fields']['nothing_1']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/schema/mviews/delete/[mview_id]';
+  $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/storage/chado/mviews/delete/[mview_id]';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_2']['id'] = 'nothing_2';
   $handler->display->display_options['fields']['nothing_2']['table'] = 'views';
@@ -612,7 +612,7 @@ function tripal_core_admin_defaultview_mviews() {
   $handler->display->display_options['fields']['nothing_2']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing_2']['alter']['text'] = 'Populate';
   $handler->display->display_options['fields']['nothing_2']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing_2']['alter']['path'] = 'admin/tripal/schema/mviews/update/[mview_id]';
+  $handler->display->display_options['fields']['nothing_2']['alter']['path'] = 'admin/tripal/storage/chado/mviews/update/[mview_id]';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_3']['id'] = 'nothing_3';
   $handler->display->display_options['fields']['nothing_3']['table'] = 'views';
@@ -686,7 +686,7 @@ function tripal_core_admin_defaultview_mviews() {
 
   /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page');
-  $handler->display->display_options['path'] = 'admin/tripal/schema/mviews/mviews';
+  $handler->display->display_options['path'] = 'admin/tripal/storage/chado/mviews/mviews';
   $handler->display->display_options['menu']['type'] = 'default tab';
   $handler->display->display_options['menu']['title'] = 'Materialized Views';
   $handler->display->display_options['menu']['description'] = 'a list of mviews';

+ 2 - 2
tripal_cv/api/tripal_cv.api.inc

@@ -1131,7 +1131,7 @@ function tripal_get_cvterm_default_select_options($table, $field, $field_desc) {
     if (count($options) == 0) {
       tripal_set_message('There are no ' . $field_desc . '. Please ' .
         l('add terms',
-          'admin/tripal/chado/tripal_cv/cv/' .$default_cv->cv_id. '/cvterm/add',
+          'admin/tripal/vocab/cv/' .$default_cv->cv_id. '/cvterm/add',
            array('attributes' => array('target' => '_blank'))) . ' to the ' .
         $default_cv->name .' vocabulary.',
         TRIPAL_WARNING);
@@ -1142,7 +1142,7 @@ function tripal_get_cvterm_default_select_options($table, $field, $field_desc) {
     tripal_set_message('There is not a default vocabulary set for ' . $field_desc . '. '.
       'Please set one using the ' .
       l('vocabulary defaults configuration page',
-        'admin/tripal/chado/tripal_cv/defaults',
+        'admin/tripal/vocab/defaults',
         array('attributes' => array('target' => '_blank'))) . '.',
       TRIPAL_WARNING);
   }

+ 6 - 6
tripal_cv/includes/tripal_cv.admin.inc

@@ -18,7 +18,7 @@ function tripal_cv_admin_cv_listing() {
   $breadcrumb[] = l('Administration', 'admin');
   $breadcrumb[] = l('Tripal', 'admin/tripal');
   $breadcrumb[] = l('Chado Modules', 'admin/tripal/chado');
-  $breadcrumb[] = l('Vocabularies', 'admin/tripal/chado/tripal_cv');
+  $breadcrumb[] = l('Vocabularies', 'admin/tripal/vocab');
   drupal_set_breadcrumb($breadcrumb);
 
   // Add the view
@@ -34,10 +34,10 @@ function tripal_cv_admin_cv_listing() {
       . 'enable the pertinent views</strong>:</p>';
     $output .= '<ul>';
     if (!isset($cvs_view)) {
-      $output .= '<li>'.l('Tripal Vocabularies', 'admin/tripal/chado/tripal_cv/views/cvs/enable').'</li>';
+      $output .= '<li>'.l('Tripal Vocabularies', 'admin/tripal/vocab/views/cvs/enable').'</li>';
     }
     if (!isset($cvterm_view)) {
-      $output .= '<li>'.l('Tripal Vocabulary Terms', 'admin/tripal/chado/tripal_cv/views/cvterms/enable').'</li>';
+      $output .= '<li>'.l('Tripal Vocabulary Terms', 'admin/tripal/vocab/views/cvterms/enable').'</li>';
     }
     $output .= '</ul>';
   }
@@ -123,18 +123,18 @@ function tripal_cv_admin_set_defaults_form($form, &$form_state) {
     );
 
     // Actions
-    $view_terms = l('New Vocabulary', 'admin/tripal/chado/tripal_cv/cv/add');
+    $view_terms = l('New Vocabulary', 'admin/tripal/vocab/cv/add');
     $add_term = '';
     if (!empty($cv)) {
       $view_terms = l(
         'View Terms',
-        'admin/tripal/chado/tripal_cv/cvterms',
+        'admin/tripal/vocab/cvterms',
         array('query' => array('cv' => $cv->name))
       );
 
       $add_term = l(
         'Add Term',
-        'admin/tripal/chado/tripal_cv/cv/' . $cv->cv_id . '/cvterm/add'
+        'admin/tripal/vocab/cv/' . $cv->cv_id . '/cvterm/add'
       );
     }
     $form['settings']['existing'][$cv_default_id]["view-terms"] = array(

+ 1 - 1
tripal_cv/tripal_cv.info

@@ -4,7 +4,7 @@ core = 7.x
 project = tripal
 package = Tripal
 version = 7.x-2.0
-configure = admin/tripal/chado/tripal_cv
+configure = admin/tripal/vocab
 
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 17 - 16
tripal_cv/tripal_cv.module

@@ -43,15 +43,16 @@ function tripal_cv_init() {
 function tripal_cv_menu() {
   $items = array();
 
-  $items['admin/tripal/chado/tripal_cv'] = array(
+  $items['admin/tripal/vocab'] = array(
     'title' => 'Controlled Vocabularies',
-    'description' => 'Controlled Vocabularies control the terms available for various chado fields.',
+    'description' => 'Controlled Vocabularies control the types available for entities and fields.',
     'page callback' => 'tripal_cv_admin_cv_listing',
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_NORMAL_ITEM,
+    'weight' => 2,
   );
 
-  $items['admin/tripal/chado/tripal_cv/defaults'] = array(
+  $items['admin/tripal/vocab/defaults'] = array(
     'title' => 'Defaults',
     'description' => 'Set the default vocabularies for properties and relationships.',
     'page callback' => 'drupal_get_form',
@@ -61,7 +62,7 @@ function tripal_cv_menu() {
     'weight' => 5
   );
 
-  $items['admin/tripal/chado/tripal_cv/help'] = array(
+  $items['admin/tripal/vocab/help'] = array(
     'title' => 'Help',
     'description' => "A description of the Tripal Controlled Vocabulary module including a short description of it's usage.",
     'page callback' => 'theme',
@@ -72,7 +73,7 @@ function tripal_cv_menu() {
   );
 
   // The OBO loader will be available in two places
-  $items['admin/tripal/chado/tripal_cv/obo_loader'] = array(
+  $items['admin/tripal/vocab/obo_loader'] = array(
     'title' => 'OBO File Loader',
     'description' => 'Load an ontology in OBO format chado as a controlled vocabulary.',
     'page callback' => 'drupal_get_form',
@@ -94,7 +95,7 @@ function tripal_cv_menu() {
    * Menu for updating the cvtermpath
    */
 
-  $items['admin/tripal/chado/tripal_cv/cvtermpath'] = array(
+  $items['admin/tripal/vocab/cvtermpath'] = array(
     'title' => 'Update Chado cvtermpath table',
     'description' => 'The Chado cvtermpath table provides lineage for terms and is useful for quickly finding any ancestor parent of a term.  However, this table must be populated.  This page allows for populating of this table one vocabulary at a time',
     'page callback' => 'drupal_get_form',
@@ -106,7 +107,7 @@ function tripal_cv_menu() {
   /*
    * Menu items for adding and editing CVs
    */
-  $items['admin/tripal/chado/tripal_cv/cv/edit/%'] = array(
+  $items['admin/tripal/vocab/cv/edit/%'] = array(
     'title' => 'Edit a Controlled Vocabulary',
     'description' => 'Edit the details such as name and description for an existing controlled vocabulary.',
     'page callback' => 'drupal_get_form',
@@ -116,7 +117,7 @@ function tripal_cv_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  $items['admin/tripal/chado/tripal_cv/cv/add'] = array(
+  $items['admin/tripal/vocab/cv/add'] = array(
     'title' => 'Add a Controlled Vocabulary',
     'description' => 'Manually a new controlled vocabulary.',
     'page callback' => 'drupal_get_form',
@@ -129,7 +130,7 @@ function tripal_cv_menu() {
   /*
    * Menu items for adding and editing CVterms
    */
-  $items['admin/tripal/chado/tripal_cv/cv/%/cvterm/add'] = array(
+  $items['admin/tripal/vocab/cv/%/cvterm/add'] = array(
     'title' => 'Add a Controlled Vocabulary Term',
     'description' => 'Add a new controlled vocabulary term.',
     'page callback' => 'drupal_get_form',
@@ -137,7 +138,7 @@ function tripal_cv_menu() {
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/chado/tripal_cv/cvterm/add'] = array(
+  $items['admin/tripal/vocab/cvterm/add'] = array(
     'title' => 'Add a Controlled Vocabulary Term',
     'description' => 'Add a new controlled vocabulary term.',
     'page callback' => 'drupal_get_form',
@@ -145,7 +146,7 @@ function tripal_cv_menu() {
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/chado/tripal_cv/cv/%/cvterm/edit/%'] = array(
+  $items['admin/tripal/vocab/cv/%/cvterm/edit/%'] = array(
     'title' => 'Edit a Controlled Vocabulary Term',
     'description' => 'Edit an existing controlled vocabulary term.',
     'page callback' => 'drupal_get_form',
@@ -153,7 +154,7 @@ function tripal_cv_menu() {
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/chado/tripal_cv/cvterm/auto_name/%/%'] = array(
+  $items['admin/tripal/vocab/cvterm/auto_name/%/%'] = array(
     'page callback' => 'tripal_cv_cvterm_name_autocomplete',
     'page arguments' => array(6, 7),
     'access arguments' => array('administer controlled vocabularies'),
@@ -162,17 +163,17 @@ function tripal_cv_menu() {
   /*
    * Menu items for enabling views
    */
-  $items['admin/tripal/chado/tripal_cv/views/cvs/enable'] = array(
+  $items['admin/tripal/vocab/views/cvs/enable'] = array(
     'title' => 'Enable Vocabulary Administrative View',
     'page callback' => 'tripal_enable_view',
-    'page arguments' => array('tripal_cv_admin_cvs', 'admin/tripal/chado/tripal_cv'),
+    'page arguments' => array('tripal_cv_admin_cvs', 'admin/tripal/vocab'),
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/tripal/chado/tripal_cv/views/cvterms/enable'] = array(
+  $items['admin/tripal/vocab/views/cvterms/enable'] = array(
     'title' => 'Enable Vocabulary Terms Administrative View',
     'page callback' => 'tripal_enable_view',
-    'page arguments' => array('tripal_cv_admin_cvterms', 'admin/tripal/chado/tripal_cv'),
+    'page arguments' => array('tripal_cv_admin_cvterms', 'admin/tripal/vocab'),
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );

+ 10 - 10
tripal_cv/tripal_cv.views_default.inc

@@ -88,11 +88,11 @@ function tripal_cv_defaultview_admin_cvs_listing() {
   $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
   $handler->display->display_options['header']['action_links_area']['link-1'] = array(
     'label-1' => 'Add Vocabulary',
-    'path-1' => 'admin/tripal/chado/tripal_cv/cv/add',
+    'path-1' => 'admin/tripal/vocab/cv/add',
   );
   $handler->display->display_options['header']['action_links_area']['link-2'] = array(
     'label-2' => 'Load Ontology',
-    'path-2' => 'admin/tripal/chado/tripal_cv/obo_loader',
+    'path-2' => 'admin/tripal/vocab/obo_loader',
   );
   /* No results behavior: Global: Text area */
   $handler->display->display_options['empty']['text']['id'] = 'area';
@@ -122,7 +122,7 @@ function tripal_cv_defaultview_admin_cvs_listing() {
   $handler->display->display_options['fields']['nothing_1']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing_1']['alter']['text'] = 'edit';
   $handler->display->display_options['fields']['nothing_1']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/chado/tripal_cv/cv/edit/[cv_id]';
+  $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/vocab/cv/edit/[cv_id]';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing']['id'] = 'nothing';
   $handler->display->display_options['fields']['nothing']['table'] = 'views';
@@ -131,7 +131,7 @@ function tripal_cv_defaultview_admin_cvs_listing() {
   $handler->display->display_options['fields']['nothing']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing']['alter']['text'] = 'View Terms';
   $handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/chado/tripal_cv/cvterms?cv=[name]';
+  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/vocab/cvterms?cv=[name]';
   $handler->display->display_options['fields']['nothing']['hide_alter_empty'] = TRUE;
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_3']['id'] = 'nothing_3';
@@ -141,7 +141,7 @@ function tripal_cv_defaultview_admin_cvs_listing() {
   $handler->display->display_options['fields']['nothing_3']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing_3']['alter']['text'] = 'Add Term';
   $handler->display->display_options['fields']['nothing_3']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing_3']['alter']['path'] = 'admin/tripal/chado/tripal_cv/cv/[cv_id]/cvterm/add';
+  $handler->display->display_options['fields']['nothing_3']['alter']['path'] = 'admin/tripal/vocab/cv/[cv_id]/cvterm/add';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_2']['id'] = 'nothing_2';
   $handler->display->display_options['fields']['nothing_2']['table'] = 'views';
@@ -197,7 +197,7 @@ function tripal_cv_defaultview_admin_cvs_listing() {
 
   /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_cv/cvs';
+  $handler->display->display_options['path'] = 'admin/tripal/vocab/cvs';
   $handler->display->display_options['menu']['type'] = 'default tab';
   $handler->display->display_options['menu']['title'] = 'Vocabularies';
   $handler->display->display_options['menu']['description'] = 'A listing of all controlled vocabularies';
@@ -292,7 +292,7 @@ function tripal_cv_defaultview_admin_cvterms_listing() {
   $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
   $handler->display->display_options['header']['action_links_area']['link-1'] = array(
     'label-1' => 'Add Term',
-    'path-1' => 'admin/tripal/chado/tripal_cv/cvterm/add',
+    'path-1' => 'admin/tripal/vocab/cvterm/add',
   );
   /* No results behavior: Global: Text area */
   $handler->display->display_options['empty']['text']['id'] = 'area';
@@ -312,7 +312,7 @@ function tripal_cv_defaultview_admin_cvterms_listing() {
   $handler->display->display_options['fields']['name_1']['field'] = 'name';
   $handler->display->display_options['fields']['name_1']['label'] = 'Vocabulary';
   $handler->display->display_options['fields']['name_1']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['name_1']['alter']['path'] = 'admin/tripal/chado/tripal_cv/cvs?name=[name_1]';
+  $handler->display->display_options['fields']['name_1']['alter']['path'] = 'admin/tripal/vocab/cvs?name=[name_1]';
   /* Field: Chado Cvterm: Cvterm Id */
   $handler->display->display_options['fields']['cvterm_id']['id'] = 'cvterm_id';
   $handler->display->display_options['fields']['cvterm_id']['table'] = 'cvterm';
@@ -361,7 +361,7 @@ function tripal_cv_defaultview_admin_cvterms_listing() {
   $handler->display->display_options['fields']['nothing']['exclude'] = TRUE;
   $handler->display->display_options['fields']['nothing']['alter']['text'] = 'edit';
   $handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
-  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/chado/tripal_cv/cv/[cv_id]/cvterm/edit/[cvterm_id]';
+  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/vocab/cv/[cv_id]/cvterm/edit/[cvterm_id]';
   /* Field: Global: Custom text */
   $handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
   $handler->display->display_options['fields']['nothing_1']['table'] = 'views';
@@ -440,7 +440,7 @@ function tripal_cv_defaultview_admin_cvterms_listing() {
 
   /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_cv/cvterms';
+  $handler->display->display_options['path'] = 'admin/tripal/vocab/cvterms';
   $handler->display->display_options['menu']['type'] = 'tab';
   $handler->display->display_options['menu']['title'] = 'Terms';
   $handler->display->display_options['menu']['description'] = 'A listing of a controlled vocabulary terms for a given vocabulary';

+ 161 - 6
tripal_entities/includes/TripalBundleUIController.inc

@@ -18,14 +18,17 @@ class TripalBundleUIController extends EntityDefaultUIController {
    */
   public function hook_menu() {
     $items = parent::hook_menu();
+    
+    // Alter the Admin > Structure > Tripal Content Types menu item.
     $items[$this->path]['description'] = 'Manage biological content types that are
       added using Tripal.';
 
     // We don't want to let the user import new Tripal data types.
     unset($items[$this->path . '/import']);
 
+    // Add an action link to Admin > Structure > Tripal Content Types for adding types.
     $items[$this->path . '/add'] = array(
-      'title' => 'Add new tripal content type',
+      'title' => 'Add Tripal Content Type',
       'description' => 'Add new biological content',
       'page callback' => 'drupal_get_form',
       'page arguments' => array('tripal_entities_admin_add_type_form'),
@@ -35,6 +38,7 @@ class TripalBundleUIController extends EntityDefaultUIController {
       'type' => MENU_LOCAL_ACTION,
       'weight' => 2
     );
+    
     return $items;
   }
 
@@ -54,22 +58,173 @@ class TripalBundleUIController extends EntityDefaultUIController {
 
     return $forms;
   }
+  
 }
+
 /**
+ * Tripal content type edit form.
  *
  * @param $form
+ *    The default form array. Usually empty.
  * @param $form_state
- * @param $entity
+ *    Build information for the form including the entity type and submitted values.
+ * @param $entityDataType
+ *    A string indicating the entity type. This will always be TripalBundle.
  */
 function tripal_entities_tripal_bundle_form($form, &$form_state, $entityDataType) {
-  $form = array();
-  $form['message'] = array(
+
+  $entity_type = $form_state['build_info']['args'][0];
+  $chado_basetable = $entity_type->label;
+  $cvterm = chado_generate_var('cvterm', array('name' => $entity_type->label));
+  
+  // Add a validate and submit handler to save the data in this form.
+  $form['#validate'] = array('tripal_entities_tripal_bundle_form_validate');
+  $form['#submit'] = array('tripal_entities_tripal_bundle_form_submit');
+  
+  // @TODO: Move this into a css file.
+  $form['#attached']['css'] = array(
+    array(
+      'data' => '.form-item select, .form-item input { width:40%; }',
+      'type' => 'inline',
+    ),
+  );
+
+  //dpm($form_state, 'form state');
+  //dpm($entity_type, 'entity type');
+  //dpm($cvterm, 'cvterm');
+  
+  $form['vocab'] = array(
+    '#type' => 'select',
+    '#title' => t('Vocabulary'),
+    '#options' => array($cvterm->cv_id->name),
+    '#description' => t('The vocabulary the following term is part of.'),
+    '#default_value' => $cvterm->cv_id->name,
+    '#disabled' => TRUE  
+  );
+  
+  $form['term'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Term'),
+    '#description' => t('The term the content type is based on.'),
+    '#default_value' => $cvterm->name,
+    '#disabled' => TRUE  
+  );
+  
+  $form['additional_settings'] = array(
+    '#type' => 'vertical_tabs',
+    '#weight' => 99,
+  );
+  
+  // Set Title Format.
+  //-------------------------
+  $title_format = chado_node_get_unique_constraint_format($chado_basetable);
+  
+  $form['set_titles'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Page Title options'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+    '#tree' => TRUE,
+    '#group' => 'additional_settings',
+  );
+  
+  $form['set_titles']['explanation'] = array(
+    '#type' => 'item',
+    '#markup' => t('<p>The format below is used to determine the title displayed on content 
+      pages. This ensures all content of this type is consistent while still allowing you 
+      to indicate which data you want represented in the title (ie: which data would most 
+      identify your content).</p>
+      <p>Keep in mind that it might be confusing to users if more than
+      one page has the same title. We recommend you <strong>choose a combination of tokens that
+      will uniquely identify your content</strong>.</p>'),
+  );
+
+  $form['set_titles']['title_format'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Page Title Format'),
+    '#description' => t('You may rearrange elements in this text box to customize the page
+      titles. The available tokens are listed below. You can separate or include any text
+      between the tokens.'),
+    '#default_value' => $title_format,
+    '#rows' => 1
+  );
+
+  $form['set_titles']['token_display'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Available Tokens'),
+    '#description' => t('Copy the token and paste it into the "Custom Page Title" text field above.'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE
+  );
+
+  $tokens = array();
+  if (empty($tokens)) {
+    $tokens = chado_node_generate_tokens($chado_basetable);
+  }
+  $form['set_titles']['tokens'] = array(
+    '#type' => 'hidden',
+    '#value' => serialize($tokens)
+  );
+  
+  $token_list = chado_node_format_tokens($tokens);
+  $form['set_titles']['token_display']['content'] = array(
     '#type' => 'item',
-    '#markup' => 'Edit the function "tripal_entities_tripal_bundle_form()" ' .
-      'to add a form each type. Put access controls here?',
+    '#markup' => $token_list
   );
+
+  // Submit Buttons
+  //-------------------------
+  
+  $form['save'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save Content Type'),
+    '#weight' => 100
+  );
+  
+  $form['delete'] = array(
+    '#type' => 'submit',
+    '#value' => t('Delete Content Type'),
+    '#weight' => 101
+  );
+
   return $form;
 }
+
+/**
+ * Validate: Tripal content type edit form.
+ */
+function tripal_entities_tripal_bundle_form_validate($form, $form_state) {
+
+  $tokens_available = unserialize($form_state['values']['set_titles']['tokens']);
+  if (preg_match_all('/(\[\w+\.\w+\])/', $form_state['values']['set_titles']['title_format'], $matches)) {
+    
+    // The matches of the first and only pattern will be our tokens.
+    $tokens_used = $matches[1];
+    // Determine if any of the tokens used were not in the original list of available tokens.
+    $tokens_missing = array_diff($tokens_used, array_keys($tokens_available));
+    
+    if ($tokens_missing) {
+      $msg = t('You must only use tokens listed under available tokens. You used the following incorrect tokens: %tokens',
+        array('%tokens' => implode(', ', $tokens_missing)));
+      form_set_error('set_titles][title_format', $msg);
+    }
+    
+  }
+  else {
+    $msg = t('You should use at least one token in your title format or the title for all %type pages will be the same.',
+      array('%type' => $form_state['build_info']['args'][0]->label));
+    form_set_error('set_titles][title_format', $msg);
+  }
+}
+
+/**
+ * Submit: Tripal content type edit form.
+ */
+function tripal_entities_tripal_bundle_form_submit($form, $form_state) {
+
+  //dpm($form_state, 'form state in submit');
+}
+
 /**
  * Access callback for the entity API.
  */

+ 1 - 0
tripal_entities/includes/TripalEntityUIController.inc

@@ -24,6 +24,7 @@ class TripalEntityUIController extends EntityDefaultUIController {
       'file path' => drupal_get_path('module', 'tripal_entities'),
       'access arguments' => array('administer tripal data'),
       'type' => MENU_LOCAL_TASK,
+      'weight' => -9
     );
 
     $items['bio-data/add'] = array(

+ 1 - 1
tripal_entities/includes/tripal_entities.admin.inc

@@ -156,7 +156,7 @@ function tripal_entities_admin_add_type_form($form, &$form_state) {
           Sequence Ontology (SO)."),
       '#required'    => TRUE,
       '#default_value' => $term_name,
-      '#autocomplete_path' => "admin/tripal/chado/tripal_cv/cvterm/auto_name/$cv_id",
+      '#autocomplete_path' => "admin/tripal/vocab/cvterm/auto_name/$cv_id",
     );
   }
   else {

+ 11 - 11
tripal_entities/tripal_entities.module

@@ -95,24 +95,24 @@ function tripal_entities_shortcut_default_set($account) {
     $shortcut_set = new stdClass();
     $shortcut_set->title = $t('TripalDefault');
     $shortcut_set->links = array(
-      array(
-        'link_path' => 'bio-data/add',
-        'link_title' => 'Add Tripal Content',
-        'weight' => -23,
-      ),
-      array(
-        'link_path' => 'admin/content/bio-data',
-        'link_title' => 'Find Tripal Content',
-        'weight' => -22,
-      ),
       array(
         'link_path' => 'node/add',
         'link_title' => $t('Add content'),
-        'weight' => -21,
+        'weight' => -35,
+      ),
+      array(
+        'link_path' => 'bio-data/add',
+        'link_title' => 'Add Tripal Content',
+        'weight' => -30,
       ),
       array(
         'link_path' => 'admin/content',
         'link_title' => $t('Find content'),
+        'weight' => -25,
+      ),
+      array(
+        'link_path' => 'admin/content/bio-data',
+        'link_title' => 'Find Tripal Content',
         'weight' => -20,
       ),
     );

+ 1 - 1
tripal_views/tripal_views.module

@@ -46,7 +46,7 @@ function tripal_views_menu() {
     'page callback' => 'tripal_views_admin_integration_view',
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_NORMAL_ITEM,
-    'weight' => 2
+    'weight' => 10
   );
 
   /**