Tripal v1.0 (6.x-1.0)
tripal_views_data_export.theme.inc File Reference

Go to the source code of this file.

Functions

 template_preprocess_views_data_export_fasta_body (&$vars)

Detailed Description

Contains template preprocessing functions

Definition in file tripal_views_data_export.theme.inc.


Function Documentation

template_preprocess_views_data_export_fasta_body ( &$  vars)

Preprocess the variables for the FASTA views data export -body template

  • replace the field tokens in the fasta record definition lines
Parameters:
$varsThe variables available to the template

Definition at line 15 of file tripal_views_data_export.theme.inc.

                                                                  {
  _views_data_export_header_shared_preprocess($vars);
  _views_data_export_body_shared_preprocess($vars);
  
  // get export settings
  $defline_tpl = $vars['options']['display']['defline_fields'];

  // iterate through the rows and replace the field tokens with values
  // to generate the definition line  
  foreach ($vars['themed_rows'] as $i => $fields) {
    $defline = $defline_tpl;
    foreach ($fields as $key => $value) {
      $defline = preg_replace("/\[$key\]/", $value, $defline);
    }
    $vars['themed_rows'][$i]['defline'] = $defline;
  }
}
 All Classes Files Functions Variables