X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=lib%2FCGI%2FEx%2FApp.pm;h=78a9d47a3b3ce7a7d099d156e8edb8d034f2b359;hp=79720fc4f9c9eef62ce785909fb498ae06d00c83;hb=6ab8b2e8e8388d1a238148a1ee58e124855f3768;hpb=fdecaac30a1168ed894c46d61b6c95524ec62a4e diff --git a/lib/CGI/Ex/App.pm b/lib/CGI/Ex/App.pm index 79720fc..78a9d47 100644 --- a/lib/CGI/Ex/App.pm +++ b/lib/CGI/Ex/App.pm @@ -2,7 +2,7 @@ package CGI::Ex::App; ###---------------------### # See the perldoc in CGI/Ex/App.pod -# Copyright 2008 - Paul Seamons +# Copyright 2004-2012 - Paul Seamons # Distributed under the Perl Artistic License without warranty use strict; @@ -11,7 +11,7 @@ BEGIN { eval { use Time::HiRes qw(time) }; eval { use Scalar::Util }; } -our $VERSION = '2.32'; +our $VERSION = '2.37'; sub new { my $class = shift || croak "Usage: ".__PACKAGE__."->new"; @@ -33,6 +33,15 @@ sub init_from_conf { return; } +sub import { # only ever called with explicit use CGI::Ex::App qw() - not with use base + my $class = shift; + if (@_ = grep { /^:?App($|__)/ } @_) { + require CGI::Ex::App::Constants; + unshift @_, 'CGI::Ex::App::Constants'; + goto &CGI::Ex::App::Constants::import; + } +} + ###---------------------### sub navigate { @@ -926,15 +935,16 @@ sub js_run_step { # step that allows for printing javascript libraries that are return 1; } +sub __forbidden_require_auth { 0 } sub __forbidden_allow_morph { shift->allow_morph(@_) && 1 } sub __forbidden_info_complete { 0 } # step that will be used the path method determines it is forbidden sub __forbidden_hash_common { shift->stash } -sub __forbidden_file_print { \ "

Denied

You do not have access to the step \"[% forbidden_step %]\"" } +sub __forbidden_file_print { \ "

Denied

You do not have access to the step \"[% forbidden_step.html %]\"" } sub __error_allow_morph { shift->allow_morph(@_) && 1 } sub __error_info_complete { 0 } # step that is used by the default handle_error sub __error_hash_common { shift->stash } -sub __error_file_print { \ "

A fatal error occurred

Step: \"[% error_step %]\"
[% TRY; CONFIG DUMP => {header => 0}; DUMP error; END %]" } +sub __error_file_print { \ "

A fatal error occurred

Step: \"[% error_step.html %]\"
[% TRY; CONFIG DUMP => {header => 0}; DUMP error; END %]" } sub __login_require_auth { 0 } sub __login_allow_morph { shift->allow_morph(@_) && 1 }