added asset form control, fixed some interval problems, added a check so users can't delete the default page or the not found page
This commit is contained in:
parent
1523c9c904
commit
778236efcb
8 changed files with 198 additions and 21 deletions
|
|
@ -32,6 +32,7 @@ This package helps in the processing of the form variables that are returned fro
|
|||
use WebGUI::FormProcessor;
|
||||
$value = WebGUI::FormProcessor::process("favoriteColor","selectList","black");
|
||||
|
||||
$value = WebGUI::FormProcessor::asset("assetId");
|
||||
$value = WebGUI::FormProcessor::checkbox("whichOne");
|
||||
$value = WebGUI::FormProcessor::checkList("dayOfWeek");
|
||||
$value = WebGUI::FormProcessor::codearea("snippet");
|
||||
|
|
@ -74,6 +75,22 @@ sub _checkEmailAddy {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 asset ( name )
|
||||
|
||||
Returns an asset id.
|
||||
|
||||
=head3 name
|
||||
|
||||
The name of the form variable to retrieve.
|
||||
|
||||
=cut
|
||||
|
||||
sub asset {
|
||||
return $session{form}{$_[0]};
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 checkbox ( name )
|
||||
|
||||
Returns an array or a carriage return ("\n") separated scalar depending upon whether you're returning the values into an array or a scalar.
|
||||
|
|
@ -386,7 +403,8 @@ The name of the form variable to retrieve.
|
|||
=cut
|
||||
|
||||
sub interval {
|
||||
return (WebGUI::DateTime::intervalToSeconds($session{form}{$_[0]."_interval"},$session{form}{$_[0]."_units"}) || 0);
|
||||
my $val = WebGUI::DateTime::intervalToSeconds($session{form}{$_[0]."_interval"},$session{form}{$_[0]."_units"}) || 0;
|
||||
return $val;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -450,7 +468,6 @@ The default value for this variable. If the variable is undefined then the defau
|
|||
sub process {
|
||||
my ($name, $type, $default) = @_;
|
||||
my $value;
|
||||
return undef unless (exists $session{form}{$name});
|
||||
$type = "text" if ($type eq "");
|
||||
$value = &$type($name);
|
||||
unless (defined $value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue