Browse Source

Fixed several bugs during new install test

Stephen Ficklin 11 years ago
parent
commit
b41993b80f

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

@@ -388,7 +388,7 @@ function tripal_core_chado_delete($table, $match, $options = NULL) {
   );
 
   //New API Function
-  return chado_delete_record();
+  return chado_delete_record($table, $match, $options);
 }
 
 /**

+ 1 - 1
tripal_cv/api/tripal_cv.DEPRECATED.inc

@@ -352,7 +352,7 @@ function tripal_cv_add_obo_ref($name, $path) {
     )
   );
 
-  return tripal_insert_obo($name, $ref);
+  return tripal_insert_obo($name, $path);
 }
 
 /**

+ 4 - 4
tripal_cv/tripal_cv.module

@@ -76,8 +76,8 @@ function tripal_cv_menu() {
 
   // The OBO loader will be available in two places
   $items['admin/tripal/chado/tripal_cv/obo_loader'] = array(
-    'title' => 'Load Ontology',
-    'description' => 'Load an Ontology into chado as a controlled vocabulary.',
+    'title' => 'OBO File Loader',
+    'description' => 'Load an ontology in OBO format chado as a controlled vocabulary.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_cv_obo_form'),
     'access arguments' => array('administer controlled vocabularies'),
@@ -85,8 +85,8 @@ function tripal_cv_menu() {
   );
 
   $items['admin/tripal/loaders/obo_loader'] = array(
-    'title' => 'Load Ontology',
-    'description' => 'Load an Ontology into chado as a controlled vocabulary.',
+    'title' => 'OBO File Loader',
+    'description' => 'Load an ontology in OBO format into chado as a controlled vocabulary.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_cv_obo_form'),
     'access arguments' => array('administer controlled vocabularies'),

+ 17 - 68
tripal_feature/includes/tripal_feature.admin.inc

@@ -55,11 +55,11 @@ function tripal_feature_admin() {
   );
   $form['title']['desc'] = array(
     '#markup' => t(
-      'Each synced feature must have a unique page title, however, features
-       may have the same name if they are of different types or from
-       different organisms.  Therefore, we must be sure that the
-       page titles can uniquely identify the feature being viewed.  Select
-       an option below that will uniquely identify all features on your site.'),
+      'Each synced feature must have a unique page title, however, features '.
+      'may have the same name if they are of different types or from '.
+      'different organisms.  Therefore, we must be sure that the '.
+      'page titles can uniquely identify the feature being viewed.  Select '.
+      'an option below that will uniquely identify all features on your site.'),
   );
   $options = array(
     'feature_unique_name'  => 'Feature unique name',
@@ -69,10 +69,10 @@ function tripal_feature_admin() {
   $form['title']['chado_feature_title'] = array(
     '#title'         => t('Feature Page Titles'),
     '#type'          => 'radios',
-    '#description'   => t('Choose a title type  from the list above that is
-      guaranteed to be unique for all features.  If in doubt it is safest to
-      choose the last option as that guarantees uniqueness. Click the
-      \'Save Configuration\' button at the bottom to save your selection.'),
+    '#description'   => t('Choose a title type  from the list above that is '.
+      'guaranteed to be unique for all features.  If in doubt it is safest to '.
+      'choose the last option as that guarantees uniqueness. Click the '.
+      '\'Save Configuration\' button at the bottom to save your selection.'),
     '#required'      => FALSE,
     '#options'       => $options,
     '#default_value' => variable_get('chado_feature_title', 'unique_constraint'),
@@ -100,14 +100,14 @@ function tripal_feature_admin() {
   $form['url']['chado_feature_url_string'] = array(
     '#title' => 'URL Syntax',
     '#type' => 'textfield',
-    '#description' => t('You may rearrange elements in this text box to
-    customize the URLs.  The available tags include: [id],
-    [uniquename]. [name], [species], [genus], [type]. You can separate or
-    include any text between the tags. Click the "Set Feature URLs" button to
-    reset the URLs for all feature pages.  Click the "Save Configuration" button to
-    simply save this setup. <b>Important</b>: be sure that whatever you choose will always be unique even considering
-    future data that may be added.  If you include the Chado table name, genus, species, type
-    and uniquename you are guaranteed to have a unique URL. For example feature/[genus]/[species]/[type]/[uniquename]'),
+    '#description' => t('You may rearrange elements in this text box to '.
+      'customize the URLs.  The available tags include: [id], '.
+      '[uniquename]. [name], [species], [genus], [type]. You can separate or '.
+      'include any text between the tags. Click the "Set Feature URLs" button to '.
+      'reset the URLs for all feature pages.  Click the "Save Configuration" button to '.
+      'simply save this setup. <b>Important</b>: be sure that whatever you choose will always be unique even considering '.
+      'future data that may be added.  If you include the Chado table name, genus, species, type '.
+      'and uniquename you are guaranteed to have a unique URL. For example feature/[genus]/[species]/[type]/[uniquename]'), 
     '#size' => 150,
     '#default_value' => variable_get('chado_feature_url_string', '/feature/[genus]/[species]/[type]/[uniquename]'),
   );
@@ -146,12 +146,6 @@ function tripal_feature_admin() {
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
   );
-  $allowedoptions1  = array(
-    'show_feature_browser' => "Show the feature browser on the organism page. The browser loads when page loads. This may be slow for large sites.",
-    'hide_feature_browser' => "Hide the feature browser on the organism page. Disables the feature browser completely.",
-  );
-//      $allowedoptions ['allow_feature_browser'] = "Allow loading of the feature browsing through AJAX. For large sites the initial page load will be quick with the feature browser loading afterwards.";
-
   $form['browser']['browser_desc'] = array(
      '#markup' => t('A feature browser can be added to an organism page to allow users to quickly ' .
         'access a feature.  This will most likely not be the ideal mechanism for accessing feature ' .
@@ -168,33 +162,6 @@ function tripal_feature_admin() {
   );
 
 
-  $form['browser']['browse_features'] = array(
-     '#title' => 'Feature Browser on Organism Page',
-     '#type' => 'radios',
-     '#options' => $allowedoptions1,
-     '#default_value' => variable_get('tripal_feature_browse_setting', 'show_feature_browser'),
-  );
-
-  $form['browser']['browse_features_library'] = array(
-    '#title' => 'Feature Browser on Library Page',
-    '#type' => 'radios',
-    '#options' => array(
-      'show_feature_browser' => "Show the feature browse on the library page. The browser loads when page loads. This may be slow for large sites.",
-      'hide_feature_browser' => "Hide the feature browser on the library page. Disables the feature browser completely.",
-    ),
-    '#default_value' => variable_get('tripal_library_feature_browse_setting', 'show_feature_browser'),
-  );
-
-  $form['browser']['browse_features_analysis'] = array(
-    '#title' => 'Feature Browser on Analysis Page',
-    '#type' => 'radios',
-    '#options' => array(
-      'show_feature_browser' => "Show the feature browse on the analysis page. The browser loads when page loads. This may be slow for large sites.",
-      'hide_feature_browser' => "Hide the feature browser on the analysis page. Disables the feature browser completely.",
-    ),
-   '#default_value' => variable_get('tripal_analysis_feature_browse_setting', 'show_feature_browser'),
-  );
-
   $form['browser']['set_browse_button'] = array(
      '#type' => 'submit',
      '#value' => t('Set Browser'),
@@ -208,17 +175,6 @@ function tripal_feature_admin() {
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
   );
-  $allowedoptions2 ['show_feature_summary'] = "Show the feature summary on the organism page. The summary loads when page loads.";
-  $allowedoptions2 ['hide_feature_summary'] = "Hide the feature summary on the organism page. Disables the feature summary.";
-
-  $form['summary']['feature_summary'] = array(
-     '#title' => 'Feature Summary on Organism Page',
-     '#description' => 'A feature summary can be added to an organism page to allow users to see the ' .
-        'type and quantity of features available for the organism.',
-     '#type' => 'radios',
-     '#options' => $allowedoptions2,
-     '#default_value' => variable_get('tripal_feature_summary_setting', 'show_feature_summary'),
-  );
   $form['summary']['feature_mapping'] = array(
      '#title' => 'Map feature types',
      '#description' => t('You may specify which Sequence Ontology (SO) terms to show in the ' .
@@ -252,14 +208,7 @@ function tripal_feature_admin_validate($form, &$form_state) {
 
   switch ($form_state['values']['op']) {
 
-    case t('Set Browser') :
-      variable_set('tripal_feature_browse_setting', $form_state['values']['browse_features']);
-      variable_set('tripal_library_feature_browse_setting', $form_state['values']['browse_features_library']);
-      variable_set('tripal_analysis_feature_browse_setting', $form_state['values']['browse_features_analysis']);
-      break;
-
     case t('Set Summary') :
-      variable_set('tripal_feature_summary_setting', $form_state['values']['feature_summary']);
       variable_set('tripal_feature_summary_report_mapping', $form_state['values']['feature_mapping']);
       break;
 

+ 2 - 2
tripal_feature/includes/tripal_feature.chado_node.inc

@@ -730,7 +730,7 @@ function tripal_feature_node_presave($node) {
         $uname       = $node->feature->uniquename;
         $type_id     = $node->feature->type_id;
         $values = array('cvterm_id' => $type_id);
-        $ftype = chado_select_record('cv', array('name'), $values);
+        $ftype = chado_select_record('cvterm', array('name'), $values);
         $type = $ftype[0]->name;
       }
 
@@ -937,7 +937,7 @@ function tripal_feature_node_view($node, $view_mode, $langcode) {
         $node->content['tripal_organism_feature_counts'] = array(
           '#markup' => theme('tripal_organism_feature_counts', array('node' => $node)),
           '#tripal_toc_id'    => 'feature_counts',
-          '#tripal_toc_title' => 'Data Type Summary',
+          '#tripal_toc_title' => 'Feature Summary',
         );
         $node->content['tripal_organism_feature_browser'] = array(
           '#markup' => theme('tripal_organism_feature_browser', array('node' => $node)),

+ 90 - 101
tripal_feature/theme/tripal_organism/tripal_organism_feature_browser.tpl.php

@@ -2,14 +2,6 @@
 
 $organism = $variables['node']->organism;
 
-// don't show the browser if the settings in the admin page is turned off
-// instead return the array indicating the status of the browser
-$enabled = 1;
-$show_browser = variable_get('tripal_feature_browse_setting', 'show_feature_browser');
-if (strcmp($show_browser, 'show_feature_browser') !=0 ) {
-  $enabled = 0;
-}
-
 // get the list of available sequence ontology terms for which
 // we will build drupal pages from features in chado.  If a feature
 // is not one of the specified typse we won't build a node for it.
@@ -54,101 +46,98 @@ foreach ($results as $result) {
   $features[] = tripal_core_generate_chado_var('feature', $values, $options);
 }
 
-// only show this block if it is enabled
-if ($enabled) { 
-  if (count($features) > 0) { ?>
-    <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors.  Use the searching mechanism to find specific features.</div> <?php
-    
-    // the $headers array is an array of fields to use as the colum headers.
-    // additional documentation can be found here
-    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
-    $headers = array('Feature Name' ,'Unique Name', 'Type');
-    
-    // the $rows array contains an array of rows where each row is an array
-    // of values for each column of the table in that row.  Additional documentation
-    // can be found here:
-    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
-    $rows = array();
-    
-    // let admins know they can customize the terms that appear in the list
-    print tripal_set_message("Administrators, you can specify the feature types ".
-      "that should appear in this browser or remove it from the list of resources ".
-      "by navigating to the ".
-      l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank'))),
-      TRIPAL_INFO,
-      array('return_html' => 1));
-    
-    foreach ($features as $feature){
-      $fname =  $feature->name;
-      if (property_exists($feature, 'nid')) {
-        $fname =   l($fname, "node/$feature->nid", array('attributes' => array('target' => '_blank')));
-      }
-      $rows[] = array(
-        $fname,
-        $feature->uniquename,
-        $feature->type_id->name
-      );
-    } 
-    // the $table array contains the headers and rows array as well as other
-    // options for controlling the display of the table.  Additional
-    // documentation can be found here:
-    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
-    $table = array(
-      'header' => $headers,
-      'rows' => $rows,
-      'attributes' => array(
-        'id' => 'tripal_organism-table-features',
-      ),
-      'sticky' => FALSE,
-      'caption' => '',
-      'colgroups' => array(),
-      'empty' => '',
-    );
-    // once we have our table array structure defined, we call Drupal's theme_table()
-    // function to generate the table.
-    print theme_table($table);
-    
-    // the $pager array values that control the behavior of the pager.  For 
-    // documentation on the values allows in this array see:
-    // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
-    // here we add the paramter 'block' => 'feature_browser'. This is because
-    // the pager is not on the default block that appears. When the user clicks a
-    // page number we want the browser to re-appear with the page is loaded.
-    $pager = array(
-      'tags' => array(),
-      'element' => $element,
-      'parameters' => array(
-        'block' => 'feature_browser'
-      ),
-      'quantity' => $num_per_page,
+if (count($features) > 0) { ?>
+  <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following browser provides a quick view for new visitors.  Use the searching mechanism to find specific features.</div> <?php
+  
+  // the $headers array is an array of fields to use as the colum headers.
+  // additional documentation can be found here
+  // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+  $headers = array('Feature Name' ,'Unique Name', 'Type');
+  
+  // the $rows array contains an array of rows where each row is an array
+  // of values for each column of the table in that row.  Additional documentation
+  // can be found here:
+  // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+  $rows = array();
+  
+  // let admins know they can customize the terms that appear in the list
+  print tripal_set_message("Administrators, you can specify the feature types ".
+    "that should appear in this browser or remove it from the list of resources ".
+    "by navigating to the ".
+    l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank'))),
+    TRIPAL_INFO,
+    array('return_html' => 1));
+  
+  foreach ($features as $feature){
+    $fname =  $feature->name;
+    if (property_exists($feature, 'nid')) {
+      $fname =   l($fname, "node/$feature->nid", array('attributes' => array('target' => '_blank')));
+    }
+    $rows[] = array(
+      $fname,
+      $feature->uniquename,
+      $feature->type_id->name
     );
-    print theme_pager($pager); 
   } 
-  else {  ?>
-    <p>There are no results.</p><?php
-    print tripal_set_message("
-      Administrators, perform the following to show features in this browser:
-      <ul>
-        <li>Load features for this organism using the " .
-          l("FASTA loader", 'admin/tripal/loaders/fasta_loader') . ",  ".
-          l("GFF Loader",   'admin/tripal/loaders/gff3_load') . " or ".
-          l("Bulk Loader",  'admin/tripal/loaders/bulk'). "</li>
-        <li>Sync the features that should have pages using the ".
-          l("Sync features page", 'admin/tripal/chado/tripal_feature/sync'). "</li>
-        <li>Return to this page to browse features.</li>
-        <li>Ensure the user " .
-         l("has permission", 'admin/people/permissions') . " to view the feature content</li>
-      </ul>
-      <br>
-      <br>
-      You can specify the feature types
-      that should appear in this browser or remove it from the list of resources by navigating to the " . 
-      l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank')))  . "
-      </p>
-      The feature browser will not appear to site visitors unless features are present. ",
-      TRIPAL_INFO,
-      array('return_html' => 1));
-  }
+  // the $table array contains the headers and rows array as well as other
+  // options for controlling the display of the table.  Additional
+  // documentation can be found here:
+  // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+  $table = array(
+    'header' => $headers,
+    'rows' => $rows,
+    'attributes' => array(
+      'id' => 'tripal_organism-table-features',
+    ),
+    'sticky' => FALSE,
+    'caption' => '',
+    'colgroups' => array(),
+    'empty' => '',
+  );
+  // once we have our table array structure defined, we call Drupal's theme_table()
+  // function to generate the table.
+  print theme_table($table);
+  
+  // the $pager array values that control the behavior of the pager.  For 
+  // documentation on the values allows in this array see:
+  // https://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager/7
+  // here we add the paramter 'block' => 'feature_browser'. This is because
+  // the pager is not on the default block that appears. When the user clicks a
+  // page number we want the browser to re-appear with the page is loaded.
+  $pager = array(
+    'tags' => array(),
+    'element' => $element,
+    'parameters' => array(
+      'block' => 'feature_browser'
+    ),
+    'quantity' => $num_per_page,
+  );
+  print theme_pager($pager); 
+} 
+else {  ?>
+  <p>There are no results.</p><?php
+  print tripal_set_message("
+    Administrators, perform the following to show features in this browser:
+    <ul>
+      <li>Load features for this organism using the " .
+        l("FASTA loader", 'admin/tripal/loaders/fasta_loader') . ",  ".
+        l("GFF Loader",   'admin/tripal/loaders/gff3_load') . " or ".
+        l("Bulk Loader",  'admin/tripal/loaders/bulk'). "</li>
+      <li>Sync the features that should have pages using the ".
+        l("Sync features page", 'admin/tripal/chado/tripal_feature/sync'). "</li>
+      <li>Return to this page to browse features.</li>
+      <li>Ensure the user " .
+       l("has permission", 'admin/people/permissions') . " to view the feature content</li>
+    </ul>
+    <br>
+    <br>
+    You can specify the feature types
+    that should appear in this browser or remove it from the list of resources by navigating to the " . 
+    l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank')))  . "
+    </p>
+    The feature browser will not appear to site visitors unless features are present. ",
+    TRIPAL_INFO,
+    array('return_html' => 1));
 }
 
 

+ 53 - 82
tripal_feature/theme/tripal_organism/tripal_organism_feature_counts.tpl.php

@@ -7,93 +7,64 @@ $types = array();
 if(property_exists($organism, 'feature_counts')) {
   $types    = $organism->feature_counts['types'];
   $names    = $organism->feature_counts['names'];
-  $enabled  = $organism->feature_counts['enabled'];
 }
 
-// only show this block if it is enabled
-if ($enabled) { 
-  if (count($types) > 0){ ?>
-    <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following data types are currently present for this organism</div> <?php
-    
-    // let admins know they can customize the terms that appear in the list
-    print tripal_set_message("
-      Administrators, you can customize the types of terms that appear in this report by navigating to the " . 
-      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'))) . " 
-      materialized view.",
-      TRIPAL_INFO,
-      array('return_html' => 1)
-    ); 
-    
-    // the $headers array is an array of fields to use as the colum headers.
-    // additional documentation can be found here
-    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
-    $headers = array('Feature Type' ,'Count');
-    
-    // the $rows array contains an array of rows where each row is an array
-    // of values for each column of the table in that row.  Additional documentation
-    // can be found here:
-    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
-    $rows = array();
+
+if (count($types) > 0){ ?>
+  <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following features are currently present for this organism</div> <?php
+  
+  // let admins know they can customize the terms that appear in the list
+  print tripal_set_message("
+    Administrators, you can customize the types of terms that appear in this report by navigating to the " . 
+    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'))) . " 
+    materialized view.",
+    TRIPAL_INFO,
+    array('return_html' => 1)
+  ); 
+  
+  // the $headers array is an array of fields to use as the colum headers.
+  // additional documentation can be found here
+  // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+  $headers = array('Feature Type' ,'Count');
+  
+  // the $rows array contains an array of rows where each row is an array
+  // of values for each column of the table in that row.  Additional documentation
+  // can be found here:
+  // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+  $rows = array();
+  
+  for ($j = 0; $j < count($types); $j++) {
+    $type = $types[$j];
+    $name = $names[$j];
     
-    for ($j = 0; $j < count($types); $j++) {
-      $type = $types[$j];
-      $name = $names[$j];
-      
-      $rows[] = array(
-        "<span title=\"" . $type->definition . "\">$name</span>",
-        number_format($type->num_features),
-      );
-    } 
-    // the $table array contains the headers and rows array as well as other
-    // options for controlling the display of the table.  Additional
-    // documentation can be found here:
-    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
-    $table = array(
-      'header' => $headers,
-      'rows' => $rows,
-      'attributes' => array(
-        'id' => 'tripal_organism-table-features',
-      ),
-      'sticky' => FALSE,
-      'caption' => '',
-      'colgroups' => array(),
-      'empty' => '',
+    $rows[] = array(
+      "<span title=\"" . $type->definition . "\">$name</span>",
+      number_format($type->num_features),
     );
-    // once we have our table array structure defined, we call Drupal's theme_table()
-    // function to generate the table.
-    print theme_table($table);
-    
-    ?>
-
-    <img class="tripal_cv_chart" id="tripal_feature_cv_chart_<?php print $organism->organism_id?>" src="" border="0"><?php 
-   } 
-   else { 
-    if (user_access('administer tripal')) { ?>
-      <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following data types are currently present for this organism</div> <?php 
-      print tripal_set_message("
-         Administrators, to view the feature type report:
-         <ul>
-            <li>Populate the " . 
-                l('organism_feature_count', 'admin/tripal/schema/mviews', array('attributes' => array('target' => '_blank'))) ." 
-                materialized view</li>
-            <li>Refresh this page</li>
-         </ul> 
-         To disable this report and remove it from the list of resources:
-         <ul>
-           <li>Navigate to the " . 
-               l('Tripal feature configuration page', 'admin/tripal/chado/tripal_feature/configuration', array('attributes' => array('target' => '_blank'))) ." 
-               and hide the \"Feature Summary\"</li>
-          </ul>
-         </p>",
-         TRIPAL_INFO,
-         array('return_html' => 1)
-      );              
-    }
-  }
+  } 
+  // the $table array contains the headers and rows array as well as other
+  // options for controlling the display of the table.  Additional
+  // documentation can be found here:
+  // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+  $table = array(
+    'header' => $headers,
+    'rows' => $rows,
+    'attributes' => array(
+      'id' => 'tripal_organism-table-features',
+    ),
+    'sticky' => FALSE,
+    'caption' => '',
+    'colgroups' => array(),
+    'empty' => '',
+  );
+  // once we have our table array structure defined, we call Drupal's theme_table()
+  // function to generate the table.
+  print theme_table($table);
 } 
 
 
 
+

+ 17 - 19
tripal_feature/tripal_feature.module

@@ -707,15 +707,9 @@ function tripal_feature_get_matched_alignments($feature) {
  */
 function tripal_feature_load_organism_feature_counts($organism) {
 
-  // don't show the browser if the settings in the admin page is turned off
-  // instead return the array indicating the status of the browser
-  $show_counts = variable_get('tripal_feature_summary_setting', 'show_feature_summary');
-  if (strcmp($show_counts, 'show_feature_summary')!=0) {
-    return array('enabled' => FALSE );
-  }
   $args = array();
-  $names = array();
   $order = array();
+  $names = array();
 
   // build the where clause for the SQL statement if we have a custom term list
   // we'll also keep track of the names the admin provided (if any) and the
@@ -727,25 +721,26 @@ function tripal_feature_load_organism_feature_counts($organism) {
     $is_custom = 1;
     $temp = explode("\n", $temp);
     $i = 0;
-    foreach ($temp as $key => $value) {
+    foreach ($temp as $value) {
       // separate the key value pairs
       $temp2 = explode("=", $value);
       $feature_type = rtrim($temp2[0]);
-      $args[] = $feature_type;
-      $order[] = $feature_type;
-      // if a new name is provided then use that otherwise just
-      // use the feature type
-      if (count($temp2) == 2) {
-        $names[":name$i"] = rtrim($temp2[1]);
+      $order[] = $feature_type;  // save the order of the these terms
+      $where .= " OFC.feature_type = :name$i OR ";
+      $args[":name$i"] = rtrim($temp2[0]);
+      
+      // if the admin specified a new name then store that otherwise use the
+      // the default sequence ontology term name
+      if(count($temp2) == 2) {
+        $names[] = rtrim($temp2[1]);
       }
       else {
-        $names[":name$i"] = $feature_type;
+        $names[] = $feature_type;
       }
-      $where .= " OFC.feature_type = :name$i OR ";
       $i++;
     }
     if ($where) {
-      $where = drupal_substr($where, 0, -5);  # remove OR from the end
+      $where = drupal_substr($where, 0, -4);  # remove OR from the end
       $where = "($where) AND";
     }
   }
@@ -774,12 +769,15 @@ function tripal_feature_load_organism_feature_counts($organism) {
     }
   }
 
-  # now reorder the types
+  // now reorder the types
   $ordered_types = array();
   foreach ($order as $type) {
     $ordered_types[] = $types[$type];
   }
-  return array( 'types' => $ordered_types, 'names' => $names, 'enabled' => TRUE );
+  return array( 
+    'types' => $ordered_types, 
+    'names' => $names
+  );
 }
 
 /**