849 |
849 |
$::lxdebug->enter_sub;
|
850 |
850 |
$::auth->assert('config');
|
851 |
851 |
|
852 |
|
AM->language(\%myconfig, \%$form);
|
|
852 |
AM->language(\%::myconfig, $::form);
|
853 |
853 |
|
854 |
854 |
$::form->{callback} = "am.pl?action=list_language";
|
855 |
855 |
$::form->{title} = $::locale->text('Languages');
|
... | ... | |
862 |
862 |
}
|
863 |
863 |
|
864 |
864 |
sub language_header {
|
865 |
|
$main::lxdebug->enter_sub();
|
866 |
|
|
867 |
|
my $form = $main::form;
|
868 |
|
my $locale = $main::locale;
|
869 |
|
|
870 |
|
$main::auth->assert('config');
|
871 |
|
|
872 |
|
$form->{title} = $locale->text("$form->{title} Language");
|
|
865 |
$::lxdebug->enter_sub;
|
|
866 |
$::auth->assert('config');
|
873 |
867 |
|
874 |
868 |
# $locale->text('Add Language')
|
875 |
869 |
# $locale->text('Edit Language')
|
|
870 |
$::form->{title} = $::locale->text("$::form->{title} Language");
|
876 |
871 |
|
877 |
|
$form->{description} =~ s/\"/"/g;
|
878 |
|
$form->{template_code} =~ s/\"/"/g;
|
879 |
|
$form->{article_code} =~ s/\"/"/g;
|
880 |
|
|
881 |
|
|
882 |
|
$form->header;
|
883 |
|
|
884 |
|
my $numberformat =
|
885 |
|
qq|<option value="">| . $locale->text("use program settings") .
|
886 |
|
qq|</option>|;
|
887 |
|
foreach my $item (('1,000.00', '1000.00', '1.000,00', '1000,00')) {
|
888 |
|
$numberformat .=
|
889 |
|
($item eq $form->{output_numberformat})
|
890 |
|
? "<option selected>$item"
|
891 |
|
: "<option>$item"
|
892 |
|
. "</option>";
|
893 |
|
}
|
894 |
|
|
895 |
|
my $dateformat =
|
896 |
|
qq|<option value="">| . $locale->text("use program settings") .
|
897 |
|
qq|</option>|;
|
898 |
|
foreach my $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
|
899 |
|
$dateformat .=
|
900 |
|
($item eq $form->{output_dateformat})
|
901 |
|
? "<option selected>$item"
|
902 |
|
: "<option>$item"
|
903 |
|
. "</option>";
|
904 |
|
}
|
905 |
|
|
906 |
|
print qq|
|
907 |
|
<body>
|
908 |
|
|
909 |
|
<form method=post action=am.pl>
|
910 |
|
|
911 |
|
<input type=hidden name=id value=$form->{id}>
|
912 |
|
<input type=hidden name=type value=language>
|
|
872 |
$::form->header;
|
913 |
873 |
|
914 |
|
<table width=100%>
|
915 |
|
<tr>
|
916 |
|
<th class=listtop colspan=2>$form->{title}</th>
|
917 |
|
</tr>
|
918 |
|
<tr height="5"></tr>
|
919 |
|
<tr>
|
920 |
|
<th align=right>| . $locale->text('Language') . qq|</th>
|
921 |
|
<td><input name=description size=30 value="| . $form->quote($form->{description}) . qq|"></td>
|
922 |
|
<tr>
|
923 |
|
<tr>
|
924 |
|
<th align=right>| . $locale->text('Template Code') . qq|</th>
|
925 |
|
<td><input name=template_code size=5 value="| . $form->quote($form->{template_code}) . qq|"></td>
|
926 |
|
</tr>
|
927 |
|
<tr>
|
928 |
|
<th align=right>| . $locale->text('Article Code') . qq|</th>
|
929 |
|
<td><input name=article_code size=10 value="| . $form->quote($form->{article_code}) . qq|"></td>
|
930 |
|
</tr>
|
931 |
|
<tr>
|
932 |
|
<th align=right>| . $locale->text('Number Format') . qq|</th>
|
933 |
|
<td><select name="output_numberformat">$numberformat</select></td>
|
934 |
|
</tr>
|
935 |
|
<tr>
|
936 |
|
<th align=right>| . $locale->text('Date Format') . qq|</th>
|
937 |
|
<td><select name="output_dateformat">$dateformat</select></td>
|
938 |
|
</tr>
|
939 |
|
<tr>
|
940 |
|
<th align=right>| . $locale->text('Long Dates') . qq|</th>
|
941 |
|
<td><input type="radio" name="output_longdates" value="1"| .
|
942 |
|
($form->{output_longdates} ? " checked" : "") .
|
943 |
|
qq|>| . $locale->text("Yes") .
|
944 |
|
qq|<input type="radio" name="output_longdates" value="0"| .
|
945 |
|
($form->{output_longdates} ? "" : " checked") .
|
946 |
|
qq|>| . $locale->text("No") .
|
947 |
|
qq|</td>
|
948 |
|
</tr>
|
949 |
|
<td colspan=2><hr size=3 noshade></td>
|
950 |
|
</tr>
|
951 |
|
</table>
|
952 |
|
|;
|
|
874 |
print $::form->parse_html_template('am/language_header', {
|
|
875 |
numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00' ],
|
|
876 |
dateformats => [ qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ],
|
|
877 |
});
|
953 |
878 |
|
954 |
|
$main::lxdebug->leave_sub();
|
|
879 |
$::lxdebug->leave_sub;
|
955 |
880 |
}
|
956 |
881 |
|
957 |
882 |
sub save_language {
|
am/language_header auf template umgestellt