[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.4, Wed Nov 7 17:09:12 2007 UTC revision 1.16, Tue Apr 29 20:39:07 2008 UTC
# Line 1  Line 1 
1  use strict;  use strict;
2  use warnings;  use warnings;
3    no warnings 'once';
4    
5  use DBMaster;  use DBMaster;
6  use WebApplication;  use WebApplication;
7  use WebMenu;  use WebMenu;
8  use WebLayout;  use WebLayout;
9    use Tracer;
10    use FIGRules;
11    use FIG_Config;
12    
13  eval {  eval {
14      &main;      &main;
# Line 12  Line 16 
16    
17  if ($@)  if ($@)
18  {  {
19        my $error = $@;
20      my $cgi = new CGI();      my $cgi = new CGI();
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        Trace("Script error: $error") if T(0);
27      print '<pre>'.$@.'</pre>';      print '<pre>'.$@.'</pre>';
28    
29      print $cgi->end_html();      print $cgi->end_html();
# Line 29  Line 35 
35      # initialize cgi      # initialize cgi
36      my $cgi = new CGI();      my $cgi = new CGI();
37    
     # initialize db-master  
     my $dbmaster = DBMaster->new(-database => 'WebAppBackend');  
   
38      # initialize layout      # initialize layout
39      my $layout = WebLayout->new('./Html/SeedViewer.tmpl');      # Use the template file for the current mode-- NMPDR or SEED
40      $layout->add_css('./Html/default.css');      my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl' : './Html/SeedViewer.tmpl');
41        Trace("Template file is $templateFile") if T(3);
42        my $layout = WebLayout->new($templateFile);
43        # Choose the body/header style sheet according to the mode.
44        if (FIGRules::nmpdr_mode($cgi)) {
45            # NMPDR mode.
46            $layout->add_css('./Html/nmpdrviewer.css');
47            # Show the NMPDR version in the header.
48            $layout->set_variable(VERSION => "Sprout version $FIG_Config::nmpdr_version on $ENV{HTTP_HOST}.");
49        } else {
50            # SEED mode.
51      $layout->add_css('./Html/seedviewer.css');      $layout->add_css('./Html/seedviewer.css');
52       }
53        # Add the common styles.
54        $layout->add_css('./Html/commonviewer.css');
55        # Add the normal style.
56        $layout->add_css('./Html/default.css');
57      # build menu      # build menu
58      my $menu = WebMenu->new();      my $menu;
59        $menu = WebMenu->new();
60        if (FIGRules::nmpdr_mode($cgi)) {
61      $menu->add_category('&raquo;Navigate', '?page=Home');      $menu->add_category('&raquo;Navigate', '?page=Home');
62      $menu->add_entry('&raquo;Navigate', 'Search', '?page=Home');          $menu->add_entry('&raquo;Navigate', 'NMPDR home', "$FIG_Config::nmpdr_site_url/index.php");
63      $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');          $menu->add_entry('&raquo;Navigate', 'Organisms', "$FIG_Config::nmpdr_site_url/content/organisms.php");
64            $menu->add_entry('&raquo;Navigate', 'Subsystems', "$FIG_Config::nmpdr_site_url/content/subsystems.php");
65            $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
66        } else {
67            $menu->add_category('&raquo;Navigate', '?page=Home');
68            $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
69      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
70            $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
71            $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
72            $menu->add_entry('&raquo;Navigate', '<a>Jump to Feature by</a>');
73            $menu->add_entry('&raquo;Navigate', '&nbsp;&nbsp;BLAST Search', '?page=BlastRun');
74            $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>");
75        }
76        if (defined($FIG_Config::teacher_db)) {
77      $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);      $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
78      $menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);          $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
79            $menu->add_entry('&raquo;Teacher', 'Class Management', '?page=ManageClass');
80            $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
81            $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');
82        }
83        #$menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);
84        if (FIGRules::nmpdr_mode($cgi)) {
85            $menu->add_category('Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);
86            $menu->add_entry('Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");
87            $menu->add_entry('Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contactus.php");
88        } else {
89      $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);      $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
90      $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');
91      $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');
92      $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');
93      $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');      $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');
94      $menu->add_entry('&raquo;Help', 'Register', '?page=Register');      $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
95            $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');
96        }
97      # initialize application      # initialize application
98      my $WebApp = WebApplication->new( { id => 'SeedViewer',      my $WebApp = WebApplication->new( { id => 'SeedViewer',
                                         dbmaster => $dbmaster,  
99                                          menu     => $menu,                                          menu     => $menu,
100                                          layout   => $layout,                                          layout   => $layout,
101                                          default  => 'Home',                                          default  => 'Home',
102                                        } );                                        } );
103        $WebApp->page_title_prefix('SEED Viewer - ');
104        $WebApp->show_login_user_info(1);
105    
106      # run application      # run application
107      $WebApp->run();      $WebApp->run();

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.16

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3