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

  1. #!/usr/bin/perl -w
  2. # This file was preprocessed, do not edit!
  3.  
  4.  
  5. package Debconf::Element::Multiselect;
  6. use strict;
  7. use base qw(Debconf::Element::Select);
  8.  
  9.  
  10. sub order_values {
  11.     my $this=shift;
  12.     my %vals=map { $_ => 1 } @_;
  13.     $this->question->template->i18n('');
  14.     my @ret=grep { $vals{$_} } $this->question->choices_split;
  15.     $this->question->template->i18n(1);
  16.     return @ret;
  17. }
  18.  
  19.  
  20. sub visible {
  21.         my $this=shift;
  22.  
  23.         my @choices=$this->question->choices_split;
  24.         return ($#choices >= 0);
  25. }
  26.  
  27.  
  28. sub translate_default {
  29.     my $this=shift;
  30.  
  31.     my @choices=$this->question->choices_split;
  32.     $this->question->template->i18n('');
  33.     my @choices_c=$this->question->choices_split;
  34.     $this->question->template->i18n(1);
  35.     
  36.     my @ret;
  37.     foreach my $c_default ($this->question->value_split) {
  38.         foreach (my $x=0; $x <= $#choices; $x++) {
  39.             push @ret, $choices[$x]
  40.                 if $choices_c[$x] eq $c_default;
  41.         }
  42.     }
  43.     return @ret;
  44. }
  45.  
  46.  
  47. 1
  48.