[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.5, Mon Nov 26 17:29:08 2007 UTC revision 1.6, Thu Nov 29 16:31:17 2007 UTC
# Line 5  Line 5 
5  use WebApplication;  use WebApplication;
6  use WebMenu;  use WebMenu;
7  use WebLayout;  use WebLayout;
8    use Tracer;
9    use FIGRules;
10  use FIG_Config;  use FIG_Config;
11    
12  eval {  eval {
# Line 29  Line 31 
31    
32      # initialize cgi      # initialize cgi
33      my $cgi = new CGI();      my $cgi = new CGI();
34        ETracing($cgi);
35    
36      # initialize db-master      # initialize db-master
37      #my $dbmaster = DBMaster->new(-database => 'WebAppBackend');      #my $dbmaster = DBMaster->new(-database => 'WebAppBackend');
38    
39      # initialize layout      # initialize layout
40      my $layout = WebLayout->new('./Html/SeedViewer.tmpl');      # Use the template file for the current mode-- NMPDR or SEED
41        my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl'
42                                                       : './Html/SeedViewer.tmpl');
43        Trace("Template file is $templateFile") if T(3);
44        my $layout = WebLayout->new($templateFile);
45        # Start with the normal style.
46      $layout->add_css('./Html/default.css');      $layout->add_css('./Html/default.css');
47        # Choose the body/header style sheet according to the mode.
48        if (FIGRules::nmpdr_mode($cgi)) {
49            # NMPDR mode.
50            $layout->add_css('./Html/nmpdrviewer.css');
51            # Show the NMPDR version in the header.
52            $layout->set_variable(VERSION => "Sprout version $FIG_Config::nmpdr_version on $ENV{HTTP_HOST}.");
53        } else {
54            # SEED mode.
55      $layout->add_css('./Html/seedviewer.css');      $layout->add_css('./Html/seedviewer.css');
56        }
57        # Add the common styles.
58        $layout->add_css('./Html/commonviewer.css');
59    
60      # build menu      # build menu
61      my $menu = WebMenu->new();      my $menu;
62        # For now, NMPDR does not use the menu.
63        $menu = WebMenu->new();
64      $menu->add_category('»Navigate', '?page=Home');      $menu->add_category('»Navigate', '?page=Home');
65      $menu->add_entry('»Navigate', 'Startpage', '?page=Home');      $menu->add_entry('»Navigate', 'Startpage', '?page=Home');
66      $menu->add_entry('»Navigate', 'Organisms', '?page=OrganismSelect');      $menu->add_entry('»Navigate', 'Organisms', '?page=OrganismSelect');
# Line 54  Line 75 
75          $menu->add_entry('»Teacher', 'Problem Sets', '?page=ManageProblemSets');          $menu->add_entry('»Teacher', 'Problem Sets', '?page=ManageProblemSets');
76      }      }
77      $menu->add_category('»Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);      $menu->add_category('»Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);
78        if (FIGRules::nmpdr_mode($cgi)) {
79            $menu->add_category('»Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);
80            $menu->add_entry('»Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");
81            $menu->add_entry('»Help', 'SEED Viewer Tutorial', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
82            $menu->add_entry('»Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contact.php");
83        } else {
84      $menu->add_category('»Help', 'http://www.theseed.org', 'help', undef, 98);      $menu->add_category('»Help', 'http://www.theseed.org', 'help', undef, 98);
85      $menu->add_entry('»Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');      $menu->add_entry('»Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
86      $menu->add_entry('»Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');      $menu->add_entry('»Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
87      $menu->add_entry('»Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');      $menu->add_entry('»Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
88      $menu->add_entry('»Help', 'Contact', 'http://www.theseed.org/wiki/Contact');      $menu->add_entry('»Help', 'Contact', 'http://www.theseed.org/wiki/Contact');
89      $menu->add_entry('»Help', 'Register', '?page=Register');      $menu->add_entry('»Help', 'Register', '?page=Register');
90        }
91      # initialize application      # initialize application
92      my $WebApp = WebApplication->new( { id => 'SeedViewer',      my $WebApp = WebApplication->new( { id => 'SeedViewer',
93                                          #dbmaster => $dbmaster,                                          #dbmaster => $dbmaster,

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3