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

Diff of /SeedViewer/seedviewer.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12, Tue Feb 5 04:44:46 2008 UTC revision 1.18, Wed May 7 23:04:08 2008 UTC
# Line 16  Line 16 
16    
17  if ($@)  if ($@)
18  {  {
19      my $cgi = new CGI();      my $error = $@;
20        Warn("Script error: $error") if T(SeedViewer => 0);
21    
22      print $cgi->header();      print CGI::header();
23      print $cgi->start_html();      print CGI::start_html();
24    
25      # print out the error      # print out the error
26      print '<pre>'.$@.'</pre>';      print '<pre>'.$error.'</pre>';
27    
28      print $cgi->end_html();      print CGI::end_html();
29    
30  }  }
31    
# Line 32  Line 33 
33    
34      # initialize cgi      # initialize cgi
35      my $cgi = new CGI();      my $cgi = new CGI();
     ETracing($cgi);  
36    
37      # initialize layout      # initialize layout
38      # Use the template file for the current mode-- NMPDR or SEED      # Use the template file for the current mode-- NMPDR or SEED
39      my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl' : './Html/SeedViewer.tmpl');      my $templateFile = (FIGRules::nmpdr_mode($cgi) ? './Html/NmpdrViewer.tmpl' : './Html/SeedViewer.tmpl');
40      Trace("Template file is $templateFile") if T(3);      Trace("Template file is $templateFile") if T(3);
41      my $layout = WebLayout->new($templateFile);      my $layout = WebLayout->new($templateFile);
     # Start with the normal style.  
     $layout->add_css('./Html/default.css');  
42      # Choose the body/header style sheet according to the mode.      # Choose the body/header style sheet according to the mode.
43      if (FIGRules::nmpdr_mode($cgi)) {      if (FIGRules::nmpdr_mode($cgi)) {
44          # NMPDR mode.          # NMPDR mode.
45          $layout->add_css('./Html/nmpdrviewer.css');          $layout->add_css('./Html/nmpdrviewer.css');
46          # Show the NMPDR version in the header.          # Display the official NMPDR icon for this machine.
47          $layout->set_variable(VERSION => "Sprout version $FIG_Config::nmpdr_version on $ENV{HTTP_HOST}.");          $layout->add_metatag("<link rel=\"icon\" href=\"${FIG_Config::cgi_base}wiki/pub/logos/nmpdr.ico\" type=\"image/x-icon\" />");
48            $layout->add_metatag("<link rel=\"shortcut icon\" href=\"${FIG_Config::cgi_base}wiki/pub/logos/nmpdr.ico\" type=\"image/x-icon\" />");
49      } else {      } else {
50          # SEED mode.          # SEED mode.
51          $layout->add_css('./Html/seedviewer.css');          $layout->add_css('./Html/seedviewer.css');
52     }     }
53      # Add the common styles.      # Add the common styles.
54      $layout->add_css('./Html/commonviewer.css');      $layout->add_css('./Html/commonviewer.css');
55        # Add the normal style.
56      # add site meter      $layout->add_css('./Html/default.css');
     my $site_meter = $FIG_Config::site_meter;  
     if ($site_meter) {  
         $layout->add_javascript("http://s20.sitemeter.com/js/counter.js?site=s20nmpdr");  
     }  
   
57      # build menu      # build menu
58      my $menu;      my $menu;
59      $menu = WebMenu->new();      $menu = WebMenu->new();
60        if (FIGRules::nmpdr_mode($cgi)) {
61            $menu->add_category('&raquo;Navigate', '?page=Home');
62            $menu->add_entry('&raquo;Navigate', 'NMPDR home', "$FIG_Config::nmpdr_site_url/index.php");
63            $menu->add_entry('&raquo;Navigate', 'Organisms', "$FIG_Config::nmpdr_site_url/content/organisms.php");
64            $menu->add_entry('&raquo;Navigate', 'Subsystems', "$FIG_Config::nmpdr_site_url/content/subsystems.php");
65            $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
66        } else {
67      $menu->add_category('&raquo;Navigate', '?page=Home');      $menu->add_category('&raquo;Navigate', '?page=Home');
68      $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');      $menu->add_entry('&raquo;Navigate', 'Startpage', '?page=Home');
69      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');      $menu->add_entry('&raquo;Navigate', 'Organisms', '?page=OrganismSelect');
70      $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');      $menu->add_entry('&raquo;Navigate', 'Subsystems', '?page=SubsystemSelect');
71            $menu->add_entry('&raquo;Navigate', 'FigFams', '?page=FigFamViewer');
72      $menu->add_entry('&raquo;Navigate', '<a>Jump to Feature by</a>');      $menu->add_entry('&raquo;Navigate', '<a>Jump to Feature by</a>');
73      $menu->add_entry('&raquo;Navigate', '&nbsp;&nbsp;BLAST Search', '?page=BlastRun');      $menu->add_entry('&raquo;Navigate', '&nbsp;&nbsp;BLAST Search', '?page=BlastRun');
74      $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>");      $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>");
75        }
76      if (defined($FIG_Config::teacher_db)) {      if (defined($FIG_Config::teacher_db)) {
77          $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);          $menu->add_category('&raquo;Teacher', '?page=Teach', undef, ['edit', 'problem_list'], 96);
78          $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');          $menu->add_entry('&raquo;Teacher', 'Class Performance', '?page=Teach');
# Line 80  Line 82 
82      }      }
83      #$menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);      #$menu->add_category('&raquo;Admin', '?page=Admin', undef, ['edit', 'scope', '*'], 99);
84      if (FIGRules::nmpdr_mode($cgi)) {      if (FIGRules::nmpdr_mode($cgi)) {
85          $menu->add_category('&raquo;Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);          $menu->add_category('Help', "$FIG_Config::nmpdr_site_url/content/help.php", 'help', undef, 98);
86          $menu->add_entry('&raquo;Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");          $menu->add_entry('Help', 'Searching NMPDR', "$FIG_Config::nmpdr_site_url/content/find.php");
87          $menu->add_entry('&raquo;Help', 'SEED Viewer Tutorial', 'http://www.theseed.org/wiki/SEED_Viewer_Tutorial');          $menu->add_entry('Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contactus.php");
         $menu->add_entry('&raquo;Help', 'Contact', "$FIG_Config::nmpdr_site_url/content/contact.php");  
88      } else {      } else {
89          $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);          $menu->add_category('&raquo;Help', 'http://www.theseed.org', 'help', undef, 98);
90          $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');          $menu->add_entry('&raquo;Help', 'What is the SEED', 'http://www.theseed.org/wiki/Home_of_the_SEED');

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.18

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3