Tripal v1.0 (6.x-1.0)
|
Public Member Functions | |
construct () | |
query () | |
render ($values) |
Definition at line 10 of file views_handler_field_dbxref_accession_link.inc.
views_handler_field_dbxref_accession_link::construct | ( | ) |
Definition at line 11 of file views_handler_field_dbxref_accession_link.inc.
{ parent::construct(); $this->additional_fields['accession'] = 'accession'; $this->additional_fields['db_id'] = 'db_id'; }
views_handler_field_dbxref_accession_link::query | ( | ) |
Definition at line 19 of file views_handler_field_dbxref_accession_link.inc.
{ $this->ensure_my_table(); $this->add_additional_fields(); }
views_handler_field_dbxref_accession_link::render | ( | $ | values | ) |
Definition at line 24 of file views_handler_field_dbxref_accession_link.inc.
{ $accession = $values->{$this->aliases['accession']}; $db_id = $values->{$this->aliases['db_id']}; if (!empty($db_id) AND !empty($accession)) { // @coder-ignore: non-drupal schema therefore table prefixing does not apply $result = db_fetch_object(chado_query('SELECT urlprefix FROM db WHERE db_id=%d', $db_id)); $urlprefix = $result->urlprefix; if (!empty($urlprefix)) { $accession_link = $urlprefix . $accession; return $accession_link; } else { return $accession; } } else { return $accession; } }