home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / perl5 / Debconf / Element / Web / Boolean.pm next >
Encoding:
Perl POD Document  |  2006-07-24  |  660 b   |  37 lines

  1. #!/usr/bin/perl -w
  2. # This file was preprocessed, do not edit!
  3.  
  4.  
  5. package Debconf::Element::Web::Boolean;
  6. use strict;
  7. use base qw(Debconf::Element);
  8.  
  9.  
  10. sub show {
  11.     my $this=shift;
  12.  
  13.     $_=$this->question->extended_description;
  14.     s/\n/\n<br>\n/g;
  15.     $_.="\n<p>\n";
  16.  
  17.     my $default='';
  18.     $default=$this->question->value if defined $this->question->value;
  19.     my $id=$this->id;
  20.     $_.="<input type=checkbox name=\"$id\"". ($default eq 'true' ? ' checked' : ''). ">\n<b>".
  21.         $this->question->description."</b>";
  22.  
  23.     return $_;
  24. }
  25.  
  26.  
  27. sub value {
  28.     my $this=shift;
  29.  
  30.     return $this->SUPER::value() unless @_;
  31.     my $value=shift;
  32.     $this->SUPER::value($value eq 'on' ? 'true' : 'false');
  33. }
  34.  
  35.  
  36. 1
  37.