]> git.donarmstrong.com Git - biopieces.git/commitdiff
added permalink to BGB
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 15 Dec 2009 15:23:05 +0000 (15:23 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 15 Dec 2009 15:23:05 +0000 (15:23 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@819 74ccb610-7750-0410-82ae-013aeee3265d

www/index.cgi

index f5d409c006784288fee4aa4da1ec6ab40e534d49..57982acc34779854793bc5869fd29f5a837ee8e0 100755 (executable)
@@ -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.