X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=www%2Findex.cgi;h=64314fa6520ff70122f3b54af9e6c473c8ee0665;hb=bdcd4e373c9a3361781e5f171d2d60166c46dc3d;hp=1dfeb539862cb92daf81e3f598a109b5366e6aab;hpb=b4a75987b58663bc56169d189771641cbfbbd146;p=biopieces.git diff --git a/www/index.cgi b/www/index.cgi index 1dfeb53..64314fa 100755 --- a/www/index.cgi +++ b/www/index.cgi @@ -29,6 +29,7 @@ use CGI; use URI::Escape; use Data::Dumper; use Digest::MD5; +use Time::HiRes; use Maasha::Common; use Maasha::Filesys; use Maasha::Calc; @@ -147,8 +148,8 @@ sub cookie_default $cookie->{ 'NAV_START' } ||= defined $cgi->param( 'nav_start' ) ? $cgi->param( 'nav_start' ) : $session->{ 'NAV_START' }; $cookie->{ 'NAV_END' } ||= defined $cgi->param( 'nav_end' ) ? $cgi->param( 'nav_end' ) : $session->{ 'NAV_END' }; $cookie->{ 'NAV_CENTER' } = $cgi->param( 'nav_center' ); - $cookie->{ 'S_BEG' } = $cgi->param( 's_beg' ) || $session->{ 'S_BEG' }; - $cookie->{ 'S_END' } = $cgi->param( 's_end' ) || $session->{ 'S_END' }; + $cookie->{ 'S_BEG' } = defined $cgi->param( 's_beg' ) ? $cgi->param( 's_beg' ) : $session->{ 'S_BEG' }; + $cookie->{ 'S_END' } = defined $cgi->param( 's_end' ) ? $cgi->param( 's_end' ) : $session->{ 'S_END' }; $cookie->{ 'STRAND' } = $cgi->param( 'strand' ) || $session->{ 'STRAND' }; $cookie->{ 'TRACK' } = $cgi->param( 'track' ); $cookie->{ 'ZOOM_IN1' } = $cgi->param( 'zoom_in1' ); @@ -182,9 +183,21 @@ sub cookie_default if ( $cookie->{ 'USER' } and not $cookie->{ 'LOGIN_ERROR' } ) { $cookie->{ 'LIST_CLADE' } = Maasha::BGB::Track::list_clades( $cookie->{ 'USER' } ); - $cookie->{ 'LIST_GENOME' } = Maasha::BGB::Track::list_genomes( $cookie->{ 'USER' }, $cookie->{ 'CLADE' } ); - $cookie->{ 'LIST_ASSEMBLY' } = Maasha::BGB::Track::list_assemblies( $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' } ); - $cookie->{ 'LIST_CONTIG' } = Maasha::BGB::Track::list_contigs( $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' }, $cookie->{ 'ASSEMBLY' } ); + + if ( $cookie->{ 'CLADE' } ) + { + $cookie->{ 'LIST_GENOME' } = Maasha::BGB::Track::list_genomes( $cookie->{ 'USER' }, $cookie->{ 'CLADE' } ); + + if ( $cookie->{ 'GENOME' } ) + { + $cookie->{ 'LIST_ASSEMBLY' } = Maasha::BGB::Track::list_assemblies( $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' } ); + + if ( $cookie->{ 'ASSEMBLY' } ) + { + $cookie->{ 'LIST_CONTIG' } = Maasha::BGB::Track::list_contigs( $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' }, $cookie->{ 'ASSEMBLY' } ); + } + } + } if ( $cookie->{ 'CONTIG' } ) { @@ -271,7 +284,7 @@ sub session_store { $new_session->{ 'CLADE' } = $cookie->{ 'CLADE' }; } - elsif ( $cookie->{ 'PAGE' } eq 'export' ) + elsif ( $cookie->{ 'PAGE' } =~ /export|dna/ ) { $new_session->{ 'CLADE' } = $cookie->{ 'CLADE' }; $new_session->{ 'GENOME' } = $cookie->{ 'GENOME' }; @@ -1559,3 +1572,7 @@ sub section_dna __END__ + + + # my $t0 = Time::HiRes::gettimeofday(); + # my $t1 = Time::HiRes::gettimeofday(); print STDERR "Time: " . ( $t1 - $t0 ) . "\n";