use lib $ENV{ 'BP_PERL' };
use CGI;
+use URI::Escape;
use Data::Dumper;
use Digest::MD5;
use Maasha::Common;
$cookie->{ 'ASSEMBLY' } = $cgi->param( 'assembly' ) || '';
$cookie->{ 'CONTIG' } = $cgi->param( 'contig' ) || '';
$cookie->{ 'Q_ID' } = $cgi->param( 'q_id' );
- $cookie->{ 'NAV_START' } ||= $cgi->param( 'nav_start' );
- $cookie->{ 'NAV_END' } ||= $cgi->param( 'nav_end' );
+ $cookie->{ 'NAV_START' } ||= $cgi->param( 'nav_start' ) || $cgi->param( 's_beg' ); # FIXME this is ugly!
+ $cookie->{ 'NAV_END' } ||= $cgi->param( 'nav_end' ) || $cgi->param( 's_end' );
$cookie->{ 'S_BEG' } = $cgi->param( 's_beg' );
$cookie->{ 'S_END' } = $cgi->param( 's_end' );
$cookie->{ 'STRAND' } = $cgi->param( 'strand' );
$cookie->{ 'PAGE' } = 'login';
print STDERR "HER4"; # DEBUG
print STDERR "NO COOKIE SESSION ID\n" if not $cookie->{ 'SESSION_ID' }; # DEBUG
- print STDERR "NO COOKIE SESSION ID\n" if not $cookie->{ 'USER' }; # DEBUG
+ print STDERR "NO COOKIE USER\n" if not $cookie->{ 'USER' }; # DEBUG
print STDERR "NO SESSION USER\n" if not exists $session->{ $cookie->{ 'USER' } }; # DEBUG
}
}
$href_hash{ "nav_search" } = "$cookie->{ 'NAV_START' }-$cookie->{ 'NAV_END' }";
}
+ $href_hash{ "q_id" } = URI::Escape::uri_escape( $cookie->{ 'Q_ID' } ) if defined $cookie->{ 'Q_ID' };
$href_hash{ "s_beg" } = $cookie->{ 'S_BEG' } if defined $cookie->{ 'S_BEG' };
$href_hash{ "s_end" } = $cookie->{ 'S_END' } if defined $cookie->{ 'S_END' };
- $href_hash{ "q_id" } = $cookie->{ 'Q_ID' } if defined $cookie->{ 'Q_ID' };
$href_hash{ "strand" } = $cookie->{ 'STRAND' } if defined $cookie->{ 'STRAND' };
$href_hash{ "session_id" } = $cookie->{ 'SESSION_ID' } if defined $cookie->{ 'SESSION_ID' };
}
if ( $cookie->{ 'SESSION_ID' } ) {
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "session_id", value => "$cookie->{ 'SESSION_ID' }" ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "session_id", value => $cookie->{ 'SESSION_ID' } ) );
}
return wantarray ? @html : \@html;
push @html, section_taxonomy_table( $cookie );
push @html, section_navigate( $cookie );
push @html, section_browse( $cookie );
- push @html, section_permalink( $cookie );
return wantarray ? @html : \@html;
}
push @html, Maasha::XHTML::table_end;
push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "page", value => "browse" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "user", value => "$cookie->{ 'USER' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "clade", value => "$cookie->{ 'CLADE' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "genome", value => "$cookie->{ 'GENOME' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "assembly", value => "$cookie->{ 'ASSEMBLY' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "contig", value => "$cookie->{ 'CONTIG' }" ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "user", value => $cookie->{ 'USER' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "clade", value => $cookie->{ 'CLADE' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "genome", value => $cookie->{ 'GENOME' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "assembly", value => $cookie->{ 'ASSEMBLY' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "contig", value => $cookie->{ 'CONTIG' } ) );
return wantarray ? @html : \@html;
}
}
-sub section_permalink
-{
- # Martin A. Hansen, December 2009.
-
- # Return HTML with a permanent link to current browser view.
-
- my ( $cookie, # cookie hash
- ) = @_;
-
- # Returns a list.
-
- my ( $href, @html );
-
- $href = join( "&",
- "$cookie->{ 'SCRIPT' }?page=browse",
- "user=$cookie->{ 'USER' }",
- "clade=$cookie->{ 'CLADE' }",
- "genome=$cookie->{ 'GENOME' }",
- "assembly=$cookie->{ 'ASSEMBLY' }",
- "contig=$cookie->{ 'CONTIG' }",
- "nav_start=$cookie->{ 'NAV_START' }",
- "nav_end=$cookie->{ 'NAV_END' }",
- "session_id=$cookie->{ 'SESSION_ID' }",
- );
-
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::ln( txt => "Permalink", href => $href ), class => 'center' );
-
- return wantarray ? @html : \@html;
-}
-
-
sub section_export
{
# Martin A. Hansen, November 2009.
push @html, Maasha::XHTML::table_row_simple( tr => \@row_dna_contig );
push @html, Maasha::XHTML::table_end;
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "page", value => "dna" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "user", value => "$cookie->{ 'USER' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "clade", value => "$cookie->{ 'CLADE' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "genome", value => "$cookie->{ 'GENOME' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "assembly", value => "$cookie->{ 'ASSEMBLY' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "contig", value => "$cookie->{ 'CONTIG' }" ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "page", value => "dna" ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "user", value => $cookie->{ 'USER' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "clade", value => $cookie->{ 'CLADE' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "genome", value => $cookie->{ 'GENOME' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "assembly", value => $cookie->{ 'ASSEMBLY' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "contig", value => $cookie->{ 'CONTIG' } ) );
return wantarray ? @html : \@html;
}