home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / text.pm < prev    next >
Encoding:
Text File  |  2001-11-05  |  1.6 KB  |  70 lines

  1. ############################################################################
  2. #
  3. # Win32::ASP::Field::text - implements text fields in the Win32-ASP-DB system
  4. #
  5. # Author: Toby Everett
  6. # Revision: 0.02
  7. # Last Change:
  8. ############################################################################
  9. # Copyright 1999, 2000 Toby Everett.  All rights reserved.
  10. #
  11. # This file is distributed under the Artistic License. See
  12. # http://www.ActiveState.com/corporate/artistic_license.htm or
  13. # the license that comes with your perl distribution.
  14. #
  15. # For comments, questions, bugs or general interest, feel free to
  16. # contact Toby Everett at teverett@alascom.att.com
  17. ############################################################################
  18.  
  19. use Win32::ASP::Field;
  20. use Error qw/:try/;
  21. use Win32::ASP::Error;
  22.  
  23. package Win32::ASP::Field::text;
  24.  
  25. @ISA = ('Win32::ASP::Field');
  26.  
  27. use strict;
  28.  
  29. sub _as_html_edit_rw {
  30.   my $self = shift;
  31.   my($record, $data) = @_;
  32.  
  33.   my $formname = $self->formname;
  34.   my $value = $record->{$data}->{$self->name};
  35.   my $help = $self->as_html_mouseover($record, $data);
  36.  
  37.   my $cols = $self->size;
  38.   my $rows = $self->textrows;
  39.  
  40.   chomp(my $retval = <<ENDHTML);
  41. <TEXTAREA ROWS="$rows" COLS="$cols" WRAP="SOFT" NAME="$formname" $help>$value</TEXTAREA>
  42. ENDHTML
  43.   return $retval;
  44. }
  45.  
  46. sub _as_sql {
  47.   my $self = shift;
  48.   my($value) = @_;
  49.  
  50.   $self->check_value($value);
  51.  
  52.   defined $value or return 'NULL';
  53.  
  54.   $value =~ s/'/''/g;
  55.   $value = "'$value'";
  56.   return $value;
  57. }
  58.  
  59. sub _size {
  60.   my $self = shift;
  61.   return 55;
  62. }
  63.  
  64. sub _textrows {
  65.   my $self = shift;
  66.   return 4;
  67. }
  68.  
  69. 1;
  70.