Tripal v1.0 (6.x-1.0)
|
Go to the source code of this file.
Definition in file tripal_feature.module.
tripal_feature_coder_ignore | ( | ) |
Implements hook_coder_ignore(). Defines the path to the file (tripal_core.coder_ignores.txt) where ignore rules for coder are stored
Definition at line 2274 of file tripal_feature.module.
{ return array( 'path' => drupal_get_path('module', 'tripal_feature'), 'line prefix' => drupal_get_path('module', 'tripal_feature'), ); }
tripal_feature_match_features_page | ( | $ | id | ) |
Definition at line 2287 of file tripal_feature.module.
{ $sql = " SELECT F.name, F.uniquename, F.feature_id, O.genus, O.species, O.organism_id, CVT.cvterm_id, CVT.name as type_name, CF.nid, array_agg(S.name) as synonyms FROM feature F INNER JOIN organism O on F.organism_id = O.organism_id INNER JOIN cvterm CVT on CVT.cvterm_id = F.type_id LEFT JOIN feature_synonym FS on FS.feature_id = F.feature_id LEFT JOIN synonym S on S.synonym_id = FS.synonym_id INNER JOIN public.chado_feature CF on CF.feature_id = F.feature_id WHERE F.uniquename = '%s' or F.name = '%s' or S.name = '%s' GROUP BY F.name, F.uniquename, F.feature_id, O.genus, O.species, O.organism_id, CVT.cvterm_id, CVT.name, CF.nid "; $results = chado_query($sql, $id, $id, $id); $num_matches = 0; // iterate through the matches and build the table for showing matches $header = array('Uniquename', 'Name', 'Type', 'Species', 'Synonyms'); $rows = array(); $curr_match; while ($match = db_fetch_object($results)) { $curr_match = $match; $synonyms = $match->synonyms; $synonyms = preg_replace('/[\"\{\}]/', '', $synonyms); $rows[] = array( $match->uniquename, "<a href=\"" . url("node/". $match->nid) ."\">" . $match->name . "</a>", $match->type_name, '<i>' . $match->genus . ' ' . $match->species . '</i>', $synonyms, ); $num_matches++; } // if we have more than one match then generate the table, otherwise, redirect // to the matched feature if ($num_matches == 1) { drupal_goto(url("node/". $curr_match->nid)); } if ($num_matches == 0) { return "<p>No features matched the given name '$id'</p>"; } $table_attrs = array( 'class' => 'tripal-table tripal-table-horz' ); $output = "<p>The following features match the name '$id'.</p>"; $output .= theme_table($header, $rows, $table_attrs, $caption); return $output; }