Cleaned the pollution from the forms system.
This commit is contained in:
parent
53b81b36d0
commit
8500c4d506
81 changed files with 2675 additions and 1570 deletions
|
|
@ -50,34 +50,36 @@ The following additional parameters have been added via this sub class.
|
|||
|
||||
Defaults to 10. Determines the maximum number of characters allowed in this field.
|
||||
|
||||
=head4 profileEnabled
|
||||
|
||||
Flag that tells the User Profile system that this is a valid form element in a User Profile
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift || [];
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
push(@{$definition}, {
|
||||
formName=>{
|
||||
defaultValue=> $i18n->get("944")
|
||||
},
|
||||
maxlength=>{
|
||||
defaultValue=> 10
|
||||
},
|
||||
profileEnabled=>{
|
||||
defaultValue=>1
|
||||
},
|
||||
});
|
||||
return $class->SUPER::definition($session, $definition);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValueFromPost ( [ value ] )
|
||||
=head2 getName ( session )
|
||||
|
||||
Returns the human readable name of this control.
|
||||
|
||||
=cut
|
||||
|
||||
sub getName {
|
||||
my ($self, $session) = @_;
|
||||
return WebGUI::International->new($session, 'WebGUI')->get('944');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getValue ( [ value ] )
|
||||
|
||||
Returns a validated form post result. If the result does not pass validation, it returns undef instead.
|
||||
|
||||
|
|
@ -87,9 +89,9 @@ An optional value to use instead of POST input.
|
|||
|
||||
=cut
|
||||
|
||||
sub getValueFromPost {
|
||||
sub getValue {
|
||||
my $self = shift;
|
||||
my $value = @_ ? shift : $self->session->form->param($self->get("name"));
|
||||
my $value = $self->SUPER::getValue(@_);
|
||||
$value =~ tr/\r\n//d;
|
||||
if ($value =~ /^[A-Z\d\s\-]+$/) {
|
||||
return $value;
|
||||
|
|
@ -99,6 +101,18 @@ sub getValueFromPost {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isDynamicCompatible ( )
|
||||
|
||||
A class method that returns a boolean indicating whether this control is compatible with the DynamicField control.
|
||||
|
||||
=cut
|
||||
|
||||
sub isDynamicCompatible {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 toHtml ( )
|
||||
|
||||
Renders a zip code field.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue