~vcs-imports/debconf/svn

« back to all changes in this revision

Viewing changes to src/debconf/Debconf/Element/Web/String.pm

  • Committer: joeyh
  • Date: 2011-02-02 00:33:44 UTC
  • Revision ID: svn-v4:a4a2c43b-8ac3-0310-8836-e0e880c912e2:trunk:2516
moved to git

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
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 strict;
11
 
use base qw(Debconf::Element);
12
 
 
13
 
=head1 DESCRIPTION
14
 
 
15
 
This element handles a text input field on a web form.
16
 
 
17
 
=head1 METHODS
18
 
 
19
 
=over 4
20
 
 
21
 
=item show
22
 
 
23
 
Generates and returns html representing the text box.
24
 
 
25
 
=cut
26
 
 
27
 
sub show {
28
 
        my $this=shift;
29
 
 
30
 
        $_=$this->question->extended_description;
31
 
        s/\n/\n<br>\n/g;
32
 
        $_.="\n<p>\n";
33
 
 
34
 
        my $default='';
35
 
        $default=$this->question->value if defined $this->question->value;
36
 
        my $id=$this->id;
37
 
        $_.="<b>".$this->question->description."</b><input name=\"$id\" value=\"$default\">\n";
38
 
 
39
 
        return $_;
40
 
}
41
 
 
42
 
=head1 AUTHOR
43
 
 
44
 
Joey Hess <joeyh@debian.org>
45
 
 
46
 
=cut
47
 
 
48
 
1