From a7cb47837062e43aa3a0c233361756b7ba889a71 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 11 Sep 2007 14:29:40 +0000 Subject: [PATCH] Umstellung der Maske "Benutzereinstellungen" auf die Verwendung von Template. --- bin/mozilla/am.pl | 404 ++++++++-------------------------------------- locale/de/all | 4 +- locale/de/am | 46 +----- 3 files changed, 70 insertions(+), 384 deletions(-) diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 137243877..76cc217a6 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -2352,33 +2352,30 @@ sub swap_payment_terms { $lxdebug->leave_sub(); } +sub _build_cfg_options { + my $idx = shift; + my $array = uc($idx) . 'S'; + + $form->{$array} = []; + foreach my $item (@_) { + push @{ $form->{$array} }, { + 'name' => $item, + 'value' => $item, + 'selected' => $item eq $myconfig{$idx}, + }; + } +} + sub config { $lxdebug->enter_sub(); # get defaults for account numbers and last numbers AM->defaultaccounts(\%myconfig, \%$form); - foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) { - $dateformat .= - ($item eq $myconfig{dateformat}) - ? ""; + push @{ $form->{TEMPLATE_FORMATS} }, { + 'name' => $item->{name}, + 'value' => $item->{value}, + 'selected' => $item->{value} eq $myconfig{template_format}, + }; } if (!$myconfig{"default_media"}) { $myconfig{"default_media"} = "screen"; } + my %selected = ($myconfig{"default_media"} => "selected"); - my $default_media = qq| - - - -|; + $form->{MEDIA} = [ + { 'name' => $locale->text('Screen'), 'value' => 'screen', 'selected' => $selected{screen}, }, + { 'name' => $locale->text('Printer'), 'value' => 'printer', 'selected' => $selected{printer}, }, + { 'name' => $locale->text('Queue'), 'value' => 'queue', 'selected' => $selected{queue}, }, + ]; - %selected = (); - $selected{$myconfig{"default_printer_id"}} = "selected" - if ($myconfig{"default_printer_id"}); - my $default_printer = qq||; AM->printer(\%myconfig, $form); + + $form->{PRINTERS} = []; foreach my $printer (@{$form->{"ALL"}}) { - $default_printer .= qq||; + push @{ $form->{PRINTERS} }, { + 'name' => $printer->{printer_description}, + 'value' => $printer->{id}, + 'selected' => $printer->{id} == $myconfig{default_printer_id}, + }; } %countrycodes = User->country_codes; - $countrycodes = ''; - foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} } - keys %countrycodes - ) { - $countrycodes .= - ($myconfig{countrycode} eq $key) - ? "