fixed problem with showing other assets' edit forms
fixed utility skeleton to be more complete and less annoying added warning message when editing default templates
This commit is contained in:
parent
e0ae63281c
commit
82a7e5dfd2
6 changed files with 270 additions and 55 deletions
|
|
@ -8,7 +8,8 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
our ($webguiRoot);
|
||||
$|++; # disable output buffering
|
||||
our ($webguiRoot, $configFile, $help, $man);
|
||||
|
||||
BEGIN {
|
||||
$webguiRoot = "..";
|
||||
|
|
@ -21,24 +22,27 @@ use Getopt::Long;
|
|||
use WebGUI::Session;
|
||||
|
||||
# Get parameters here, including $help
|
||||
GetOptions(
|
||||
'configFile=s' => \$configFile,
|
||||
'help' => \$help,
|
||||
'man' => \$man,
|
||||
);
|
||||
|
||||
pod2usage( verbose => 2 ) if $help;
|
||||
pod2usage() unless $help; # Change condition!
|
||||
pod2usage( verbose => 1 ) if $help;
|
||||
pod2usage( verbose => 2 ) if $man;
|
||||
pod2usage( msg => "Must specify a config file!" ) unless $configFile;
|
||||
|
||||
my $session = start();
|
||||
my $session = start( $webguiRoot, $configFile );
|
||||
# Do your work here
|
||||
finish($session);
|
||||
|
||||
#-------------------------------------------------
|
||||
#----------------------------------------------------------------------------
|
||||
# Your sub here
|
||||
|
||||
#-------------------------------------------------
|
||||
#----------------------------------------------------------------------------
|
||||
sub start {
|
||||
my $configFile;
|
||||
$| = 1; #disable output buffering
|
||||
GetOptions(
|
||||
'configFile=s' => \$configFile,
|
||||
);
|
||||
my $webguiRoot = shift;
|
||||
my $configFile = shift;
|
||||
my $session = WebGUI::Session->open($webguiRoot,$configFile);
|
||||
$session->user({userId=>3});
|
||||
|
||||
|
|
@ -52,7 +56,7 @@ sub start {
|
|||
return $session;
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
#----------------------------------------------------------------------------
|
||||
sub finish {
|
||||
my $session = shift;
|
||||
|
||||
|
|
@ -83,6 +87,10 @@ utility - A template for WebGUI utility scripts
|
|||
|
||||
This WebGUI utility script helps you...
|
||||
|
||||
=head1 ARGUMENTS
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over
|
||||
|
||||
=item B<--configFile config.conf>
|
||||
|
|
@ -93,7 +101,11 @@ This parameter is required.
|
|||
|
||||
=item B<--help>
|
||||
|
||||
Shows this documentation, then exits.
|
||||
Shows a short summary and usage
|
||||
|
||||
=item B<--man>
|
||||
|
||||
Shows this document
|
||||
|
||||
=back
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue