From c50910201f3615aa039fec00acb7e4bf39ba774b Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 15 Dec 2009 15:23:05 +0000 Subject: [PATCH] added permalink to BGB git-svn-id: http://biopieces.googlecode.com/svn/trunk@819 74ccb610-7750-0410-82ae-013aeee3265d --- www/index.cgi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/www/index.cgi b/www/index.cgi index f5d409c..57982ac 100755 --- a/www/index.cgi +++ b/www/index.cgi @@ -122,6 +122,8 @@ sub cookie_default $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->{ 'S_BEG' } = $cgi->param( 's_beg' ); $cookie->{ 'S_END' } = $cgi->param( 's_end' ); $cookie->{ 'STRAND' } = $cgi->param( 'strand' ); @@ -577,6 +579,7 @@ sub page_browse 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; } @@ -879,6 +882,37 @@ sub section_browse } +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. -- 2.39.2