[Bio] / WebApplication / SimpleWebPage.pm Repository:
ViewVC logotype

View of /WebApplication/SimpleWebPage.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (download) (as text) (annotate)
Fri Jan 20 21:04:22 2012 UTC (7 years, 9 months ago) by olson
Branch: MAIN
CVS Tags: rast_rel_2014_0912, rast_rel_2014_0729, mgrast_version_3_2, mobedac_release_05302012, HEAD
Changes since 1.7: +2 -2 lines
another bugfix

package SimpleWebPage;

use base qw( WebPage );

use strict;
use warnings;
use Devel::StackTrace::AsHTML;

1;

=pod

=head1 NAME

SimpleWebPage

=head1 DESCRIPTION


=head1 METHODS

=over 4

=item * B<init> ()

Called when the web page is instanciated.

=cut

sub init {
  my ($self) = @_;
  
  $self->title($self->page_title());

  return 1;
}

=item * B<output> ()

Returns the html output of the Annotation page.

=cut

sub output {
    my ($self) = @_;
    
    my $output;

    my $application = $self->application;
    my $cgi = $application->cgi;
    my $page = $cgi->param('page');

    eval {
	
	my $fig = $application->data_handle('FIG');
	
	my $user = $application->session->user;
	
	my $url = $application->url."?page=".$page;
	
	my $username = ref($user) ? $user->login : "";
	
	$output = $self->page_content($fig, $cgi, $username, $url);
    };
    if ($@)
    {
	$output = "<h1>Error during execution of page $page:</h1>" . $@;
    }

    return $output;
}


1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3