merging form pollution fix

This commit is contained in:
JT Smith 2008-04-16 21:55:38 +00:00
parent c1cab2299c
commit 11e4f6ea7e
78 changed files with 2666 additions and 1463 deletions

View file

@ -50,36 +50,34 @@ The following additional parameters have been added via this sub class.
The length of the input box.
=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("int slider")
},
size=>{
defaultValue=> "3",
},
profileEnabled=>{
defaultValue=>1
},
dbDataType => {
defaultValue => "BIGINT",
},
});
return $class->SUPER::definition($session, $definition);
}
#-------------------------------------------------------------------
=head2 getDatabaseFieldType ( )
Returns "BIGINT".
=cut
sub getDatabaseFieldType {
return "BIGINT";
}
#-------------------------------------------------------------------
=head2 getInputElement ( )
Returns the form element used for manual input.
@ -99,6 +97,19 @@ sub getInputElement {
#-------------------------------------------------------------------
=head2 getName ( session )
Returns the human readable name of this control.
=cut
sub getName {
my ($self, $session) = @_;
return WebGUI::International->new($session, 'WebGUI')->get('int slider');
}
#-------------------------------------------------------------------
=head2 getOnChangeInputElement ( )
Returns the javascript code to update the slider and other form elements on a
@ -130,7 +141,7 @@ sub getOnChangeSlider {
#-------------------------------------------------------------------
=head2 getValueFromPost ( [ value ] )
=head2 getValue ( [ value ] )
Retrieves a value from a form GET or POST and returns it. If the value comes back as undef, this method will return the defaultValue instead. Strip newlines/carriage returns from the value.
@ -140,7 +151,7 @@ A value to process instead of POST input.
=cut
sub getValueFromPost {
sub getValue {
my $self = shift;
my @args = @_;
@ -151,7 +162,19 @@ sub getValueFromPost {
id => 'view-'.$self->get('id'),
};
return WebGUI::Form::Integer->new($self->session, $properties)->getValueFromPost(@args);
return WebGUI::Form::Integer->new($self->session, $properties)->getValue(@args);
}
#-------------------------------------------------------------------
=head2 isDynamicCompatible ( )
A class method that returns a boolean indicating whether this control is compatible with the DynamicField control.
=cut
sub isDynamicCompatible {
return 1;
}
1;