added most of the rest of the form controls

This commit is contained in:
JT Smith 2005-07-27 23:03:46 +00:00
parent ce6ee697f9
commit b86148acaa
12 changed files with 35 additions and 1870 deletions

View file

@ -87,7 +87,7 @@ Add extra attributes to the form tag like
=head4 label
A text label that will be displayed if toHtmlWithWrapper() is called.
A text label that will be displayed if toHtmlWithWrapper() is called. Defaults to the getName() method call.
=head4 uiLevel
@ -138,7 +138,7 @@ sub definition {
defaultValue=>undef
},
label=>{
defaultValue=>undef
defaultValue=>$class->getName
},
uiLevel=>{
defaultValue=>1

View file

@ -95,7 +95,7 @@ Renders and input tag of type checkbox.
sub toHtml {
my $self = shift;
my $value = $self->fixQuotes($self->{value});
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->{value})));
my $checkedText = ' checked="checked"' if ($self->{checked});
return '<input type="checkbox" name="'.$self->{name}.'" value="'.$value.'"'.$checkedText.' '.$self->{extras}.' />';
}

View file

@ -22,6 +22,7 @@ use WebGUI::Grouping;
use WebGUI::Icon;
use WebGUI::International;
use WebGUI::Session;
use WebGUI::URL;
=head1 NAME
@ -61,11 +62,7 @@ A database link id. Defaults to "0", which is the WebGUI database.
=head4 afterEdit
A URL that will be acted upon after editing a database link. Typically there is a link next to the select list that reads "Edit this database link" and this is the URL to go to after editing is complete.
=head4 label
A label displayed next to the field when toHtmlWithWrapper() is called. Defaults to "Database Link".
A URL that will be acted upon after editing a database link.
=head4 hoverHelp
@ -86,9 +83,6 @@ sub definition {
afterEdit=>{
defaultValue=>undef
},
label=>{
defaultValue=>WebGUI::International::get(1075)
},
hoverHelp=>{
defaultValue=>WebGUI::International::get('1075 description')
},
@ -121,7 +115,8 @@ sub toHtml {
return WebGUI::Form::selectList->new(
name=>$self->{name},
options=>WebGUI::DatabaseLink::getList(),
value=>[$self->{value}]
value=>[$self->{value}],
extras=>$self->{extras}
)->toHtml;
}
@ -140,7 +135,7 @@ sub toHtmlWithWrapper {
if ($self->{afterEdit}) {
$subtext = editIcon("op=editDatabaseLink&amp;lid=".$self->{value}."&amp;afterEdit=".WebGUI::URL::escape($self->{afterEdit}));
}
$subtext = .= manageIcon("op=listDatabaseLinks");
$subtext .= manageIcon("op=listDatabaseLinks");
$self->{subtext} = $subtext . $self->{subtext};
}
return $self->SUPER::toHtmlWithWrapper;
@ -148,5 +143,6 @@ sub toHtmlWithWrapper {
1;

View file

@ -118,7 +118,7 @@ sub getValueFromPost {
if (scalar(@data)) {
return wantarray ? @data : join("\n",@data);
}
return wantarray ? @[2] : 2;
return wantarray ? @{[2]} : 2;
}
#-------------------------------------------------------------------
@ -176,8 +176,7 @@ Renders the form field to HTML as a table row complete with labels, subtext, hov
sub toHtmlWithWrapper {
my $self = shift;
if (WebGUI::Grouping::isInGroup(3)) {
my $subtext;
$subtext = .= manageIcon("op=listGroups");
my $subtext = manageIcon("op=listGroups");
$self->{subtext} = $subtext . $self->{subtext};
}
return $self->SUPER::toHtmlWithWrapper;

View file

@ -122,7 +122,7 @@ sub toHtml {
extras=>$self->{extras}
)->toHtml
.WebGUI::Form::selectList->new(
options=>\%units
options=>\%units,
name=>$self->{name}."_units",
value=>[$self->{value}]
)->toHtml;

View file

@ -100,7 +100,7 @@ sub getValueFromPost {
=head2 toHtml ( )
Renders an input tag of type text.
Renders a zip code field.
=cut