Browse Source

Issue #72: Updating API to include 2.1 improvements: ecfec70

Stephen Ficklin 7 years ago
parent
commit
67a44a1b13

+ 6 - 1
legacy/tripal_feature/theme/templates/tripal_organism_feature_browser.tpl.php

@@ -109,15 +109,20 @@ if (count($so_terms) > 0) {
     // 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.
+    // We remove the 'pane' parameter from the original query parameters because
+    // Drupal won't reset the parameter if it already exists.
+    $get = $_GET;
+    unset($_GET['pane']);
     $pager = array(
       'tags' => array(),
       'element' => $element,
       'parameters' => array(
-        'block' => 'feature_browser'
+        'pane' => 'feature_browser'
       ),
       'quantity' => $num_per_page,
     );
     print theme_pager($pager);
+    $_GET = $get;
 
     print tripal_set_message("
       Administrators, please note that the feature browser will be retired in

+ 24 - 19
legacy/tripal_featuremap/theme/templates/tripal_feature_featurepos.tpl.php

@@ -2,18 +2,18 @@
 
 // expand the feature object to include the records from the featurepos table
 // specify the number of features to show by default and the unique pager ID
-$num_results_per_page = 25; 
+$num_results_per_page = 5;
 $featurepos_pager_id = 20;
 
 // get the maps associated with this feature
 $feature = $variables['node']->feature;
-$options = array(  
+$options = array(
   'return_array' => 1,
   'order_by' => array(
     'map_feature_id' => 'ASC'
   ),
   'pager' => array(
-    'limit' => $num_results_per_page, 
+    'limit' => $num_results_per_page,
     'element' => $featurepos_pager_id
   ),
   'include_fk' => array(
@@ -29,7 +29,7 @@ $options = array(
 
 $feature = chado_expand_var($feature, 'table', 'featurepos', $options);
 
-// because the featurepos table has  FK relationships with map_feature_id and feature_id with the feature table 
+// because the featurepos table has  FK relationships with map_feature_id and feature_id with the feature table
 // the function call above will try to expand both and will create an array of matches for each FK.
 // we only want to show the map that this feature belongs to
 $map_positions = $feature->featurepos->map_feature_id;
@@ -39,20 +39,20 @@ $total_records = chado_pager_get_count($featurepos_pager_id);
 
 
 if(count($map_positions) > 0){ ?>
-  <div class="tripal_feature-data-block-desc tripal-data-block-desc">This feature is contained in the following <?php print number_format($total_records) ?> map(s):</div><?php 
+  <div class="tripal_feature-data-block-desc tripal-data-block-desc">This feature is contained in the following <?php print number_format($total_records) ?> map(s):</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('Map Name', 'Landmark', 'Type', 'Position');
-  
+
   // 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();
 
-  // iterate through our map positions    
+  // iterate through our map positions
   foreach ($map_positions as $position){
     $map_feature = $position->map_feature_id;
 
@@ -61,7 +61,7 @@ if(count($map_positions) > 0){ ?>
     $options = array(
       'return_array' => 1,
       'include_fk' => array(
-        'type_id' => 1,            
+        'type_id' => 1,
       ),
     );
     $position = chado_expand_var($position, 'table', 'featureposprop', $options);
@@ -76,8 +76,8 @@ if(count($map_positions) > 0){ ?>
          if ($property->type_id->name == 'stop') {
            $stop = $property->value;
          }
-      }      
-    }  
+      }
+    }
     if ($start and $stop and $start != $stop) {
       $mappos = "$start-$stop";
     }
@@ -87,20 +87,20 @@ if(count($map_positions) > 0){ ?>
     if ($start and $stop and $start == $stop) {
       $mappos = $start;
     }
-    
+
     // get the map name feature
     $map_name =  $position->featuremap_id->name;
     if (property_exists($position->featuremap_id, 'nid')) {
       $map_name = l($map_name, 'node/' . $position->featuremap_id->nid, array('attributes' => array('target' => '_blank')));
     }
-    
-    
+
+
     // get the landmark
     $landmark = $map_feature->name;
     if (property_exists($map_feature, 'nid')) {
       $landmark =  l($landmark, 'node/' . $map_feature->nid, array('attributes' => array('target' => '_blank')));
     }
-    
+
     $rows[] = array(
       $map_name,
       $landmark,
@@ -127,22 +127,27 @@ if(count($map_positions) > 0){ ?>
 
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
-  print theme_table($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' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $featurepos_pager_id,
     'parameters' => array(
-      'block' => 'featurepos'
+      'pane' => 'featurepos'
     ),
     'quantity' => $num_results_per_page,
   );
-  print theme_pager($pager); 
-}?>
+  print theme_pager($pager);
+  $_GET = $get;
+}
 

+ 27 - 22
legacy/tripal_featuremap/theme/templates/tripal_featuremap_featurepos.tpl.php

@@ -4,15 +4,15 @@ $feature_positions = array();
 
 // expand the featuremap object to include the records from the featurepos table
 // specify the number of features to show by default and the unique pager ID
-$num_results_per_page = 25; 
+$num_results_per_page = 25;
 $featurepos_pager_id = 0;
 
 // get the features aligned on this map
-$options = array(  
+$options = array(
   'return_array' => 1,
   'order_by' => array('map_feature_id' => 'ASC'),
   'pager' => array(
-    'limit' => $num_results_per_page, 
+    'limit' => $num_results_per_page,
     'element' => $featurepos_pager_id
   ),
   'include_fk' => array(
@@ -38,30 +38,30 @@ $total_features = chado_pager_get_count($featurepos_pager_id);
 
 
 if(count($feature_positions) > 0){ ?>
-  <div class="tripal_featuremap-data-block-desc tripal-data-block-desc">This map contains <?php print number_format($total_features) ?> features:</div> <?php 
-  
+  <div class="tripal_featuremap-data-block-desc tripal-data-block-desc">This map contains <?php print number_format($total_features) ?> 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('Landmark', 'Type', 'Organism', 'Feature Name', 'Type', 'Position');
-  
+
   // 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();
-  
+
   foreach ($feature_positions as $position){
     $map_feature = $position->map_feature_id;
-    $feature     = $position->feature_id;  
-    $organism    = $map_feature->organism_id; 
+    $feature     = $position->feature_id;
+    $organism    = $map_feature->organism_id;
 
     // check if there are any values in the featureposprop table for the start and stop
     $mappos = $position->mappos;
     $options = array(
       'return_array' => 1,
       'include_fk' => array(
-        'type_id' => 1,            
+        'type_id' => 1,
       ),
     );
     $position = chado_expand_var($position, 'table', 'featureposprop', $options);
@@ -76,18 +76,18 @@ if(count($feature_positions) > 0){ ?>
          if ($property->type_id->name == 'stop') {
            $stop = $property->value;
          }
-      }      
-    }  
+      }
+    }
     if ($start and $stop and $start != $stop) {
       $mappos = "$start-$stop";
     }
     if ($start and !$stop) {
       $mappos = $start;
-    } 
+    }
     if ($start and $stop and $start == $stop) {
       $mappos = $start;
     }
-    
+
     $mfname = $map_feature->name;
     if (property_exists($map_feature, 'nid')) {
       $mfname =  l($mfname, 'node/' . $map_feature->nid, array('attributes' => array('target' => '_blank')));
@@ -95,18 +95,18 @@ if(count($feature_positions) > 0){ ?>
     $orgname = $organism->genus ." " . $organism->species ." (" . $organism->common_name .")";
     if (property_exists($organism, 'nid')) {
       $orgname = l(
-        "<i>" . $organism->genus . " " . $organism->species . "</i> (" . $organism->common_name .")", 
-        "node/". $organism->nid, 
+        "<i>" . $organism->genus . " " . $organism->species . "</i> (" . $organism->common_name .")",
+        "node/". $organism->nid,
         array('html' => TRUE, 'attributes' => array('target' => '_blank'))
       );
     }
     $organism =  $organism->genus . ' ' . $organism->species;
-    
+
     $fname = $feature->name;
     if (property_exists($feature, 'nid')) {
       $fname = l($fname, 'node/' . $feature->nid, array('attributes' => array('target' => '_blank')));
     }
-      
+
     $rows[] = array(
       $mfname,
       $map_feature->type_id->name,
@@ -115,7 +115,7 @@ if(count($feature_positions) > 0){ ?>
       $feature->type_id->name,
       $mappos . ' ' . $position->featuremap_id->unittype_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:
@@ -132,7 +132,7 @@ if(count($feature_positions) > 0){ ?>
     '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);
@@ -143,14 +143,19 @@ if(count($feature_positions) > 0){ ?>
   // here we add the paramter 'block' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $featurepos_pager_id,
     'parameters' => array(
-      'block' => 'featurepos'
+      'pane' => 'featurepos'
     ),
     'quantity' => $num_results_per_page,
   );
-  print theme_pager($pager); 
+  print theme_pager($pager);
+  $_GET = $get;
 }
 

+ 38 - 33
legacy/tripal_genetic/theme/templates/tripal_feature_genotypes.tpl.php

@@ -1,31 +1,31 @@
 <?php
 /*
  * Details about genotypes associated with features can be found in the following way:
- * 
+ *
  * feature => feature_genotype => genotype
- *   
- * There are two ways that features with genotypes can be associated with stocks.  The first, 
+ *
+ * There are two ways that features with genotypes can be associated with stocks.  The first,
  * more simple method, is by traversion the FK relationships in this manner:
- * 
+ *
  *   Simple Method: feature => feature_genotype => genotype => stock_genotype => stock
- *   
+ *
  * The second method involves use of the natural diversity tables which allows for association
- * or more ancilliary information. Within the Natural Diversity tables, if a feature has genotypes then 
- * you can find the corresponding stock by traversing the FK relationships 
- * in this manner: 
- * 
+ * or more ancilliary information. Within the Natural Diversity tables, if a feature has genotypes then
+ * you can find the corresponding stock by traversing the FK relationships
+ * in this manner:
+ *
  *   ND Method:     feature => feature_genotype => nd_experiment_genotype => nd_experiment => nd_experiment_stock => stock
- * 
- * The tripal_natural_diversity module handles association of stocks using the ND method.  
+ *
+ * The tripal_natural_diversity module handles association of stocks using the ND method.
  * This template handles association of stocks when stored using the simple method.
  * If the tripal_natural_diversity module is enabled then this template will not show.
  * You should instead see the tripal_feature.nd_genotypes.tpl.php template
- * 
+ *
  */
 $feature = $variables['node']->feature;
 
 // specify the number of genotypes to show by default and the unique pager ID
-$num_results_per_page = 25; 
+$num_results_per_page = 25;
 $feature_pager_id = 15;
 
 // get the genotypes from the feature_genotype table
@@ -36,7 +36,7 @@ $options = array(
     'element' => $feature_pager_id
   ),
 );
-$feature = chado_expand_var($feature, 'table', 'feature_genotype', $options); 
+$feature = chado_expand_var($feature, 'table', 'feature_genotype', $options);
 $feature_genotypes = $feature->feature_genotype->feature_id;
 
 // get the total number of records
@@ -44,8 +44,8 @@ $total_records = chado_pager_get_count($feature_pager_id);
 
 // now iterate through the feature genotypes and print a paged table.
 if (count($feature_genotypes) > 0) {?>
-  <div class="tripal_feature-data-block-desc tripal-data-block-desc">This following <?php print number_format($total_records) ?> genotype(s) have been recorded for this feature.</div><?php 
-  
+  <div class="tripal_feature-data-block-desc tripal-data-block-desc">This following <?php print number_format($total_records) ?> genotype(s) have been recorded for this feature.</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
@@ -56,26 +56,26 @@ if (count($feature_genotypes) > 0) {?>
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
-  
+
   foreach($feature_genotypes as $feature_genotype) {
     $genotype = $feature_genotype->genotype_id;
-    
+
     // show the uniquename for the genotype unless a name exists
     $name = $genotype->uniquename;
     if ($genotype->name){
       $name = $genotype->name;
     }
-    
+
     // get the genotype type
     $type = 'N/A';
     if ($genotype->type_id) {
       $type = ucwords(preg_replace('/_/', ' ', $genotype->type_id->name));
     }
-    
+
     // get the genotype properties
     $options = array('return_array' => 1);
     $genotype = chado_expand_var($genotype, 'table', 'genotypeprop', $options);
-    $properties = $genotype->genotypeprop; 
+    $properties = $genotype->genotypeprop;
     $details = '';
     if(count($properties) > 0) {
       foreach ($properties as $property){
@@ -83,7 +83,7 @@ if (count($feature_genotypes) > 0) {?>
       }
       $details = substr($details, 0, -4); // remove trailing <br>
     }
-    
+
     // add in stocks associated with this genotype if any
     $options = array(
       'return_array' => 1,
@@ -94,21 +94,21 @@ if (count($feature_genotypes) > 0) {?>
       ),
     );
     $genotype = chado_expand_var($genotype, 'table', 'stock_genotype', $options);
-    $stock_genotypes = $genotype->stock_genotype; 
+    $stock_genotypes = $genotype->stock_genotype;
 
     // build the list of germplasm.
     $stock_names = '';
-    if(count($stock_genotypes) > 0) { 
-      foreach ($stock_genotypes as $stock_genotype){ 
-        $stock = $stock_genotype->stock_id; 
-        $stock_name = $stock->name . ' (' . $stock->uniquename . ')'; 
+    if(count($stock_genotypes) > 0) {
+      foreach ($stock_genotypes as $stock_genotype){
+        $stock = $stock_genotype->stock_id;
+        $stock_name = $stock->name . ' (' . $stock->uniquename . ')';
         if(property_exists($stock, 'nid')) {
           $stock_name = l($stock_name, 'node/' . $stock->nid, array('attributes' => array('target' => '_blank')));
         }
         $stock_names .= $stock_name . '<br>';
       }
       $stock_names = substr($stock_names, 0, -4); // remove trailing <br>
-    } 
+    }
     // add the fields to the table row
     $rows[] = array(
       $name,
@@ -118,7 +118,7 @@ if (count($feature_genotypes) > 0) {?>
       $stock_names
     );
   }
-   
+
   // 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:
@@ -135,24 +135,29 @@ if (count($feature_genotypes) > 0) {?>
     '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); 
-  
+  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' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $feature_pager_id,
     'parameters' => array(
-      'block' => 'genotypes'
+      'pane' => 'genotypes'
     ),
     'quantity' => $num_results_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }

+ 32 - 27
legacy/tripal_genetic/theme/templates/tripal_stock_genotypes.tpl.php

@@ -1,35 +1,35 @@
 <?php
 /*
- * Details about genotypes associated with stocks can be found in two ways by 
+ * Details about genotypes associated with stocks can be found in two ways by
  * traversing the the foreign key (FK) relationships in these ways:
- * 
+ *
  *   Simple Method: stock => stock_genotype => genotype
  *   ND Method:     stock => nd_experiment_stock => nd_experiment => nd_experiment_genotype => genotype
- *   
- * The tripal_natural_diversity module handles display of genotypes when stored using the 
+ *
+ * The tripal_natural_diversity module handles display of genotypes when stored using the
  * ND method.  This template handles display of genotype when stored using
  * the Simple Method.  If the tripal_natural_diversity module is enabled then this template
  * will not show.  You should instead see the tripal_stock.nd_genotypes.tpl.php template
- *  
+ *
  */
 $stock = $variables['node']->stock;
 
 // specify the number of genotypes to show by default and the unique pager ID
-$num_results_per_page = 25; 
+$num_results_per_page = 25;
 $stock_pager_id = 15;
 
 // get the genotypes from the stock_genotype table
 $options = array(
-  'return_array' => 1, 
+  'return_array' => 1,
   'pager' => array(
-    'limit' => $num_results_per_page, 
+    'limit' => $num_results_per_page,
     'element' => $stock_pager_id
   ),
   'fk_include' => array(
     'genotype_id' => 1
   ),
 );
-$stock = chado_expand_var($stock, 'table', 'stock_genotype', $options); 
+$stock = chado_expand_var($stock, 'table', 'stock_genotype', $options);
 $stock_genotypes = $stock->stock_genotype;
 
 // get the total number of records
@@ -38,26 +38,26 @@ $total_records = chado_pager_get_count($stock_pager_id);
 // now iterate through the stock genotypes and print a paged table.
 if (count($stock_genotypes) > 0) {?>
   <div class="tripal_stock-data-block-desc tripal-data-block-desc">The following <?php print number_format($total_records) ?> genotype(s) have been recorded for this stock.</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('Name', 'Type', 'Genotype', 'Details', 'Markers');
-  
+
   // 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();
-  
-  foreach($stock_genotypes as $stock_genotype) {       
+
+  foreach($stock_genotypes as $stock_genotype) {
     $genotype = $stock_genotype->genotype_id;
-    
+
     // get the genotype properties
     $options = array('return_array' => 1);
     $genotype = chado_expand_var($genotype, 'table', 'genotypeprop', $options);
-    $properties = $genotype->genotypeprop; 
-    
+    $properties = $genotype->genotypeprop;
+
     // add in markers associated with this genotype if any
     $options = array(
       'return_array' => 1,
@@ -68,8 +68,8 @@ if (count($stock_genotypes) > 0) {?>
       ),
     );
     $genotype = chado_expand_var($genotype, 'table', 'feature_genotype', $options);
-    $feature_genotypes = $genotype->feature_genotype; 
-    
+    $feature_genotypes = $genotype->feature_genotype;
+
     // show the uniquename for the genotype unless a name exists
     $name = $genotype->uniquename;
     if ($genotype->name){
@@ -80,7 +80,7 @@ if (count($stock_genotypes) > 0) {?>
     if ($genotype->type_id) {
       $type = ucwords(preg_replace('/_/', ' ', $genotype->type_id->name));
     }
-    
+
     // get the genotype properties
     $details = '';
     if(count($properties) > 0) {
@@ -89,7 +89,7 @@ if (count($stock_genotypes) > 0) {?>
       }
       $details = substr($details, 0, -4); // remove trailing <br>
     }
-    
+
     // build the list of marker features.
     $feature_names = 'N/A';
     if(count($feature_genotypes) > 0) {
@@ -104,7 +104,7 @@ if (count($stock_genotypes) > 0) {?>
       }
       $feature_names = substr($feature_names, 0, -4); // remove trailing <br>
     }
-      
+
     // add the fields to the table row
     $rows[] = array(
       $name,
@@ -113,8 +113,8 @@ if (count($stock_genotypes) > 0) {?>
       $details,
       $feature_names
     );
-  } 
-  
+  }
+
   // 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:
@@ -134,20 +134,25 @@ if (count($stock_genotypes) > 0) {?>
   // 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' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $stock_pager_id,
     'parameters' => array(
-      'block' => 'genotypes'
+      'pane' => 'genotypes'
     ),
     'quantity' => $num_results_per_page,
   );
-  print theme_pager($pager); 
-} 
+  print theme_pager($pager);
+  $_GET = $get;
+}

+ 6 - 1
legacy/tripal_library/theme/templates/tripal_library_features.tpl.php

@@ -86,15 +86,20 @@ if (count($features) > 0) { ?>
   // 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $element,
     'parameters' => array(
-      'block' => 'features'
+      'pane' => 'features'
     ),
     'quantity' => $num_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }
 
 

+ 35 - 30
legacy/tripal_natural_diversity/theme/templates/tripal_feature_nd_genotypes.tpl.php

@@ -2,25 +2,25 @@
 /*
  * Deatils about genotypes associated features can be found by traversing the foreign key (FK)
  * relationships in this way
- * 
+ *
  * feature => feature_genotype => genotype
  *
- * There are two ways that features with genotypes can be associated with stocks.  The first, 
+ * There are two ways that features with genotypes can be associated with stocks.  The first,
  * more simple method, is by traversion the FK relationships in this manner:
- * 
+ *
  *   Simple Method: feature => feature_genotype => genotype => stock_genotype => stock
- *   
+ *
  * The second method involves use of the natural diversity (ND) tables which allows for association
- * or more ancilliary information. Within the ND tables, If a feature has genotypes then 
- * you can find the corresponding stock by traversing the FK relationships 
- * in this manner: 
- * 
+ * or more ancilliary information. Within the ND tables, If a feature has genotypes then
+ * you can find the corresponding stock by traversing the FK relationships
+ * in this manner:
+ *
  *   ND MEthod: feature => feature_genotype => nd_experiment_genotype => nd_experiment => nd_experiment_stock => stock
- * 
+ *
  * You can find ancilliary information about data associated with a genotype in the ND tables such as
- * a contact, pub, protocol, project, genotype, dbxref by using the 
+ * a contact, pub, protocol, project, genotype, dbxref by using the
  * nd_experiment.nd_experiment_id value and traversing the other FK relationships
- * 
+ *
  * feature => feature_genotype => nd_experiment_genotype => nd_experiment => nd_experiment_stock => stock
  *                                                                        => nd_experiment_project => project
  *                                                                        => nd_experiment_pub => pub
@@ -29,16 +29,16 @@
  *                                                                        => nd_experiment_protocol => protocol
  *                                                                        => nd_experiment_stockprop
  *                                                                        => nd_experiment_stock_dbxref
- * 
- * In the FK relationships shown above, the nd_experiment_id value represents a single 
- * experimental value that may have all of the ancilliary data associated with it.  
+ *
+ * In the FK relationships shown above, the nd_experiment_id value represents a single
+ * experimental value that may have all of the ancilliary data associated with it.
  * If the genotype record shares an nd_experiment_id with a genotype, pub, contact,
  * protocol, etc then all of that data is associated with the genotype and vice-versa.
- * 
- * Techincally, we can skip including the 'nd_experiment' table when traversing the FK's 
- * because we have the nd_experiment_id value when we get the nd_experiment_genotype record. 
- * 
- * NOTE: if the tripal_natural_diversity module is enabled this template will supercede 
+ *
+ * Techincally, we can skip including the 'nd_experiment' table when traversing the FK's
+ * because we have the nd_experiment_id value when we get the nd_experiment_genotype record.
+ *
+ * NOTE: if the tripal_natural_diversity module is enabled this template will supercede
  * the tripal_feature_genotypes.tpl.php template (provided by the tripal_genetic module).
  * Therefore, this template must handle both cases for linking to stocks as described above
  */
@@ -67,7 +67,7 @@ $total_records = chado_pager_get_count($feature_pager_id);
 
 // now iterate through the feature genotypes and print a paged table.
 if (count($feature_genotypes) > 0) { ?>
-  <div class="tripal_feature-data-block-desc tripal-data-block-desc">This following <?php print number_format($total_records) ?> genotype(s) have been recorded for this feature.</div> <?php 
+  <div class="tripal_feature-data-block-desc tripal-data-block-desc">This following <?php print number_format($total_records) ?> genotype(s) have been recorded for this feature.</div> <?php
 
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
@@ -79,11 +79,11 @@ if (count($feature_genotypes) > 0) { ?>
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
-  
+
   foreach ($feature_genotypes as $feature_genotype) {
     $project_names = 'N/A';
     $stock_names   = 'N/A';
-    
+
     // get the genotype from the feature_genotype record
     $genotype = $feature_genotype->genotype_id;
 
@@ -93,7 +93,7 @@ if (count($feature_genotypes) > 0) { ?>
     if ($genotype->name){
       $name = $genotype->name;
     }
-    
+
     // build the genotype type for display
     $type = 'N/A';
     if ($genotype->type_id) {
@@ -143,7 +143,7 @@ if (count($feature_genotypes) > 0) { ?>
         }
         $stock_names = substr($stock_names, 0, -4); // remove trailing <br>
       }
-      
+
       // expand the nd_experiment object to incldue the nd_experiment_project table
       $values = array('nd_experiment_id' => $nd_experiment_id);
       $options = array('return_array' => 1);
@@ -171,8 +171,8 @@ if (count($feature_genotypes) > 0) { ?>
       $stock_names,
       $project_names,
     );
-  } 
-  
+  }
+
   // 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:
@@ -191,21 +191,26 @@ if (count($feature_genotypes) > 0) { ?>
   );
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
-  print theme_table($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' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $feature_pager_id,
     'parameters' => array(
-      'block' => 'genotypes'
+      'pane' => 'genotypes'
     ),
     'quantity' => $num_results_per_page,
   );
-  print theme_pager($pager); 
+  print theme_pager($pager);
+  $_GET = $get;
 }

+ 44 - 39
legacy/tripal_natural_diversity/theme/templates/tripal_stock_nd_genotypes.tpl.php

@@ -1,26 +1,26 @@
 <?php
 /*
- * Details about genotypes associated with stocks can be found in two ways by 
+ * Details about genotypes associated with stocks can be found in two ways by
  * traversing the the foreign key (FK) relationships in these ways:
- * 
+ *
  *   Simple Method: stock => stock_genotype => genotype
  *   ND Method:     stock => nd_experiment_stock => nd_experiment => nd_experiment_genotype => genotype
  *
- * The tripal_genetic module handles display of genotypes when stored using the 
+ * The tripal_genetic module handles display of genotypes when stored using the
  * simple method.  This template handles display of genotype when stored using
- * the ND Method.  The ND method uses the natural diversity tables and allows for 
- * association or more ancilliary information. 
- * 
- * 
- * Within the ND tables, If a stock has genotypes then you can find the corresponding 
- * features by traversing the FK relationships in this manner: 
- * 
+ * the ND Method.  The ND method uses the natural diversity tables and allows for
+ * association or more ancilliary information.
+ *
+ *
+ * Within the ND tables, If a stock has genotypes then you can find the corresponding
+ * features by traversing the FK relationships in this manner:
+ *
  * stock => nd_experiment_stock => nd_experiment => nd_experiment_genotype => genotype => feature_genotype => feature
- * 
+ *
  * You can find ancilliary information about data associated with a genotype in the ND tables such as
- * a contact, pub, protocol, project, genotype, dbxref by using the 
+ * a contact, pub, protocol, project, genotype, dbxref by using the
  * nd_experiment.nd_experiment_id value and traversing the other FK relationships
- * 
+ *
  * stock => nd_experiment_stock => nd_experiment => nd_experiment_project => project
  *                                               => nd_experiment_pub => pub
  *                                               => nd_experiment_contact => contact
@@ -28,21 +28,21 @@
  *                                               => nd_experiment_protocol => protocol
  *                                               => nd_experiment_stockprop
  *                                               => nd_experiment_stock_dbxref
- * 
- * In the FK relationships shown above, the nd_experiment_id value represents a single 
- * experimental unit that may have all of the ancilliary data associated with it or none.  
+ *
+ * In the FK relationships shown above, the nd_experiment_id value represents a single
+ * experimental unit that may have all of the ancilliary data associated with it or none.
  * If the genotype record shares an nd_experiment_id with a genotype, pub, contact,
  * protocol, etc then all of that data is associated with the genotype and vice-versa.
- * 
- * Techincally, we can skip including the 'nd_experiment' table when traversing the FK's 
+ *
+ * Techincally, we can skip including the 'nd_experiment' table when traversing the FK's
  * because we have the nd_experiment_id value when we get the nd_experiment_stock record.
- * 
+ *
  * When lots of genotypes are associated with a stock (e.g. thousands) then traversing
  * the FK relationships as described above can be very slow. Ideally, we only need to
- * show a small subset with a pager. Therefore, a list of nd_experiment_genotype_id's 
+ * show a small subset with a pager. Therefore, a list of nd_experiment_genotype_id's
  * are provided to this template automatically within the stock object.
- * 
- * NOTE: if the tripal_natural_diversity module is enabled this template will supercede 
+ *
+ * NOTE: if the tripal_natural_diversity module is enabled this template will supercede
  * the tripal_stock_genotypes.tpl.php template (provided by the tripal_genetic module).
  * Therefore, this template must handle both cases for linking to features as described above
  */
@@ -57,7 +57,7 @@ $stock_pager_id = 15;
 
 // the nd_experiment_genotype IDs get passed into this template, so we use
 // those to iterate and show a subset via a pager.  This is faster than trying
-// to traverse all of the FK relationship, especially when thousands of 
+// to traverse all of the FK relationship, especially when thousands of
 // associations may be present.  Because the nd_experiment_id in Chado
 // can be associated with other data types it becomes slow to use the
 // chado_expand_var functions that we would normal use.
@@ -70,13 +70,13 @@ $offset = $num_results_per_page * $current_page_num;
 
 $genotypes = array();
 if ($total_records > 0) {
-  
+
   // iterate through the nd_experiment_genotype_ids and get the genotype record
   for ($i = $offset ; $i < $offset + $num_results_per_page; $i++) {
     $nd_experiment_genotype_id = $nd_experiment_genotype_ids[$i];
-      
+
     // expand the nd_experiment record to include the nd_experiment_genotype table
-    // there many be many genotypes for a stock so we want to use a pager to limit 
+    // there many be many genotypes for a stock so we want to use a pager to limit
     // the results returned
     $options = array(
       'return_array' => 1,
@@ -98,7 +98,7 @@ if ($total_records > 0) {
 if (count($genotypes) > 0) { ?>
   <div class="tripal_feature-data-block-desc tripal-data-block-desc">
     The following <?php print number_format($total_records) ?> genotype(s) have been recorded.
-  </div> <?php 
+  </div> <?php
 
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
@@ -110,26 +110,26 @@ if (count($genotypes) > 0) { ?>
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
-  
+
   // iterate through the genotypes and build each row of the resulting table
   foreach ($genotypes as $info) {
     $genotype         = $info['genotype'];
     $nd_experiment_id = $info['nd_experiment_id'];
-    
+
     // get the nd_experiment record
     $nd_experiment = chado_generate_var('nd_experiment', array('nd_experiment_id' => $nd_experiment_id));
-    
+
     // set some defaults for project and feature names
     $project_names = 'N/A';
     $feature_names = 'N/A';
-    
+
     // build the name for displaying the genotype. Use the uniquename by default
     // unless a name exists
     $name = $genotype->uniquename;
     if ($genotype->name){
       $name = $genotype->name;
     }
-    
+
     // build the genotype type for display
     $type = 'N/A';
     if ($genotype->type_id) {
@@ -147,7 +147,7 @@ if (count($genotypes) > 0) { ?>
       }
       $details = substr($details, 0, -4); // remove trailing <br>
     }
-    
+
     // get the features as found in the feature_genotype table and if any, add them to the $features array
     // we will later add in the features list for display
     $features = array();
@@ -173,7 +173,7 @@ if (count($genotypes) > 0) { ?>
       }
       $feature_names = substr($feature_names, 0, -4); // remove trailing <br>
     }
-      
+
     // expand the nd_experiment object to incldue the nd_experiment_project table
     $values = array('nd_experiment_id' => $nd_experiment_id);
     $options = array('return_array' => 1);
@@ -200,8 +200,8 @@ if (count($genotypes) > 0) { ?>
       $feature_names,
       $project_names,
     );
-  } 
-  
+  }
+
   // 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:
@@ -220,21 +220,26 @@ if (count($genotypes) > 0) { ?>
   );
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
-  print theme_table($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' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $stock_pager_id,
     'parameters' => array(
-      'block' => 'genotypes'
+      'pane' => 'genotypes'
     ),
     'quantity' => $num_results_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }

+ 41 - 36
legacy/tripal_natural_diversity/theme/templates/tripal_stock_nd_phenotypes.tpl.php

@@ -2,14 +2,14 @@
 /*
  * Phenotype relationships with stocks are stored in the natural diversity tables.
  * If a stock has phenotypes associated then you can find the data by traversing
- * the foreign key (FK) relationships in this manner: 
- * 
+ * the foreign key (FK) relationships in this manner:
+ *
  * stock => nd_experiment_stock => nd_experiment => nd_experiment_phenotype => phenotype.
- * 
+ *
  * You can find ancillary information about data associated with a phenotype such as
- * a contact, pub, protocol, project, phenotype, dbxref by using the 
+ * a contact, pub, protocol, project, phenotype, dbxref by using the
  * nd_experiment.nd_experiment_id value and traversing the other FK relationships
- * 
+ *
  * stock => nd_experiment_stock => nd_experiment => nd_experiment_phenotype => phenotype
  *                                               => nd_experiment_phenotype => phenotype
  *                                               => nd_experiment_project => project
@@ -19,20 +19,20 @@
  *                                               => nd_experiment_protocol => protocol
  *                                               => nd_experiment_stockprop
  *                                               => nd_experiment_stock_dbxref
- * 
- * In the FK relationships shown above, the nd_experiment_id value represents a single 
- * experimental value that may have all of the ancilliary data associated with it.  
+ *
+ * In the FK relationships shown above, the nd_experiment_id value represents a single
+ * experimental value that may have all of the ancilliary data associated with it.
  * If the phenotype record shares an nd_experiment_id with a phenotype, pub, contact,
  * protocol, etc then all of that data is associated with the phenotype and vice-versa.
- * 
- * Techincally, we can skip including the 'nd_experiment' table when traversing the FK's 
+ *
+ * Techincally, we can skip including the 'nd_experiment' table when traversing the FK's
  * because we have the nd_experiment_id value when we get the nd_experiment_stock record.
- * 
+ *
  * When lots of phenotypes are associated with a stock (e.g. thousands) then traversing
  * the FK relationships as described above can be very slow. Ideally, we only need to
- * show a small subset with a pager. Therefore, a list of nd_experiment_phenotype_id's 
+ * show a small subset with a pager. Therefore, a list of nd_experiment_phenotype_id's
  * are provided to this template automatically within the stock object.
- * 
+ *
  */
 
 // get the current stock
@@ -45,7 +45,7 @@ $stock_pager_id = 10;
 
 // the nd_experiment_phenotype IDs get passed into this template, so we use
 // those to iterate and show a subset via a pager.  This is faster than trying
-// to traverse all of the FK relationship, especially when thousands of 
+// to traverse all of the FK relationship, especially when thousands of
 // associations may be present.  Because the nd_experiment_id in Chado
 // can be associated with other data types it becomes slow to use the
 // chado_expand_var functions that we would normal use.
@@ -59,11 +59,11 @@ $offset = $num_results_per_page * $current_page_num;
 
 $phenotypes = array();
 if ($total_records > 0) {
-  
+
   // iterate through the nd_experiment_phenotype_ids and get the phenotype record
   for ($i = $offset ; $i < $offset + $num_results_per_page; $i++) {
     // expand the nd_experiment record to include the nd_experiment_phenotype table
-    // there many be many phenotypes for a stock so we want to use a pager to limit 
+    // there many be many phenotypes for a stock so we want to use a pager to limit
     // the results returned
     $options = array(
       'return_array' => 1,
@@ -84,7 +84,7 @@ if ($total_records > 0) {
 if (count($phenotypes) > 0) {?>
   <div class="tripal_stock-data-block-desc tripal-data-block-desc">
     The following <?php print number_format($total_records) ?> phenotypes(s) have been recorded.
-  </div><?php 
+  </div><?php
 
   // the $headers array is an array of fields to use as the colum headers.
   // additional documentation can be found here
@@ -96,43 +96,43 @@ if (count($phenotypes) > 0) {?>
   // can be found here:
   // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
   $rows = array();
-  
-  // iterate through the nd_experiment_stock records and get 
+
+  // iterate through the nd_experiment_stock records and get
   // each experiment and the associated phenotypes
   foreach ($phenotypes as $info){
     $phenotype         = $info['phenotype'];
     $nd_experiment_id  = $info['nd_experiment_id'];
-    
+
     // get the nd_experiment record
     $nd_experiment = chado_generate_var('nd_experiment', array('nd_experiment_id' => $nd_experiment_id));
-    
+
     $details = '';
 
-    if ($phenotype->name) { 
+    if ($phenotype->name) {
       $details .= "Name: $phenotype->name<br>";
     }
-    
-    // add in the attribute type pheonotypes values are stored qualitatively or quantitatively. 
+
+    // add in the attribute type pheonotypes values are stored qualitatively or quantitatively.
     // If qualitatively the cvalue_id will link to a type. If quantitative we
     // use the value column
     $details .= ucwords(preg_replace('/_/', ' ', $phenotype->attr_id->name)) . ': ';
-    if ($phenotype->cvalue_id) { 
+    if ($phenotype->cvalue_id) {
       $details .= ucwords(preg_replace('/_/', ' ', $phenotype->cvalue_id->name)) . '<br>';
     }
-    else { 
+    else {
       $details .= $phenotype->value . '<br>';
-    }  
-    
+    }
+
     // get the observable unit and add it to the details
-    if ($phenotype->observable_id) { 
+    if ($phenotype->observable_id) {
       $details .= "Observable Unit: " . ucwords(preg_replace('/_/', ' ', $phenotype->observable_id->name)) . '<br>';
     }
-    
+
     // get the evidence unit and add it to the details
-    if ($phenotype->assay_id) { 
+    if ($phenotype->assay_id) {
       $details .= "Evidence: " .  ucwords(preg_replace('/_/', ' ', $phenotype->assay_id->name)) . '<br>';
     }
-    
+
     // Get the project for this experiment. For each nd_experiment_id there should only be one project
     // but the database does not constrain that there only be one project so just in case we get them all
     $projects = array();
@@ -153,7 +153,7 @@ if (count($phenotypes) > 0) {?>
       $pnames .= $name . '<br>';
     }
     $pnames = substr($pnames, 0, -4); // remove trailing <br>
-    
+
     $rows[] = array(
        $details,
        $pnames,
@@ -177,21 +177,26 @@ if (count($phenotypes) > 0) {?>
   );
   // once we have our table array structure defined, we call Drupal's theme_table()
   // function to generate the table.
-  print theme_table($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' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $stock_pager_id,
     'parameters' => array(
-      'block' => 'genotypes'
+      'pane' => 'genotypes'
     ),
     'quantity' => $num_results_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }

+ 8 - 2
legacy/tripal_pub/theme/templates/tripal_pub_featuremaps.tpl.php

@@ -81,14 +81,20 @@ if(count($featuremaps) > 0){ ?>
   // here we add the paramter 'block' => 'featuremaps'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $element,
     'parameters' => array(
-      'block' => 'featuremaps'
+      'pane' => 'featuremaps'
     ),
     'quantity' => $num_per_page,
   );
   print theme_pager($pager);
-}?>
+  $_GET = $get;
+}
+
 

+ 6 - 1
legacy/tripal_pub/theme/templates/tripal_pub_features.tpl.php

@@ -83,14 +83,19 @@ if(count($features) > 0){ ?>
   // here we add the paramter 'block' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $element,
     'parameters' => array(
-      'block' => 'features'
+      'pane' => 'features'
     ),
     'quantity' => $num_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }
 

+ 6 - 1
legacy/tripal_pub/theme/templates/tripal_pub_libraries.tpl.php

@@ -86,14 +86,19 @@ if(count($libraries) > 0){ ?>
   // here we add the paramter 'block' => 'libraries'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $element,
     'parameters' => array(
-      'block' => 'libraries'
+      'pane' => 'libraries'
     ),
     'quantity' => $num_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }
 

+ 6 - 1
legacy/tripal_pub/theme/templates/tripal_pub_projects.tpl.php

@@ -85,14 +85,19 @@ if(count($projects) > 0){ ?>
   // here we add the paramter 'block' => 'projects'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $element,
     'parameters' => array(
-      'block' => 'projects'
+      'pane' => 'projects'
     ),
     'quantity' => $num_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }
 

+ 6 - 1
legacy/tripal_pub/theme/templates/tripal_pub_stocks.tpl.php

@@ -83,14 +83,19 @@ if(count($stocks) > 0){ ?>
   // here we add the paramter 'block' => 'stocks'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $element,
     'parameters' => array(
-      'block' => 'stocks'
+      'pane' => 'stocks'
     ),
     'quantity' => $num_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
 }
 

+ 7 - 1
legacy/tripal_stock/theme/templates/tripal_organism_stocks.tpl.php

@@ -82,15 +82,21 @@ if (count($stocks) > 0) { ?>
   // here we add the paramter 'block' => 'features'. 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.
+  // We remove the 'pane' parameter from the original query parameters because
+  // Drupal won't reset the parameter if it already exists.
+  $get = $_GET;
+  unset($_GET['pane']);
   $pager = array(
     'tags' => array(),
     'element' => $pager_id,
     'parameters' => array(
-      'block' => 'stocks'
+      'pane' => 'stocks'
     ),
     'quantity' => $num_results_per_page,
   );
   print theme_pager($pager);
+  $_GET = $get;
+
 }