From a52aa2f26cd22d26f59772695cf27c7b42157e00 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 20 Jan 2012 20:34:59 +0100 Subject: [PATCH] am/language_header auf template umgestellt --- bin/mozilla/am.pl | 95 +++------------------- templates/webpages/am/language_header.html | 44 ++++++++++ 2 files changed, 54 insertions(+), 85 deletions(-) create mode 100644 templates/webpages/am/language_header.html diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index d11219660..f28fa5221 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -849,7 +849,7 @@ sub list_language { $::lxdebug->enter_sub; $::auth->assert('config'); - AM->language(\%myconfig, \%$form); + AM->language(\%::myconfig, $::form); $::form->{callback} = "am.pl?action=list_language"; $::form->{title} = $::locale->text('Languages'); @@ -862,96 +862,21 @@ sub list_language { } sub language_header { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text("$form->{title} Language"); + $::lxdebug->enter_sub; + $::auth->assert('config'); # $locale->text('Add Language') # $locale->text('Edit Language') + $::form->{title} = $::locale->text("$::form->{title} Language"); - $form->{description} =~ s/\"/"/g; - $form->{template_code} =~ s/\"/"/g; - $form->{article_code} =~ s/\"/"/g; - - - $form->header; - - my $numberformat = - qq||; - foreach my $item (('1,000.00', '1000.00', '1.000,00', '1000,00')) { - $numberformat .= - ($item eq $form->{output_numberformat}) - ? ""; - } - - my $dateformat = - qq||; - foreach my $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) { - $dateformat .= - ($item eq $form->{output_dateformat}) - ? ""; - } - - print qq| - - -
- -{id}> - + $::form->header; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text('Language') . qq|
| . $locale->text('Template Code') . qq|
| . $locale->text('Article Code') . qq|
| . $locale->text('Number Format') . qq|
| . $locale->text('Date Format') . qq|
| . $locale->text('Long Dates') . qq|{output_longdates} ? " checked" : "") . - qq|>| . $locale->text("Yes") . - qq|{output_longdates} ? "" : " checked") . - qq|>| . $locale->text("No") . - qq|

-|; + print $::form->parse_html_template('am/language_header', { + numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00' ], + dateformats => [ qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ], + }); - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub save_language { diff --git a/templates/webpages/am/language_header.html b/templates/webpages/am/language_header.html new file mode 100644 index 000000000..c17b14e6e --- /dev/null +++ b/templates/webpages/am/language_header.html @@ -0,0 +1,44 @@ +[%- USE L %] +[%- USE HTML %] +[%- USE LxERP %] +[%- USE T8 %] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
[% title | html %]
[% 'Language' | $T8 %]
[% 'Template Code' | $T8 %]
[% 'Article Code' | $T8 %]
[% 'Number Format' | $T8 %]
[% 'Date Format' | $T8 %]
[% 'Long Dates' | $T8 %][% L.radio_button_tag('output_longdates', checked=output_longdates, label=LxERP.t8('Yes')) %] + [% L.radio_button_tag('output_longdates', checked=!output_longdates, label=LxERP.t8('No')) %]

-- 2.20.1