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

Annotation of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (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 :     my $cgi = new CGI();
20 :    
21 :     print $cgi->header();
22 :     print $cgi->start_html();
23 :    
24 :     # print out the error
25 :     print '<pre>'.$@.'</pre>';
26 :    
27 :     print $cgi->end_html();
28 :    
29 :     }
30 :    
31 :     sub main {
32 :    
33 :     # initialize cgi
34 :     my $cgi = new CGI();
35 : parrello 1.6 ETracing($cgi);
36 : paczian 1.1
37 :     # initialize layout
38 : parrello 1.6 # Use the template file for the current mode-- NMPDR or SEED
39 : paczian 1.7 my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl' : './Html/SeedViewer.tmpl');
40 : parrello 1.6 Trace("Template file is $templateFile") if T(3);
41 :     my $layout = WebLayout->new($templateFile);
42 :     # Choose the body/header style sheet according to the mode.
43 :     if (FIGRules::nmpdr_mode($cgi)) {
44 :     # NMPDR mode.
45 :     $layout->add_css('./Html/nmpdrviewer.css');
46 :     # Show the NMPDR version in the header.
47 :     $layout->set_variable(VERSION => "Sprout version $FIG_Config::nmpdr_version on $ENV{HTTP_HOST}.");
48 :     } else {
49 :     # SEED mode.
50 :     $layout->add_css('./Html/seedviewer.css');
51 : paczian 1.7 }
52 : parrello 1.6 # Add the common styles.
53 :     $layout->add_css('./Html/commonviewer.css');
54 : parrello 1.15 # Add the normal style.
55 :     $layout->add_css('./Html/default.css');
56 : paczian 1.9 # add site meter
57 :     my $site_meter = $FIG_Config::site_meter;
58 :     if ($site_meter) {
59 :     $layout->add_javascript("http://s20.sitemeter.com/js/counter.js?site=s20nmpdr");
60 :     }
61 :    
62 : paczian 1.1 # build menu
63 : parrello 1.6 my $menu;
64 :     $menu = WebMenu->new();
65 : parrello 1.15 if (FIGRules::nmpdr_mode($cgi)) {
66 :     $menu->add_category('&raquo;Navigate', '?page=Home');
67 :     $menu->add_entry('&raquo;Navigate', 'NMPDR home', "$FIG_Config::nmpdr_site_url/index.php");
68 :     $menu->add_entry('&raquo;Navigate', 'Organisms', "$FIG_Config::nmpdr_site_url/content/organisms.php");
69 :     $menu->add_entry('&raquo;Navigate', 'Subsystems', "$FIG_Config::nmpdr_site_url/content/subsystems.php");
70 :     $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
71 :     } else {
72 : paczian 1.2 $menu->add_category('&raquo;Navigate', '?page=Home');
73 : paczian 1.5 $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
74 :     $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
75 : paczian 1.3 $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
76 : paczian 1.13 $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
77 : paczian 1.10 $menu->add_entry('&raquo;Navigate', '<a>Jump to Feature by</a>');
78 :     $menu->add_entry('&raquo;Navigate', '&nbsp;&nbsp;BLAST Search', '?page=BlastRun');
79 : parrello 1.15 $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>");
80 :     }
81 : paczian 1.5 if (defined($FIG_Config::teacher_db)) {
82 : parrello 1.6 $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
83 :     $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
84 :     $menu->add_entry('&raquo;Teacher', 'Class Management', '?page=ManageClass');
85 :     $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
86 : paczian 1.7 $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');
87 : paczian 1.5 }
88 : paczian 1.11 #$menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);
89 : parrello 1.6 if (FIGRules::nmpdr_mode($cgi)) {
90 : parrello 1.15 $menu->add_category('Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);
91 :     $menu->add_entry('Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");
92 :     $menu->add_entry('Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contactus.php");
93 : parrello 1.6 } else {
94 :     $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
95 :     $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
96 :     $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
97 :     $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
98 :     $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');
99 :     $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
100 : paczian 1.10 $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');
101 : parrello 1.6 }
102 : paczian 1.1 # initialize application
103 :     my $WebApp = WebApplication->new( { id => 'SeedViewer',
104 :     menu => $menu,
105 :     layout => $layout,
106 :     default => 'Home',
107 :     } );
108 : paczian 1.7 $WebApp->page_title_prefix('SEED Viewer - ');
109 : paczian 1.5 $WebApp->show_login_user_info(1);
110 : paczian 1.1
111 :     # run application
112 :     $WebApp->run();
113 :    
114 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3