[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.7, Thu Dec 6 21:17:47 2007 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 28  Line 32 
32    
33      # initialize cgi      # initialize cgi
34      my $cgi = new CGI();      my $cgi = new CGI();
35        ETracing($cgi);
     # initialize db-master  
     my $dbmaster = DBMaster->new(-database => 'WebAppBackend');  
36    
37      # initialize layout      # initialize layout
38      my $layout = WebLayout->new('./Html/SeedViewer.tmpl');      # Use the template file for the current mode-- NMPDR or SEED
39        my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl' : './Html/SeedViewer.tmpl');
40        Trace("Template file is $templateFile") if T(3);
41        my $layout = WebLayout->new($templateFile);
42        # Start with the normal style.
43      $layout->add_css('./Html/default.css');      $layout->add_css('./Html/default.css');
44        # Choose the body/header style sheet according to the mode.
45        if (FIGRules::nmpdr_mode($cgi)) {
46            # NMPDR mode.
47            $layout->add_css('./Html/nmpdrviewer.css');
48            # Show the NMPDR version in the header.
49            $layout->set_variable(VERSION => "Sprout version $FIG_Config::nmpdr_version on $ENV{HTTP_HOST}.");
50        } else {
51            # SEED mode.
52      $layout->add_css('./Html/seedviewer.css');      $layout->add_css('./Html/seedviewer.css');
53       }
54        # Add the common styles.
55        $layout->add_css('./Html/commonviewer.css');
56    
57      # build menu      # build menu
58      my $menu = WebMenu->new();      my $menu;
59        # For now, NMPDR does not use the menu.
60        $menu = WebMenu->new();
61      $menu->add_category('»Navigate', '?page=Home');      $menu->add_category('»Navigate', '?page=Home');
62      $menu->add_entry('»Navigate', 'Search', '?page=Home');      $menu->add_entry('»Navigate', 'Startpage', '?page=Home');
     $menu->add_entry('»Navigate', 'Subsystems', '?page=SubsystemSelect');  
63      $menu->add_entry('»Navigate', 'Organisms', '?page=OrganismSelect');      $menu->add_entry('»Navigate', 'Organisms', '?page=OrganismSelect');
64        $menu->add_entry('»Navigate', 'Subsystems', '?page=SubsystemSelect');
65        $menu->add_entry('»Navigate', 'Search by', '?page=Home');
66        $menu->add_entry('»Navigate', '  - BLAST', '?page=BlastRun');
67        $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>");
68    
69        if (defined($FIG_Config::teacher_db)) {
70      $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);      $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
71            $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
72            $menu->add_entry('&raquo;Teacher', 'Class Management', '?page=ManageClass');
73            $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
74            $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');
75        }
76      $menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);      $menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);
77        if (FIGRules::nmpdr_mode($cgi)) {
78            $menu->add_category('&raquo;Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);
79            $menu->add_entry('&raquo;Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");
80            $menu->add_entry('&raquo;Help', 'SEED Viewer Tutorial', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
81            $menu->add_entry('&raquo;Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contact.php");
82        } else {
83      $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);      $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
84      $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');
85      $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');
86      $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');
87      $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');      $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');
88      $menu->add_entry('&raquo;Help', 'Register', '?page=Register');      $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
89        }
90      # initialize application      # initialize application
91      my $WebApp = WebApplication->new( { id => 'SeedViewer',      my $WebApp = WebApplication->new( { id => 'SeedViewer',
                                         dbmaster => $dbmaster,  
92                                          menu     => $menu,                                          menu     => $menu,
93                                          layout   => $layout,                                          layout   => $layout,
94                                          default  => 'Home',                                          default  => 'Home',
95                                        } );                                        } );
96        $WebApp->page_title_prefix('SEED Viewer - ');
97        $WebApp->show_login_user_info(1);
98    
99      # run application      # run application
100      $WebApp->run();      $WebApp->run();

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3