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

Annotation of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (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 : paczian 1.1
13 :     eval {
14 :     &main;
15 :     };
16 :    
17 :     if ($@)
18 :     {
19 : parrello 1.16 my $error = $@;
20 : parrello 1.18 Warn("Script error: $error") if T(SeedViewer => 0);
21 : paczian 1.1
22 : parrello 1.18 print CGI::header();
23 :     print CGI::start_html();
24 : paczian 1.1
25 :     # print out the error
26 : parrello 1.18 print '<pre>'.$error.'</pre>';
27 : paczian 1.1
28 : parrello 1.18 print CGI::end_html();
29 : paczian 1.1
30 :     }
31 :    
32 :     sub main {
33 :    
34 :     # initialize cgi
35 :     my $cgi = new CGI();
36 : parrello 1.24 # Initialize tracing.
37 :     ETracing($cgi);
38 :     if (FIGRules::nmpdr_mode($cgi)) {
39 :     Trace("NMPDR mode selected.") if T(3);
40 : parrello 1.23 my $parms = $cgi->query_string();
41 :     if ($parms) {
42 :     $parms = "?$parms";
43 :     } else {
44 :     $parms = "?page=Home";
45 :     }
46 :     print CGI::redirect(-uri => "$FIG_Config::cgi_url/wiki/rest.cgi/NmpdrPlugin/SeedViewer$parms",
47 :     -status => 301);
48 : parrello 1.15 } else {
49 : parrello 1.24 # initialize layout
50 :     # Use the template file for the current mode-- NMPDR or SEED
51 :     my $templateFile = "./Html/SeedViewer.tmpl";
52 :     Trace("Template file is $templateFile") if T(3);
53 :     my $layout = WebLayout->new($templateFile);
54 :     # Choose the body/header style sheet according to the mode.
55 :     $layout->add_css("$FIG_Config::cgi_url/Html/seedviewer.css");
56 :     $layout->add_css("$FIG_Config::cgi_url/Html/commonviewer.css");
57 :     $layout->add_css("$FIG_Config::cgi_url/Html/default.css");
58 :     # build menu
59 :     my $menu;
60 :     $menu = WebMenu->new();
61 : parrello 1.16 $menu->add_category('&raquo;Navigate', '?page=Home');
62 :     $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
63 :     $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
64 :     $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
65 :     $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
66 : paczian 1.22 $menu->add_entry('&raquo;Navigate', 'BLAST Search', '?page=BlastRun');
67 : parrello 1.24 if (defined($FIG_Config::teacher_db)) {
68 :     $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
69 :     $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
70 :     $menu->add_entry('&raquo;Teacher', 'Class Management', '?page=ManageClass');
71 :     $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
72 :     $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');
73 :     }
74 :     $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
75 :     $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
76 :     $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
77 :     $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
78 :     $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');
79 :     $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
80 : paczian 1.10 $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');
81 : parrello 1.24 # initialize application
82 :     my $WebApp = WebApplication->new( { id => 'SeedViewer',
83 :     menu => $menu,
84 :     layout => $layout,
85 :     default => 'Home',
86 :     } );
87 :     my $prefix = "Seed Viewer - ";
88 :     $WebApp->page_title_prefix($prefix);
89 :     $WebApp->show_login_user_info(1);
90 :     # run application
91 :     $WebApp->run();
92 : parrello 1.6 }
93 : paczian 1.1 }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3