]> ruin.nu Git - ndwebbie.git/blobdiff - ND/Web/Pages/EditRaid.pm
gal rankings and fixed a bug with gal graph caching
[ndwebbie.git] / ND / Web / Pages / EditRaid.pm
index f7f8a9fbc640a57cc03f8582da517f04a748c40b..343021ac6dce02ed3e39f3cf22ab787c780c4e72 100644 (file)
@@ -23,27 +23,19 @@ use ND::Include;
 use CGI qw/:standard/;
 use ND::Web::Include;
 
-$ND::PAGES{editRaid} = {parse => \&parse, process => \&process, render=> \&render};
+use base qw/ND::Web::XMLPage/;
 
-sub parse {
-       my ($uri) = @_;
-       #if ($uri =~ m{^/.*/(\w+)$}){
-       #       param('list',$1);
-       #}
-}
-
-sub process {
+$ND::Web::Page::PAGES{editRaid} = __PACKAGE__;
 
-}
+sub render_body {
+       my $self = shift;
+       my ($BODY) = @_;
+       $self->{TITLE} = 'Create/Edit Raids';
+       my $DBH = $self->{DBH};
 
-sub render {
-       my ($DBH,$BODY) = @_;
+       return $self->noAccess unless $self->isBC;
        my $error;
 
-       $ND::TEMPLATE->param(TITLE => 'Create/Edit Raids');
-
-       return $ND::NOACCESS unless isBC();
-
        my @alliances = alliances();
        $BODY->param(Alliances => \@alliances);
 
@@ -88,7 +80,7 @@ sub render {
                                ,undef,escapeHTML(param('comment')),param('target'))
                                or $error .= p($DBH->errstr);
 
-               }elsif (param('cmd') eq 'change'){
+               }elsif (param('cmd') eq 'change' || param('cmd') eq 'submit'){
                        $DBH->begin_work;
                        my $message = escapeHTML(param('message'));
                        $raid->{message} = $message;
@@ -205,7 +197,7 @@ sub render {
                $BODY->param(Targets => \@targets);
        }else{
                $BODY->param(Waves => 3);
-               $BODY->param(LandingTick => $ND::TICK+12);
+               $BODY->param(LandingTick => $self->{TICK}+12);
        }
        $BODY->param(Error => $error);
        return $BODY;