add perldoc
This commit is contained in:
parent
ecde77e2a8
commit
95e30aba40
2 changed files with 167 additions and 1 deletions
|
|
@ -7,6 +7,13 @@ use base 'WebGUI::Wizard';
|
||||||
|
|
||||||
WebGUI::Wizard::HomePage - Create or replace a Home Page with new content
|
WebGUI::Wizard::HomePage - Create or replace a Home Page with new content
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
The HomePage wizard will create a new home page with a given style and with
|
||||||
|
the desired types of content.
|
||||||
|
|
||||||
|
=head1 METHODS
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub _get_steps {
|
sub _get_steps {
|
||||||
|
|
@ -68,15 +75,39 @@ sub addPage {
|
||||||
return addAsset( $parent, { title => $title, className => "WebGUI::Asset::Wobject::Layout", displayTitle => 0 } );
|
return addAsset( $parent, { title => $title, className => "WebGUI::Asset::Wobject::Layout", displayTitle => 0 } );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 canView ( )
|
||||||
|
|
||||||
|
A user can view this wizard if they are an Admin
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub canView {
|
sub canView {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
return $self->session->user->isAdmin;
|
return $self->session->user->isAdmin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 wrapStyle ( $output )
|
||||||
|
|
||||||
|
Wrap the output in the wizard style.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub wrapStyle {
|
sub wrapStyle {
|
||||||
return WebGUI::Wizard::Setup::wrapStyle( @_ );
|
return WebGUI::Wizard::Setup::wrapStyle( @_ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_pickStyle ( )
|
||||||
|
|
||||||
|
Choose the style for the new home page
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_pickStyle {
|
sub www_pickStyle {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -132,6 +163,14 @@ sub www_pickStyle {
|
||||||
return $output . '<div style="clear: both;"> </div>';
|
return $output . '<div style="clear: both;"> </div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_pickStyleSave ( )
|
||||||
|
|
||||||
|
Store the style to use later when we create the content
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_pickStyleSave {
|
sub www_pickStyleSave {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -147,6 +186,14 @@ sub www_pickStyleSave {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_chooseContent ( )
|
||||||
|
|
||||||
|
Choose and configure the content on the home page
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_chooseContent {
|
sub www_chooseContent {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -183,6 +230,14 @@ sub www_chooseContent {
|
||||||
return $output;
|
return $output;
|
||||||
} ## end sub www_chooseContent
|
} ## end sub www_chooseContent
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_chooseContentSave ( )
|
||||||
|
|
||||||
|
Create the new content with the correct style.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_chooseContentSave {
|
sub www_chooseContentSave {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -369,6 +424,14 @@ sub www_chooseContentSave {
|
||||||
return;
|
return;
|
||||||
} ## end sub www_chooseContentSave
|
} ## end sub www_chooseContentSave
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_finalize ( $output )
|
||||||
|
|
||||||
|
Redirect the user to to the home page
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_finalize {
|
sub www_finalize {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,14 @@ use base 'WebGUI::Wizard';
|
||||||
|
|
||||||
WebGUI::Wizard::Setup -- Initial site setup
|
WebGUI::Wizard::Setup -- Initial site setup
|
||||||
|
|
||||||
=cut
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
A WebGUI::Wizard to perform initial site setup tasks like defining the Admin
|
||||||
|
account, entering basic information, and choosing a default style.
|
||||||
|
|
||||||
|
=head1 METHODS
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub _get_steps {
|
sub _get_steps {
|
||||||
return [qw(
|
return [qw(
|
||||||
|
|
@ -20,6 +26,15 @@ sub _get_steps {
|
||||||
)];
|
)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 canView ( )
|
||||||
|
|
||||||
|
A user can view this wizard if the site is newly created or if they are the
|
||||||
|
admin user
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub canView {
|
sub canView {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -29,6 +44,14 @@ sub canView {
|
||||||
|| $session->user->getId eq '3';
|
|| $session->user->getId eq '3';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 wrapStyle ( $output )
|
||||||
|
|
||||||
|
Wrap the output in the wizard style.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub wrapStyle {
|
sub wrapStyle {
|
||||||
my ( $self, $output ) = @_;
|
my ( $self, $output ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -101,6 +124,13 @@ h1 {
|
||||||
return $page;
|
return $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_adminAccount ( )
|
||||||
|
|
||||||
|
Display the form to configure the admin account
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_adminAccount {
|
sub www_adminAccount {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
|
|
@ -148,6 +178,14 @@ sub www_adminAccount {
|
||||||
return '<h1>' . $legend . '</h1>' . $f->print;
|
return '<h1>' . $legend . '</h1>' . $f->print;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_adminAccountSave ( )
|
||||||
|
|
||||||
|
Process the form and update the Admin account
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_adminAccountSave {
|
sub www_adminAccountSave {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -186,6 +224,14 @@ sub www_adminAccountSave {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_companyInformation ( )
|
||||||
|
|
||||||
|
Enter basic company information
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_companyInformation {
|
sub www_companyInformation {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -221,6 +267,14 @@ sub www_companyInformation {
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_companyInformationSave ( )
|
||||||
|
|
||||||
|
Update the company information
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_companyInformationSave {
|
sub www_companyInformationSave {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -231,6 +285,14 @@ sub www_companyInformationSave {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_siteStats ( )
|
||||||
|
|
||||||
|
Opt-in to the global WebGUI statistics
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_siteStats {
|
sub www_siteStats {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -258,6 +320,14 @@ sub www_siteStats {
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_siteStatsSave ( )
|
||||||
|
|
||||||
|
Opt-in to the global WebGUI statistics
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_siteStatsSave {
|
sub www_siteStatsSave {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -266,10 +336,27 @@ sub www_siteStatsSave {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_defaultStyle ( )
|
||||||
|
|
||||||
|
Choose the default site style
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_defaultStyle {
|
sub www_defaultStyle {
|
||||||
return WebGUI::Wizard::HomePage::www_pickStyle( @_ );
|
return WebGUI::Wizard::HomePage::www_pickStyle( @_ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_defaultStyleSave ( )
|
||||||
|
|
||||||
|
Save the default style to all existing pages and the user function style
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
|
||||||
sub www_defaultStyleSave {
|
sub www_defaultStyleSave {
|
||||||
my ( $self, @args ) = @_;
|
my ( $self, @args ) = @_;
|
||||||
my $output = WebGUI::Wizard::HomePage::www_pickStyleSave( $self, @args );
|
my $output = WebGUI::Wizard::HomePage::www_pickStyleSave( $self, @args );
|
||||||
|
|
@ -286,6 +373,14 @@ sub www_defaultStyleSave {
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_finalize ( )
|
||||||
|
|
||||||
|
Give the user a choice to do the Home Page wizard
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_finalize {
|
sub www_finalize {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
@ -318,6 +413,14 @@ sub www_finalize {
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
=head2 www_finalizeSave ( )
|
||||||
|
|
||||||
|
User has declined to do the Home Page wizard
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
sub www_finalizeSave {
|
sub www_finalizeSave {
|
||||||
my ( $self ) = @_;
|
my ( $self ) = @_;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue