merging form pollution fix
This commit is contained in:
parent
c1cab2299c
commit
11e4f6ea7e
78 changed files with 2666 additions and 1463 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue