function theme_tripal_pub_search_setup_form_elements

2.x tripal_pub.pub_search.inc theme_tripal_pub_search_setup_form_elements($variables)

Theme the tripal_pub_search_setup_form form

Related topics

1 theme call to theme_tripal_pub_search_setup_form_elements()
tripal_pub_search_form in tripal_pub/includes/tripal_pub.pub_search.inc
Provides the form to search pubmed

File

tripal_pub/includes/tripal_pub.pub_search.inc, line 481
Functions responsible for creating the publication search form that allows a user of the site to search for publications that are currently in Chado.

Code

function theme_tripal_pub_search_setup_form_elements($variables) {
  $form = $variables['form'];

  $rows = array();
  // put each criteria element in a single table row
  foreach ($form as $i => $element) {
    if (is_numeric($i)) {
      $rows[] = array(
        drupal_render($element["operation-$i"]),
        drupal_render($element["scope-$i"]),
        //drupal_render($element["mode-$i"]) .
        drupal_render($element["search_terms-$i"]),
        array(
          'data' => drupal_render($element["add-$i"]) . drupal_render($element["remove-$i"]),
          'nowrap' => 'nowrap',
        ),
      );
    }
  }

  // add in the from_year and to_year elements as the final row of the table
  $rows[] = array(
    ' ',
    drupal_render($form['date']),
    array(
      'data' =>
      "<div id=\"pub-search-form-dates-row\">
           <div id=\"pub-search-form-dates\"> " .
        drupal_render($form['from_year']) .
        drupal_render($form['to_year']) . "
           </div>
         </div>
        ",
    ),
    ''
  );

  $headers = array();
  $table = array(
    'header' => $headers,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'tripal-pub-search-form-table',
      'border' => '0',
      'class' => 'tripal-data-table'
    ),
    'sticky' => TRUE,
    'caption' => '',
    'colgroups' => array(),
    'empty' => '',
  );
  $results = '<div id="tripal-pub-search-form-criteria">';
  $results .= theme_table($table);
  $results .= '</div>';
  return $results;
}