소스 검색

Fixed pager issue on organism stock listing

Chun-Huai Cheng 9 년 전
부모
커밋
d5e9bb1480
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 2
      tripal_core/api/tripal_core.chado_query.api.inc
  2. 2 2
      tripal_feature/theme/templates/tripal_feature_sequence.tpl.php

+ 4 - 2
tripal_core/api/tripal_core.chado_query.api.inc

@@ -1545,7 +1545,9 @@ function chado_query($sql, $args = array()) {
  */
 function chado_pager_query($query, $args, $limit, $element, $count_query = '') {
   // get the page and offset for the pager
-  $page = isset($_GET['page']) ? $_GET['page'] : '0';
+  $page_arg = isset($_GET['page']) ? $_GET['page'] : '0';
+  $pages = explode(',', $page_arg);
+  $page = $pages[$element];
   $offset = $limit * $page;
   $q = $_GET['q'];
 
@@ -1712,4 +1714,4 @@ function chado_schema_get_foreign_key($table_desc, $field, $values, $options = N
   }
 
   return array();
-}
+}

+ 2 - 2
tripal_feature/theme/templates/tripal_feature_sequence.tpl.php

@@ -45,7 +45,7 @@ if ($residues or count($featureloc_sequences) > 0) {
     $sequences_html .= '<div id="residues" class="tripal_feature-sequence-item">';
     $sequences_html .= '<p><b>' . $feature->type_id->name . ' sequence</b></p>';
     $sequences_html .= '<pre class="tripal_feature-sequence">';
-    $sequences_html .= '>' . tripal_get_fasta_defline($feature, '', NULL, '', strlen($feature->residues)) . "\n";
+    $sequences_html .= '>' . tripal_get_fasta_defline($feature, '', NULL, '', strlen($feature->residues)) . "<br>";
     $sequences_html .= wordwrap($feature->residues, $num_bases, "<br>", TRUE);
     $sequences_html .= '</pre>';
     $sequences_html .= '<a href="#sequences-top">back to top</a>';
@@ -227,4 +227,4 @@ if ($residues or count($featureloc_sequences) > 0) {
   
   // now print the sequences
   print $sequences_html;
-}
+}