#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package Support::Module::Command::ShowPage;
use strict;
use warnings;

use lib '/app/tools/support/lib';
use base 'Support::Command::Submit';

use lib '/app/tools/common/lib';
use RSApache::Response::XSLT;

use lib '/app/tools/support/lib';
use Support::Module::PageSimple;

sub cmd  { return 'page_detail'; }
sub area { return 'admin'; }

use constant kTemplate => "/app/tools/support/templates/admin/page_detail.xsl";

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

    my $response = $self->SUPER::execute();
    return $response if $response;

    my $form = new Support::Module::PageSimple( modulePageID => $self->getParam('ModulePageID') );

    # Set the check box value
    $form->Development( $self->getParam('Form_Development') ? 1 : 0 );

    $self->saveOnSubmit($form);

    # Call this expicitly so that navigation is re-read
    $self->_addToXML();

    $self->{xml}{Form} = $form;
    $response = RSApache::Response::XSLT->new( $self->{xml}, kTemplate );
    return $response;
}

1;
