[Bio] / SeedViewer / seedviewer.cgi Repository:
ViewVC logotype

Diff of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12, Tue Feb 5 04:44:46 2008 UTC revision 1.25, Thu Oct 2 10:27:39 2008 UTC
# Line 16  Line 16 
16    
17  if ($@)  if ($@)
18  {  {
19      my $cgi = new CGI();      my $error = $@;
20        Warn("Script error: $error") if T(SeedViewer => 0);
21    
22      print $cgi->header();      print CGI::header();
23      print $cgi->start_html();      print CGI::start_html();
24    
25      # print out the error      # print out the error
26      print '<pre>'.$@.'</pre>';      print '<pre>'.$error.'</pre>';
27    
28      print $cgi->end_html();      print CGI::end_html();
29    
30  }  }
31    
# Line 32  Line 33 
33    
34      # initialize cgi      # initialize cgi
35      my $cgi = new CGI();      my $cgi = new CGI();
36        # Initialize tracing.
37      ETracing($cgi);      ETracing($cgi);
38        if (FIGRules::nmpdr_mode($cgi)) {
39            Trace("NMPDR mode selected.") if T(3);
40            my $parms = $cgi->query_string();
41            if ($parms) {
42                $parms = "?$parms";
43            } else {
44                $parms = "?page=Home";
45            }
46            print CGI::redirect(-uri => "$FIG_Config::cgi_url/wiki/rest.cgi/NmpdrPlugin/SeedViewer$parms",
47                                -status => 301);
48        } else {
49      # initialize layout      # initialize layout
50      # Use the template file for the current mode-- NMPDR or SEED      # Use the template file for the current mode-- NMPDR or SEED
51      my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl' : './Html/SeedViewer.tmpl');          my $templateFile = "./Html/SeedViewer.tmpl";
52      Trace("Template file is $templateFile") if T(3);      Trace("Template file is $templateFile") if T(3);
53      my $layout = WebLayout->new($templateFile);      my $layout = WebLayout->new($templateFile);
     # Start with the normal style.  
     $layout->add_css('./Html/default.css');  
54      # Choose the body/header style sheet according to the mode.      # Choose the body/header style sheet according to the mode.
55      if (FIGRules::nmpdr_mode($cgi)) {          $layout->add_css("$FIG_Config::cgi_url/Html/seedviewer.css");
56          # NMPDR mode.          $layout->add_css("$FIG_Config::cgi_url/Html/commonviewer.css");
57          $layout->add_css('./Html/nmpdrviewer.css');          $layout->add_css("$FIG_Config::cgi_url/Html/default.css");
         # Show the NMPDR version in the header.  
         $layout->set_variable(VERSION => "Sprout version $FIG_Config::nmpdr_version on $ENV{HTTP_HOST}.");  
     } else {  
         # SEED mode.  
         $layout->add_css('./Html/seedviewer.css');  
    }  
     # Add the common styles.  
     $layout->add_css('./Html/commonviewer.css');  
   
     # add site meter  
     my $site_meter = $FIG_Config::site_meter;  
     if ($site_meter) {  
         $layout->add_javascript("http://s20.sitemeter.com/js/counter.js?site=s20nmpdr");  
     }  
   
58      # build menu      # build menu
59      my $menu;      my $menu;
60      $menu = WebMenu->new();      $menu = WebMenu->new();
# Line 67  Line 62 
62      $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');      $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
63      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
64      $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');      $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
65      $menu->add_entry('&raquo;Navigate', '<a>Jump to Feature by</a>');          $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
66      $menu->add_entry('&raquo;Navigate', '&nbsp;&nbsp;BLAST Search', '?page=BlastRun');          $menu->add_entry('&raquo;Navigate', 'BLAST Search', '?page=BlastRun');
     $menu->add_entry('&raquo;Navigate', "<form style='margin: 0px 0px 0px 6px;'>&nbsp;&nbsp;ID&nbsp;&nbsp;<input type='text' name='pattern' style='border: 1px solid #5da668; width: 100px; height: 17px; margin-top: 2px; font-size: 11px;'><input type='hidden' name='page' value='SearchResult'><input type='hidden' name='action' value='check_search'><input type='submit' style='display:none;'></form>");  
   
67      if (defined($FIG_Config::teacher_db)) {      if (defined($FIG_Config::teacher_db)) {
68          $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);          $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
69          $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');          $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
# Line 78  Line 71 
71          $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');          $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
72          $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');          $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');
73      }      }
     #$menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);  
     if (FIGRules::nmpdr_mode($cgi)) {  
         $menu->add_category('&raquo;Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);  
         $menu->add_entry('&raquo;Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");  
         $menu->add_entry('&raquo;Help', 'SEED Viewer Tutorial', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');  
         $menu->add_entry('&raquo;Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contact.php");  
     } else {  
74          $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);          $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
75          $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');          $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
76          $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');          $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
77          $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');          $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
78          $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');  
79            # check which contact info to show
80            if (defined($FIG_Config::server_type) && ($FIG_Config::server_type eq 'MG-RAST')) {
81                $menu->add_entry('&raquo;Help', 'Contact', 'mailto:mg-rast@mcs.anl.gov', undef, ['login']);
82            } elsif (defined($FIG_Config::server_type) && ($FIG_Config::server_type eq 'RAST')) {
83                $menu->add_entry('&raquo;Help', 'Contact', 'mailto:rast@mcs.anl.gov', undef, ['login']);
84            } else {
85                $menu->add_entry('&raquo;Help', 'Contact', 'mailto:info@theseed.org');
86            }
87          $menu->add_entry('&raquo;Help', 'Register', '?page=Register');          $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
88          $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');          $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');
     }  
89      # initialize application      # initialize application
90      my $WebApp = WebApplication->new( { id => 'SeedViewer',      my $WebApp = WebApplication->new( { id => 'SeedViewer',
91                                          menu     => $menu,                                          menu     => $menu,
92                                          layout   => $layout,                                          layout   => $layout,
93                                          default  => 'Home',                                          default  => 'Home',
94                                        } );                                        } );
95      $WebApp->page_title_prefix('SEED Viewer - ');          my $prefix = "Seed Viewer - ";
96            $WebApp->page_title_prefix($prefix);
97      $WebApp->show_login_user_info(1);      $WebApp->show_login_user_info(1);
   
98      # run application      # run application
99      $WebApp->run();      $WebApp->run();
100        }
101  }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.25

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3