Browse Source

Removed hard-coded Chado prefix to chado table integration

Lacey Sanderson 12 years ago
parent
commit
e039cf28fe
2 changed files with 6 additions and 9 deletions
  1. 1 1
      tripal_views/tripal_views.api.inc
  2. 5 8
      tripal_views/tripal_views.views.inc

+ 1 - 1
tripal_views/tripal_views.api.inc

@@ -380,7 +380,7 @@ function tripal_views_get_integration_array_for_chado_table($table_name, $base_t
   $defn_array = array(
   $defn_array = array(
     'table' => $table_name,
     'table' => $table_name,
     'type' => 'chado',
     'type' => 'chado',
-    'name' => ucwords(str_replace('_', ' ', $table_name)),
+    'name' => 'Chado ' . ucwords(str_replace('_', ' ', $table_name)),
     'description' => (!empty($schema['description'])) ? $schema['description'] : ' ',
     'description' => (!empty($schema['description'])) ? $schema['description'] : ' ',
     'priority' => 10,
     'priority' => 10,
     'base_table' => $base_table,
     'base_table' => $base_table,

+ 5 - 8
tripal_views/tripal_views.views.inc

@@ -444,7 +444,6 @@ function tripal_views_views_data() {
     // holds the base table name and fields
     // holds the base table name and fields
     $base_table = '';
     $base_table = '';
     $base_fields = array();
     $base_fields = array();
-    $type_prefix = '';
 
 
     // indicated whether the current table is a base table or not
     // indicated whether the current table is a base table or not
     $is_base_table = $tvi_row->base_table;
     $is_base_table = $tvi_row->base_table;
@@ -452,7 +451,6 @@ function tripal_views_views_data() {
     // populate the base table name and fields.  If an $mview_id is given
     // populate the base table name and fields.  If an $mview_id is given
     // then get the materialized view info, otherwise get the Chado table info
     // then get the materialized view info, otherwise get the Chado table info
     if ($mview_id) {
     if ($mview_id) {
-      $type_prefix = 'MView';
 
 
       // get the base table name from the materialized view
       // get the base table name from the materialized view
       $sql = "SELECT name, mv_specs FROM {tripal_mviews} WHERE mview_id = %d";
       $sql = "SELECT name, mv_specs FROM {tripal_mviews} WHERE mview_id = %d";
@@ -482,7 +480,6 @@ function tripal_views_views_data() {
       }
       }
     }
     }
     else {
     else {
-      $type_prefix = 'Chado Table';
       $base_table = $tvi_row->table_name;
       $base_table = $tvi_row->table_name;
 
 
       // The chado table could be a regular Chado table or a custom table
       // The chado table could be a regular Chado table or a custom table
@@ -513,19 +510,19 @@ function tripal_views_views_data() {
     }
     }
 
 
       // Setup the base table info in the data array
       // Setup the base table info in the data array
-      $data[$base_table]['table']['group'] = t("$type_prefix $tvi_row->name");
+      $data[$base_table]['table']['group'] = t("$tvi_row->name");
 
 
       if ($is_base_table) {
       if ($is_base_table) {
         $data[$base_table]['table']['base'] = array(
         $data[$base_table]['table']['base'] = array(
-          'group' => "$type_prefix $tvi_row->name",
-          'title' => "$type_prefix $tvi_row->name",
+          'group' => "$tvi_row->name",
+          'title' => "$tvi_row->name",
           'help'  => $tvi_row->comment,
           'help'  => $tvi_row->comment,
         );
         );
       }
       }
       else {
       else {
         $data[$base_table]['table'] = array(
         $data[$base_table]['table'] = array(
-          'group' => "$type_prefix $tvi_row->name",
-          'title' => "$type_prefix $tvi_row->name",
+          'group' => "$tvi_row->name",
+          'title' => "$tvi_row->name",
           'help'  => $tvi_row->comment,
           'help'  => $tvi_row->comment,
         );
         );
       }
       }