Sfoglia il codice sorgente

Merge branch '7.x-2.x' of git.drupal.org:sandbox/spficklin/1337878 into 7.x-2.x

Lacey Sanderson 11 anni fa
parent
commit
c0c4a74b5e

+ 6 - 2
tripal_analysis/theme/tripal_analysis/tripal_analysis_base.tpl.php

@@ -78,9 +78,13 @@ $analysis = tripal_core_expand_chado_vars($analysis,'field','analysis.descriptio
     $rows[] = array(
       array(
         'data' => 'Analysis ID',
-        'header' => TRUE
+        'header' => TRUE,
+        'class' => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+        'data' => $analysis->analysis_id,
+        'class' => 'tripal-site-admin-only-table-row',
       ),
-      $analysis->analysis_id
     );
   }
   // the $table array contains the headers and rows array as well as other

+ 6 - 2
tripal_contact/theme/tripal_contact/tripal_contact_base.tpl.php

@@ -40,9 +40,13 @@ $contact = $variables['node']->contact; ?>
     $rows[] = array(
       array(
         'data' => 'Contact ID',
-        'header' => TRUE
+        'header' => TRUE,
+        'class' => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+        'data' => $contact->contact_id,
+        'class' => 'tripal-site-admin-only-table-row',
       ),
-      $contact->contact_id
     );
   }
   

+ 3 - 6
tripal_core/theme/css/tripal.css

@@ -201,12 +201,9 @@
    padding: 10px 10px 10px 55px;
    font-style: italic;
 }
-/**
- * When when no tripal logo image is wanted 
- */
-.tripal-site-admin-only-noimg {
-  background-image: none;
+
+.tripal-site-admin-only-table-row {
   background-color: #cce3ff;
+  border: 1px solid #888888;
   color: black;
-  clear: both;
 }

BIN
tripal_core/theme/images/TripalLogo-sm.png


+ 1 - 8
tripal_core/theme/node--chado-generic.tpl.php

@@ -63,14 +63,7 @@ else { ?>
 })(jQuery);
 </script>
 
-<div id="tripal_<?php print $ttype?>_content" class="tripal-contents"> <?php 
-  if ($page['tripal_sidebar']) { ?>
-    <div id="tripal-sidebar" class="column sidebar">
-      <div class="section">
-        <?php print render($page["chado_" . $ttype . " _toc"]); ?>
-      </div>
-    </div><?php 
-  } ?>
+<div id="tripal_<?php print $ttype?>_content" class="tripal-contents"> 
   <table id="tripal-contents-table">
     <tr class="tripal-contents-table-tr">
       <td nowrap class="tripal-contents-table-td tripal-contents-table-td-toc"  align="left">

+ 3 - 6
tripal_core/tripal_core.module

@@ -576,9 +576,9 @@ function tripal_core_node_view_alter(&$build) {
           $path = theme('tripal_admin_message', array('message' => "Administrators, you can
             customize the way the content above is presented.  Tripal provides a template
             file for each block of content.  To customize, copy the template file to your
-            site's default theme and edit.  Currently, the content above is provided by
-            this template:
-            <br><br>$path
+            site's default theme, edit then " . 
+            l('clear the Drupal cache', 'admin/config/development/performance', array('attributes' => array('target' => '_blank'))) . ".  
+            Currently, the content above is provided by this template: <br><br>$path
           "));
         }
 
@@ -595,7 +595,4 @@ function tripal_core_node_view_alter(&$build) {
       }
     }
   }
-
-  //dpm($build);
-  //dpm($cache);
 }

+ 1 - 1
tripal_cv/tripal_cv.module

@@ -154,7 +154,7 @@ function tripal_cv_menu() {
   );
   $items['admin/tripal/chado/tripal_cv/cvterm/auto_name/%/%'] = array(
     'page callback' => 'tripal_cv_cvterm_name_autocomplete',
-    'page arguments' => array(5, 6),
+    'page arguments' => array(6, 7),
     'access arguments' => array('administer controlled vocabularies'),
     'type' => MENU_CALLBACK,
   );

+ 1 - 1
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/tripal_cv/cvterm/auto_name/$cv_id",
+   '#autocomplete_path' => "admin/tripal/chado/tripal_cv/cvterm/auto_name/$cv_id",
   );
 
   // get the list of organisms

+ 5 - 1
tripal_feature/theme/tripal_feature/tripal_feature_base.tpl.php

@@ -71,8 +71,12 @@ $feature  = $variables['node']->feature;  ?>
       array(
         'data' => 'Feature ID',
         'header' => TRUE,
+        'class' => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+        'data' => $feature->feature_id,
+        'class' => 'tripal-site-admin-only-table-row',
       ),
-      $feature->feature_id
     );
   }
   // Is Obsolete Row

+ 10 - 12
tripal_feature/theme/tripal_organism/tripal_organism_feature_counts.tpl.php

@@ -17,18 +17,16 @@ if ($enabled) {
       <div class="tripal_organism-info-box-title tripal-info-box-title">Data Type Summary</div>
       <div class="tripal_organism-info-box-desc tripal-info-box-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
-      if (user_access('access administration pages')) { 
-         print theme('tripal_admin_message', array('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') . "
-           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 disable this report and 
-           remove it from the list of resources, navigate to the " . 
-           l('Tripal feature configuration page', 'admin/tripal/tripal_feature/configuration') . "
-           and hide the \"Feature Summary\". To refresh the data,re-populate the " .
-           l('organism_feature_count', 'admin/tripal/schema/mviews') . " materialized view.")
-         ); 
-      }?>
+      print theme('tripal_admin_message', array('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') . "
+        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 disable this report and 
+        remove it from the list of resources, navigate to the " . 
+        l('Tripal feature configuration page', 'admin/tripal/tripal_feature/configuration') . "
+        and hide the \"Feature Summary\". To refresh the data,re-populate the " .
+        l('organism_feature_count', 'admin/tripal/schema/mviews') . " materialized view.")
+      ); ?>
       <table id="tripal_organism-table-feature_counts" class="tripal_organism-table tripal-table tripal-table-horz">     
         <tr class="tripal_organism-table-odd-row tripal-table-even-row">
           <th>Feature Type</th>

+ 0 - 1
tripal_feature/tripal_feature.module

@@ -182,7 +182,6 @@ function tripal_feature_menu() {
     'weight' =>  10
   );
 
-
   /** Loaders */
   $items['admin/tripal/loaders/fasta_loader'] = array(
     'title' => 'Multi-FASTA file Loader',

+ 6 - 2
tripal_featuremap/theme/tripal_featuremap/tripal_featuremap.base.tpl.php

@@ -45,9 +45,13 @@ $featuremap = tripal_core_expand_chado_vars($featuremap, 'field', 'featuremap.de
     $rows[] = array(
       array(
         'data' => 'Feature Map ID',
-        'header' => TRUE
+        'header' => TRUE,
+        'class' => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+        'data' => $featuremap->featuremap_id,
+        'class' => 'tripal-site-admin-only-table-row',
       ),
-      $featuremap->featuremap_id
     );
   }
 

+ 5 - 1
tripal_library/theme/tripal_library/tripal_library.base.tpl.php

@@ -72,8 +72,12 @@ $description = $libprop->value;
       array(
         'data' => 'Library ID',
         'header' => TRUE
+        'class' => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+        'data' => $library->library_id,
+        'class' => 'tripal-site-admin-only-table-row',
       ),
-      $library->library_id,
     );
   }
   

+ 6 - 2
tripal_organism/theme/tripal_organism/tripal_organism_base.tpl.php

@@ -67,10 +67,14 @@ $organism = tripal_core_expand_chado_vars($organism,'field','organism.comment');
     // Organism ID
     $rows[] = array(
       array(
-        'data' => 'Organism ID',
+        'data'   => 'Organism ID',
         'header' => TRUE,
+        'class'  => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+       'data'  => $organism->organism_id,
+       'class' => 'tripal-site-admin-only-table-row',
       ),
-       $organism->organism_id,
     );
   }
 

+ 6 - 2
tripal_project/theme/tripal_project/tripal_project.base.tpl.php

@@ -54,9 +54,13 @@ else {
     $rows[] = array(
       array(
         'data' => 'Project ID',
-        'header' => TRUE
+        'header' => TRUE,
+        'class' => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+        'data' => $project->project_id,
+        'class' => 'tripal-site-admin-only-table-row',
       ),
-      $project->project_id
     );
   }
   // the $table array contains the headers and rows array as well as other

+ 6 - 2
tripal_pub/theme/tripal_pub/tripal_pub_base.tpl.php

@@ -206,9 +206,13 @@ if (count($urls) > 0) {
       $rows[] = array(
         array(
           'data' => 'Pub ID',
-          'header' => TRUE
+          'header' => TRUE,
+          'class' => 'tripal-site-admin-only-table-row',
+        ),
+        array(
+          'data' => $pub->pub_id,
+          'class' => 'tripal-site-admin-only-table-row',
         ),
-        $pub->pub_id
       );
     }
     // Is Obsolete Row

+ 68 - 33
tripal_stock/theme/tripal_organism/tripal_organism_stocks.tpl.php

@@ -10,7 +10,10 @@ $pager_id = 3;
 $options = array(  
   'return_array' => 1,
   'order_by' => array('name' => 'ASC'),
-  'pager' => array('limit' => $num_results_per_page, 'element' => $pager_id),
+  'pager' => array(
+    'limit' => $num_results_per_page, 
+    'element' => $pager_id
+  ),
   'include_fk' => array(
     'type_id' => 1    
   ),
@@ -20,44 +23,76 @@ $organism = tripal_core_expand_chado_vars($organism, 'table', 'stock', $options)
 $stocks = $organism->stock;
 
 // create the pager.  
-global $pager_total_items;
-$pager = theme('pager', array(), $num_results_per_page, $pager_id, array('block' => 'stocks'));
-$total_features = $pager_total_items[$pager_id];
+// the total number of records for the paged query is stored in a session variable
+$total_records = $_SESSION['chado_pager'][$pager_id]['total_records'];
 
  
 if (count($stocks) > 0) { ?>
   <div id="tripal_organism-stocks-box" class="tripal_organism-info-box tripal-info-box">
     <div class="tripal_organism-info-box-title tripal-info-box-title">Stocks</div>
-    <div class="tripal_organism-info-box-desc tripal-info-box-desc">This organism is associated with <?php print number_format($total_features) ?> stock(s):</div>
+    <div class="tripal_organism-info-box-desc tripal-info-box-desc">This organism is associated with <?php print number_format($total_records) ?> stock(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
+    // This table for the analysis has a vertical header (down the first column)
+    // so we do not provide headers here, but specify them in the $rows array below.
+    $headers = array('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();
+    
+    foreach ($stocks as $stock){
+      $name = $stock->name;
+      if (!$name) {
+        $name = $stock->uniquename;
+      }
+      if ($stock->nid) {    
+        $name = l($name, "node/$stock->nid", array('attributes' => array('target' => '_blank')));
+      }
+
+      $rows[] = array(
+        $name,
+        $stock->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-stocks',
+      ),
+      '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);
     
-    <table id="tripal_organism-table-stocks" class="tripal_organism-table tripal-table tripal-table-horz">     
-      <tr class="tripal_organism-table-odd-row tripal-table-even-row">
-        <th>Name</th>
-        <th>Type</th>
-      </tr> <?php
-      foreach ($stocks as $stock){ 
-        $class = 'tripal_organism-table-odd-row tripal-table-odd-row';
-        if ($i % 2 == 0 ) {
-          $class = 'tripal_organism-table-odd-row tripal-table-even-row';
-        } ?>
-        <tr class="<?php print $class ?>">
-          <td><?php
-            $name = $stock->name;
-            if (!$stock->name) {
-              $name = $stock->uniquename;
-            }
-            if ($stock->nid) {    
-              print l($name, "node/$stock->nid", array('attributes' => array('target' => '_blank')));        
-            } else {
-              print $name;
-            }?>
-          </td>
-          <td><?php print $stock->type_id->name?></td>
-        </tr><?php
-        $i++;  
-      } ?>
-    </table>
-    <?php print $pager ?>
+    // 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.
+    $pager = array(
+      'tags' => array(),
+      'element' => $pager_id,
+      'parameters' => array(
+        'block' => 'stocks'
+      ),
+      'quantity' => $num_results_per_page,
+    );
+    print theme_pager($pager);  ?>
   </div> <?php
 } 
 

+ 6 - 2
tripal_stock/theme/tripal_stock/tripal_stock_base.tpl.php

@@ -67,9 +67,13 @@ $stock = tripal_core_expand_chado_vars($stock, 'field', 'stock.uniquename');
     $rows[] = array(
       array(
         'data' => 'Stock ID',
-        'header' => TRUE
+        'header' => TRUE,
+        'class' => 'tripal-site-admin-only-table-row',
+      ),
+      array(
+        'data' => $stock->stock_id,
+        'class' => 'tripal-site-admin-only-table-row',
       ),
-      $stock->stock_id
     );
   }
   // Is Obsolete Row