Skip to content
Snippets Groups Projects
Commit fea23916 authored by Anthony Bretaudeau's avatar Anthony Bretaudeau
Browse files

backport fixes from bbip

parent f72d8d9f
No related branches found
No related tags found
1 merge request!1Merge upstream
......@@ -157,7 +157,7 @@
<?php if (getenv('ENABLE_JBROWSE')): ?>
<?php
if (getenv('ENABLE_JBROWSE') == "1")
$url = '/jbrowse';
$url = '/jbrowse/';
else
$url = getenv('ENABLE_JBROWSE');
?>
......
......@@ -168,7 +168,7 @@ if (isset($node) && $node->type == "chado_feature") {
<?php if (getenv('ENABLE_JBROWSE')): ?>
<?php
if (getenv('ENABLE_JBROWSE') == "1")
$url = '/jbrowse';
$url = '/jbrowse/';
else
$url = getenv('ENABLE_JBROWSE');
?>
......
......@@ -72,6 +72,17 @@ if(count($alignments) > 0){ ?>
// https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
$rows = array();
if (getenv('ENABLE_APOLLO') == "1")
$url_apollo_base = $GLOBALS['base_url'] . '/apollo/annotator/loadLink?';
else {
// Some url was given
$url_apollo_base = getenv('ENABLE_APOLLO');
if (strpos($url_apollo_base, '?') !== false)
$url_apollo_base .= '&';
else
$url_apollo_base .= 'annotator/loadLink?';
}
foreach ($alignments as $alignment){
$feature_name = $alignment->name;
if (property_exists($alignment, 'nid')) {
......@@ -111,7 +122,7 @@ if(count($alignments) > 0){ ?>
foreach ($dlist as $delem) {
$d = explode('>', $delem);
if ($cur_org === $d[0] || substr($alignment->name, 0, strlen($d[0])) === $d[0]) {
$url = "/jbrowse?data=data/".$d[1]."&";
$url = "/jbrowse/?data=data/".$d[1]."&";
$found_link = true;
break;
}
......@@ -120,7 +131,7 @@ if(count($alignments) > 0){ ?>
if (!$found_link) {
if (getenv('ENABLE_JBROWSE') == "1")
$url = '/jbrowse?';
$url = '/jbrowse/?';
else {
// Some url was given
$url = getenv('ENABLE_JBROWSE');
......@@ -145,7 +156,7 @@ if(count($alignments) > 0){ ?>
foreach ($dlist as $delem) {
$d = explode('>', $delem);
if ($cur_org === $d[0] || substr($alignment->name, 0, strlen($d[0])) === $d[0]) {
$url = "/apollo/annotator/loadLink?organism=".$d[1]."&";
$url = $url_apollo_base."organism=".$d[1]."&";
$found_link = true;
break;
}
......@@ -153,21 +164,12 @@ if(count($alignments) > 0){ ?>
}
if (!$found_link) {
if (getenv('ENABLE_APOLLO') == "1")
$url = $GLOBALS['base_url'] . '/apollo/annotator/loadLink?';
else {
// Some url was given
$url = getenv('ENABLE_APOLLO');
if (strpos($url, '?') !== false)
$url .= '&';
else
$url .= 'annotator/loadLink?';
}
$org_name = $feature->organism_id->genus . ' ' . $feature->organism_id->species;
$apollo_org = "&organism=" . $org_name;
if (array_key_exists($feature->organism_id->organism_id, $genome_versions)) {
$apollo_org .= ' ' . $genome_versions[$feature->organism_id->organism_id]->version;
}
$url = $url_apollo_base.$apollo_org;
}
$feature_loc .= " &nbsp;&nbsp; View in <a href='".$url."loc=".$alignment->name."%3A".($alignment->fmin + 1)."..".$alignment->fmax.$apollo_org."'>Apollo</a>";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment