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

Annotation of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (view) (download)

1 : paczian 1.1 use strict;
2 :     use warnings;
3 :    
4 :     use DBMaster;
5 :     use WebApplication;
6 :     use WebMenu;
7 :     use WebLayout;
8 : parrello 1.6 use Tracer;
9 :     use FIGRules;
10 : paczian 1.5 use FIG_Config;
11 : paczian 1.1
12 :     eval {
13 :     &main;
14 :     };
15 :    
16 :     if ($@)
17 :     {
18 :     my $cgi = new CGI();
19 :    
20 :     print $cgi->header();
21 :     print $cgi->start_html();
22 :    
23 :     # print out the error
24 :     print '<pre>'.$@.'</pre>';
25 :    
26 :     print $cgi->end_html();
27 :    
28 :     }
29 :    
30 :     sub main {
31 :    
32 :     # initialize cgi
33 :     my $cgi = new CGI();
34 : parrello 1.6 ETracing($cgi);
35 : paczian 1.1
36 :     # initialize db-master
37 : paczian 1.5 #my $dbmaster = DBMaster->new(-database => 'WebAppBackend');
38 : paczian 1.1
39 :     # initialize layout
40 : parrello 1.6 # 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 : paczian 1.4 $layout->add_css('./Html/default.css');
47 : parrello 1.6 # 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');
56 :     }
57 :     # Add the common styles.
58 :     $layout->add_css('./Html/commonviewer.css');
59 : paczian 1.1
60 :     # build menu
61 : parrello 1.6 my $menu;
62 :     # For now, NMPDR does not use the menu.
63 :     $menu = WebMenu->new();
64 : paczian 1.2 $menu->add_category('&raquo;Navigate', '?page=Home');
65 : paczian 1.5 $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
66 :     $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
67 : paczian 1.3 $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
68 : paczian 1.5 $menu->add_entry('&raquo;Navigate', 'Blast', '?page=BlastRun');
69 :     $menu->add_entry('&raquo;Navigate', "<form style='margin: 0px 0px 0px 6px;'>ID&nbsp;&nbsp;<input type='text' name='pattern' style='border: 1px solid #5da668; width: 120px; 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>");
70 :    
71 :     if (defined($FIG_Config::teacher_db)) {
72 : parrello 1.6 $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
73 :     $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
74 :     $menu->add_entry('&raquo;Teacher', 'Class Management', '?page=ManageClass');
75 :     $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
76 : paczian 1.5 }
77 : paczian 1.4 $menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);
78 : parrello 1.6 if (FIGRules::nmpdr_mode($cgi)) {
79 :     $menu->add_category('&raquo;Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);
80 :     $menu->add_entry('&raquo;Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");
81 :     $menu->add_entry('&raquo;Help', 'SEED Viewer Tutorial', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
82 :     $menu->add_entry('&raquo;Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contact.php");
83 :     } else {
84 :     $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
85 :     $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
86 :     $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
87 :     $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
88 :     $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');
89 :     $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
90 :     }
91 : paczian 1.1 # initialize application
92 :     my $WebApp = WebApplication->new( { id => 'SeedViewer',
93 : paczian 1.5 #dbmaster => $dbmaster,
94 : paczian 1.1 menu => $menu,
95 :     layout => $layout,
96 :     default => 'Home',
97 :     } );
98 : paczian 1.5 $WebApp->show_login_user_info(1);
99 : paczian 1.1
100 :     # run application
101 :     $WebApp->run();
102 :    
103 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3