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

View of /WebApplication/SimpleWebPage.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Mon Nov 14 19:47:46 2011 UTC (8 years, 8 months ago) by olson
Branch: MAIN
Changes since 1.1: +4 -2 lines
Fix case where user not logged in

package SimpleWebPage;

use base qw( WebPage );

use strict;
use warnings;
use SubsystemPrimer;

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 $application = $self->application;
    my $cgi = $application->cgi;
    
    my $fig = $application->data_handle('FIG');
    
    my $user = $application->session->user;

    my $page = $cgi->param('page');
    my $url = $application->url . "?page=$page";

    my $username = ref($user) ? $user->login : "";
    my $output = $self->page_content($fig, $cgi, $username, $url);

    return $output;
}


1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3