Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a52aa2f2

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID a52aa2f26cd22d26f59772695cf27c7b42157e00
  • Vorgänger e16e1f36
  • Nachfolger 2f833a26

am/language_header auf template umgestellt

Unterschiede anzeigen:

bin/mozilla/am.pl
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 {
templates/webpages/am/language_header.html
1
[%- USE L %]
2
[%- USE HTML %]
3
[%- USE LxERP %]
4
[%- USE T8 %]
5
<body>
6

  
7
<form method=post action=am.pl>
8

  
9
<input type=hidden name=id value='[% id %]'>
10
<input type=hidden name=type value=language>
11

  
12
<table width=100%>
13
  <tr>
14
    <th class=listtop colspan=2>[% title | html %]</th>
15
  </tr>
16
  <tr height="5"></tr>
17
  <tr>
18
    <th align=right>[% 'Language' | $T8 %]</th>
19
    <td><input name=description size=30 value="[% description | html %]"></td>
20
  <tr>
21
  <tr>
22
    <th align=right>[% 'Template Code' | $T8 %]</th>
23
    <td><input name=template_code size=5 value="[% template_code | html %]"></td>
24
  </tr>
25
  <tr>
26
    <th align=right>[% 'Article Code' | $T8 %]</th>
27
    <td><input name=article_code size=10 value="[% article_code | html %]"></td>
28
  </tr>
29
  <tr>
30
    <th align=right>[% 'Number Format' | $T8 %]</th>
31
    <td><select name="output_numberformat">[% L.options_for_select(numberformats, default=output_numberformat, with_empty=1, empty_title=LxERP.t8('use program settings')) %]</select></td>
32
  </tr>
33
  <tr>
34
    <th align=right>[% 'Date Format' | $T8 %]</th>
35
    <td><select name="output_dateformat">[% L.options_for_select(dateformats, default=output_dateformat, with_empty=1, empty_title=LxERP.t8('use program settings')) %]</select></td>
36
  </tr>
37
  <tr>
38
    <th align=right>[% 'Long Dates' | $T8 %]</th>
39
    <td>[% L.radio_button_tag('output_longdates', checked=output_longdates, label=LxERP.t8('Yes')) %]
40
        [% L.radio_button_tag('output_longdates', checked=!output_longdates, label=LxERP.t8('No')) %]</td>
41
  </tr>
42
  <td colspan=2><hr size=3 noshade></td>
43
  </tr>
44
</table>

Auch abrufbar als: Unified diff