Debian Codegraph @

Debconf/Element/Web/String.pm

raw
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 Debconf::Element::Web::String - A text input field on a form
6
7 =cut
8
9 package Debconf::Element::Web::String;
10 use warnings;
11 use strict;
12 use base qw(Debconf::Element);
13
14 =head1 DESCRIPTION
15
16 This element handles a text input field on a web form.
17
18 =head1 METHODS
19
20 =over 4
21
22 =item show
23
24 Generates and returns html representing the text box.
25
26 =cut
27
28 sub show {
29 my $this=shift;
30
31 $_=$this->question->extended_description;
32 s/\n/\n<br>\n/g;
33 $_.="\n<p>\n";
34
35 my $default='';
36 $default=$this->question->value if defined $this->question->value;
37 my $id=$this->id;
38 $_.="<b>".$this->question->description."</b><input name=\"$id\" value=\"$default\">\n";
39
40 return $_;
41 }
42
43 =head1 AUTHOR
44
45 Joey Hess <[email protected]>
46
47 =cut
48
49 1