Cleaned the pollution from the forms system.

This commit is contained in:
JT Smith 2008-04-16 16:11:10 +00:00
parent 53b81b36d0
commit 8500c4d506
81 changed files with 2675 additions and 1570 deletions

View file

@ -58,21 +58,13 @@ Defaults to 0. Used if no value is specified.
Defaults to 11. The number of characters that will be displayed at once in this field. Usually no need to override the default.
=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("482")
},
maxlength=>{
defaultValue=> 11
},
@ -82,19 +74,38 @@ sub definition {
size=>{
defaultValue=>11
},
profileEnabled=>{
defaultValue=>1
},
dbDataType => {
defaultValue => "BIGINT",
},
});
return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
=head2 getValueFromPost ( [ value ] )
=head2 getDatabaseFieldType ( )
Returns "BIGINT".
=cut
sub getDatabaseFieldType {
return "BIGINT";
}
#-------------------------------------------------------------------
=head2 getName ( session )
Returns the human readable name of this control.
=cut
sub getName {
my ($self, $session) = @_;
return WebGUI::International->new($session, 'WebGUI')->get('482');
}
#-------------------------------------------------------------------
=head2 getValue ( [ value ] )
Returns the integer from the form post, or returns 0 if the post result is invalid.
@ -104,9 +115,9 @@ An optional value to process, 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(@_);
if ($value =~ /^-?\d+$/) {
return $value;
}
@ -115,6 +126,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 an integer field.