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

Annotation of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.27 - (view) (download)

1 : paczian 1.1 use strict;
2 :     use warnings;
3 : paczian 1.7 no warnings 'once';
4 : paczian 1.1
5 :     use DBMaster;
6 :     use WebApplication;
7 :     use WebMenu;
8 :     use WebLayout;
9 : parrello 1.6 use Tracer;
10 :     use FIGRules;
11 : paczian 1.5 use FIG_Config;
12 : olson 1.26 use WebConfig;
13 : paczian 1.1
14 :     eval {
15 :     &main;
16 :     };
17 :    
18 :     if ($@)
19 :     {
20 : parrello 1.16 my $error = $@;
21 : parrello 1.18 Warn("Script error: $error") if T(SeedViewer => 0);
22 : paczian 1.1
23 : parrello 1.18 print CGI::header();
24 :     print CGI::start_html();
25 : paczian 1.1
26 :     # print out the error
27 : parrello 1.18 print '<pre>'.$error.'</pre>';
28 : paczian 1.1
29 : parrello 1.18 print CGI::end_html();
30 : paczian 1.1
31 :     }
32 :    
33 :     sub main {
34 :    
35 :     # initialize cgi
36 :     my $cgi = new CGI();
37 : parrello 1.24 # Initialize tracing.
38 :     ETracing($cgi);
39 :     if (FIGRules::nmpdr_mode($cgi)) {
40 :     Trace("NMPDR mode selected.") if T(3);
41 : parrello 1.23 my $parms = $cgi->query_string();
42 :     if ($parms) {
43 :     $parms = "?$parms";
44 :     } else {
45 :     $parms = "?page=Home";
46 :     }
47 :     print CGI::redirect(-uri => "$FIG_Config::cgi_url/wiki/rest.cgi/NmpdrPlugin/SeedViewer$parms",
48 :     -status => 301);
49 : parrello 1.15 } else {
50 : parrello 1.24 # initialize layout
51 :     # Use the template file for the current mode-- NMPDR or SEED
52 : olson 1.26 my $templateFile = TMPL_PATH . "/SeedViewer.tmpl";
53 : parrello 1.24 Trace("Template file is $templateFile") if T(3);
54 :     my $layout = WebLayout->new($templateFile);
55 :     # Choose the body/header style sheet according to the mode.
56 :     $layout->add_css("$FIG_Config::cgi_url/Html/seedviewer.css");
57 :     $layout->add_css("$FIG_Config::cgi_url/Html/commonviewer.css");
58 :     $layout->add_css("$FIG_Config::cgi_url/Html/default.css");
59 :     # build menu
60 :     my $menu;
61 :     $menu = WebMenu->new();
62 : parrello 1.16 $menu->add_category('&raquo;Navigate', '?page=Home');
63 :     $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
64 :     $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
65 :     $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
66 : paczian 1.27 $menu->add_entry('&raquo;Navigate', 'Scenarios', '?page=Scenarios');
67 : parrello 1.16 $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
68 : paczian 1.22 $menu->add_entry('&raquo;Navigate', 'BLAST Search', '?page=BlastRun');
69 : parrello 1.24 if (defined($FIG_Config::teacher_db)) {
70 :     $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;Help', 'http://www.theseed.org', 'help', undef, 98);
77 :     $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
78 :     $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
79 :     $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
80 : paczian 1.25
81 :     # check which contact info to show
82 :     if (defined($FIG_Config::server_type) && ($FIG_Config::server_type eq 'MG-RAST')) {
83 :     $menu->add_entry('&raquo;Help', 'Contact', 'mailto:mg-rast@mcs.anl.gov', undef, ['login']);
84 :     } elsif (defined($FIG_Config::server_type) && ($FIG_Config::server_type eq 'RAST')) {
85 :     $menu->add_entry('&raquo;Help', 'Contact', 'mailto:rast@mcs.anl.gov', undef, ['login']);
86 :     } else {
87 :     $menu->add_entry('&raquo;Help', 'Contact', 'mailto:info@theseed.org');
88 :     }
89 : parrello 1.24 $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
90 : paczian 1.10 $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');
91 : parrello 1.24 # initialize application
92 :     my $WebApp = WebApplication->new( { id => 'SeedViewer',
93 :     menu => $menu,
94 :     layout => $layout,
95 :     default => 'Home',
96 :     } );
97 :     my $prefix = "Seed Viewer - ";
98 :     $WebApp->page_title_prefix($prefix);
99 :     $WebApp->show_login_user_info(1);
100 :     # run application
101 :     $WebApp->run();
102 : parrello 1.6 }
103 : paczian 1.1 }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3