I added the missing feature.
Alex, GT staff, I analyzed carefully, if it there are any other references, or places, where any modification would still need, but I did not find more. Please correct me, if more modifications are needed!
Please release it as official bux fix, if do you find no more modifications are needed for this feature! Would be fine 1-1 update of HTML.pm and Admin.pm so I can be safely use this modification.
Here is the mod, how to add the password form type:
Change
red lines to
blue lines.
Replace following lines in
/admin/GT/SQL/Display/HTML.pm which starts at about line number 506:
Code:
sub text {
# ---------------------------------------------------------------
# Create a text field.
#
my ($self, $opts) = @_;
my $name = exists $opts->{name} ? $opts->{name} : return $self->error ("BADARGS", "FATAL", "No form name passed to select");
my $size = $opts->{def}->{form_size} ? $opts->{def}->{form_size} : $SIZE_FORMS{uc $opts->{def}->{type}};
$size ||= 20;
my $def;
if (defined $opts->{value}) { $def = $opts->{value} }
elsif (exists $opts->{def}->{default}) { $def = $opts->{def}->{default} }
else { $def = '' }
_escape(\$def);
return qq~<input type="text" name="$name" value="$def" size="$size">~;
}
with following codes (or just add the password subroutine below after the text subroutine):
Code:
sub text {
# ---------------------------------------------------------------
# Create a text field.
#
my ($self, $opts) = @_;
my $name = exists $opts->{name} ? $opts->{name} : return $self->error ("BADARGS", "FATAL", "No form name passed to select");
my $size = $opts->{def}->{form_size} ? $opts->{def}->{form_size} : $SIZE_FORMS{uc $opts->{def}->{type}};
$size ||= 20;
my $def;
if (defined $opts->{value}) { $def = $opts->{value} }
elsif (exists $opts->{def}->{default}) { $def = $opts->{def}->{default} }
else { $def = '' }
_escape(\$def);
return qq~<input type="text" name="$name" value="$def" size="$size">~;
}
sub password {
# ---------------------------------------------------------------
# New method for Package: GT::SQL::Display::HTML / File: HTML.pm / New function name should be: password
#
# Create a password text field.
#
my ($self, $opts) = @_;
my $name = exists $opts->{name} ? $opts->{name} : return $self->error ("BADARGS", "FATAL", "No form name passed to select");
my $size = $opts->{def}->{form_size} ? $opts->{def}->{form_size} : $SIZE_FORMS{uc $opts->{def}->{type}};
$size ||= 20;
my $def;
if (defined $opts->{value}) { $def = $opts->{value} }
elsif (exists $opts->{def}->{default}) { $def = $opts->{def}->{default} }
else { $def = '' }
_escape(\$def);
return qq~<input type="password" name="$name" value="$def" size="$size">~;
}
AND
Add following lines in
/admin/GT/SQL/Admin.pm about at the line number 1599:
Code:
<option~; $output .= " selected" if ($attribs->{form_type} eq 'TEXT'); $output .= qq~ value="TEXT">TEXT</option>
with following codes (or just add the password subroutine below after the text subroutine):
Code:
<option~; $output .= " selected" if ($attribs->{form_type} eq 'TEXT'); $output .= qq~ value="TEXT">TEXT</option>
<option~; $output .= " selected" if ($attribs->{form_type} eq 'PASSWORD'); $output .= qq~ value="PASSWORD">PASSWORD</option>
It works fine for me.
Have good luck using it...
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...