function tripal_stock_list_dbreferences_for_node

1.x tripal_stock-db_references.inc tripal_stock_list_dbreferences_for_node($db_references)

List all database references for a given node

@todo Make this function a theme function

Parameters

$db_references: An array of database references to be listed

Return value

HTML representation of the list

Related topics

File

tripal_stock/includes/tripal_stock-db_references.inc, line 434
@todo Add file header description

Code

function tripal_stock_list_dbreferences_for_node($db_references) {

  if (!empty($db_references)) {
    $output = '<table>';
    $output .= '<tr><th>Database</th><th>Accession</th></tr>';

    foreach ($db_references as $db) {
      $output .= '<tr><td>' . $db->db_name . '</td><td>' . $db->accession . '</td></tr>';
    } // end of foreach db reference

    $output .= '</table>';

  }
  else {
    $output = 'No Database References Added to the Current Stock';
  }

  return $output;
}