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

Annotation of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (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.19 Trace("In error recovery with message $error") if T(3);
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 :    
38 :     # initialize layout
39 : parrello 1.6 # Use the template file for the current mode-- NMPDR or SEED
40 : paczian 1.7 my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl' : './Html/SeedViewer.tmpl');
41 : parrello 1.6 Trace("Template file is $templateFile") if T(3);
42 :     my $layout = WebLayout->new($templateFile);
43 :     # Choose the body/header style sheet according to the mode.
44 :     if (FIGRules::nmpdr_mode($cgi)) {
45 :     # NMPDR mode.
46 :     $layout->add_css('./Html/nmpdrviewer.css');
47 : parrello 1.17 # Display the official NMPDR icon for this machine.
48 :     $layout->add_metatag("<link rel=\"icon\" href=\"${FIG_Config::cgi_base}wiki/pub/logos/nmpdr.ico\" type=\"image/x-icon\" />");
49 :     $layout->add_metatag("<link rel=\"shortcut icon\" href=\"${FIG_Config::cgi_base}wiki/pub/logos/nmpdr.ico\" type=\"image/x-icon\" />");
50 : parrello 1.6 } else {
51 :     # SEED mode.
52 :     $layout->add_css('./Html/seedviewer.css');
53 : paczian 1.7 }
54 : parrello 1.6 # Add the common styles.
55 :     $layout->add_css('./Html/commonviewer.css');
56 : parrello 1.15 # Add the normal style.
57 :     $layout->add_css('./Html/default.css');
58 : paczian 1.1 # build menu
59 : parrello 1.6 my $menu;
60 :     $menu = WebMenu->new();
61 : parrello 1.16 if (FIGRules::nmpdr_mode($cgi)) {
62 : parrello 1.15 $menu->add_category('&raquo;Navigate', '?page=Home');
63 :     $menu->add_entry('&raquo;Navigate', 'NMPDR home', "$FIG_Config::nmpdr_site_url/index.php");
64 :     $menu->add_entry('&raquo;Navigate', 'Organisms', "$FIG_Config::nmpdr_site_url/content/organisms.php");
65 :     $menu->add_entry('&raquo;Navigate', 'Subsystems', "$FIG_Config::nmpdr_site_url/content/subsystems.php");
66 :     $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
67 :     } else {
68 : parrello 1.16 $menu->add_category('&raquo;Navigate', '?page=Home');
69 :     $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
70 :     $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
71 :     $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
72 :     $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
73 :     $menu->add_entry('&raquo;Navigate', '<a>Jump to Feature by</a>');
74 :     $menu->add_entry('&raquo;Navigate', '&nbsp;&nbsp;BLAST Search', '?page=BlastRun');
75 :     $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>");
76 : parrello 1.15 }
77 : paczian 1.5 if (defined($FIG_Config::teacher_db)) {
78 : parrello 1.6 $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
79 :     $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
80 :     $menu->add_entry('&raquo;Teacher', 'Class Management', '?page=ManageClass');
81 :     $menu->add_entry('&raquo;Teacher', 'Problem Sets', '?page=ManageProblemSets');
82 : paczian 1.7 $menu->add_entry('&raquo;Teacher', 'Annotation Resolve', '?page=ClassAnnotationResolve');
83 : paczian 1.5 }
84 : paczian 1.11 #$menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);
85 : parrello 1.6 if (FIGRules::nmpdr_mode($cgi)) {
86 : parrello 1.15 $menu->add_category('Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);
87 :     $menu->add_entry('Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");
88 :     $menu->add_entry('Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contactus.php");
89 : parrello 1.6 } else {
90 :     $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
91 :     $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');
92 :     $menu->add_entry('&raquo;Help', 'HowTo use the SEED Viewer', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');
93 :     $menu->add_entry('&raquo;Help', 'Submitting Data to SEED', 'http://www.theseed.org/wiki/RAST_Tutorial');
94 :     $menu->add_entry('&raquo;Help', 'Contact', 'http://www.theseed.org/wiki/Contact');
95 :     $menu->add_entry('&raquo;Help', 'Register', '?page=Register');
96 : paczian 1.10 $menu->add_entry('&raquo;Help', 'I forgot my Password', '?page=RequestNewPassword');
97 : parrello 1.6 }
98 : paczian 1.1 # initialize application
99 :     my $WebApp = WebApplication->new( { id => 'SeedViewer',
100 :     menu => $menu,
101 :     layout => $layout,
102 :     default => 'Home',
103 :     } );
104 : parrello 1.19 my $prefix = (FIGRules::nmpdr_mode($cgi) ? "NMPDR " : "") . "Seed Viewer - ";
105 :     $WebApp->page_title_prefix($prefix);
106 : paczian 1.5 $WebApp->show_login_user_info(1);
107 : paczian 1.1
108 :     # run application
109 :     $WebApp->run();
110 :    
111 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3