Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6d6d4044

Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt

  • ID 6d6d4044b1caa0e4f7c9de61e3a0bc9dd691a035
  • Vorgänger 2500bc30
  • Nachfolger ab435052

PrintOptions_Helper: Angabe eines prefix ermöglichen.

Unterschiede anzeigen:

SL/Helper/PrintOptions.pm
22 22
  my $locale   = $params{locale}   || $::locale;
23 23
  my $options  = $params{options};
24 24

  
25
  my $prefix = $options->{dialog_name_prefix} || '';
26

  
25 27
  # names 3 parameters and returns a hashref, for use in templates
26 28
  sub opthash { +{ value => shift, selected => shift, oname => shift } }
27 29
  my (@FORMNAME, @LANGUAGE_ID, @FORMAT, @SENDMODE, @MEDIA, @PRINTER_ID, @SELECTS) = ();
......
122 124
    );
123 125

  
124 126
  my %template_vars = (
127
    name_prefix          => $prefix || '',
125 128
    display_copies       => scalar @{ $form->{printers} || [] } && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email',
126 129
    display_remove_draft => (!$form->{id} && $form->{draft_id}),
127 130
    display_groupitems   => !$dont_display_groupitems{$form->{type}},
......
132 135
  return $form->parse_html_template("generic/print_options", { SELECTS  => \@SELECTS, %template_vars } );
133 136
}
134 137

  
135

  
136 138
1;
137

  
templates/webpages/generic/print_options.html
9 9
     <td>
10 10
      [%- FOREACH row = SELECTS %]
11 11
      [%- IF row.show %]
12
      <select name="[% row.sname %]">
12
      <select name="[%- name_prefix %][%- row.sname %]">
13 13
       [%- FOREACH data = row.DATA %]
14 14
       <option value="[% data.value %]" [% data.selected %]>[% data.oname %]</option>
15 15
       [%- END %]
......
18 18
      [%- END %]
19 19
     </td>
20 20
     [%- IF display_copies %]
21
     <td>[% 'Copies' | $T8 %] <input name="copies" size="2" value="[% HTML.escape(copies) %]"></td>
21
     <td>[% 'Copies' | $T8 %] <input name="[%- name_prefix %]copies" size="2" value="[% HTML.escape(copies) %]"></td>
22 22
     [%- END %]
23 23
     [%- IF display_groupitems %]
24 24
     <td>[% 'Group Items' | $T8 %]</td>
25
     <td><input name="groupitems" type="checkbox" class="checkbox" [% groupitems_checked %]></td>
25
     <td><input name="[%- name_prefix %]groupitems" type="checkbox" class="checkbox" [% groupitems_checked %]></td>
26 26
     [%- END %]
27 27
     [%- IF display_remove_draft %]
28 28
     <td>[% 'Remove Draft' | $T8 %]</td>
29
     <td><input name="remove_draft" type="checkbox" class="checkbox" [% remove_draft_checked %]></td>
29
     <td><input name="[%- name_prefix %]remove_draft" type="checkbox" class="checkbox" [% remove_draft_checked %]></td>
30 30
     [%- END %]
31 31
    </tr>
32 32
   </table>

Auch abrufbar als: Unified diff