12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- $analysis = $variables['node']->analysis;
- $analysis = tripal_core_expand_chado_vars($analysis,'field','analysis.description');
- ?>
- <div id="tripal_analysis-base-box" class="tripal_analysis-info-box tripal-info-box">
- <div class="tripal_analysis-info-box-title tripal-info-box-title">Details</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 organism 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();
-
- // 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();
- // Analysis Name row
- $rows[] = array(
- array(
- 'data' => 'Analysis Name',
- 'header' => TRUE
- ),
- $analysis->name
- );
- // Software row
- $software = '';
- if($analysis->programversion and $analysis->programversion != 'n/a'){
- $software = " (" . $analysis->programversion . ")";
- }
- if($analysis->algorithm){
- $software = ". " . $analysis->algorithm;
- }
- $rows[] = array(
- array(
- 'data' => 'Software',
- 'header' => TRUE
- ),
- $software
- );
-
- // Source row
- $source = '';
- if($analysis->sourceuri){
- $source = "<a href=\"$analysis->sourceuri\">$analysis->sourcename</a>";
- }
- else {
- $source = $analysis->sourcename;
- }
- if($analysis->sourceversion){
- $source = " (" . $analysis->sourceversion . ")";
- }
- $rows[] = array(
- array(
- 'data' => 'Source',
- 'header' => TRUE
- ),
- $source
- );
-
- // Date performed row
- $rows[] = array(
- array(
- 'data' => 'Date performed',
- 'header' => TRUE
- ),
- preg_replace("/^(\d+-\d+-\d+) .*/","$1", $analysis->timeexecuted),
- );
-
- // 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_analysis-table-base',
- ),
- '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);
- if (property_exists($analysis, 'comment')) { ?>
- <b>Description</b> <?php
- print $analysis->description;
- } ?>
- </div>
|