Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ab435052

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

  • ID ab435052813cbf5a2f9052dc3d46aa672dac9d44
  • Vorgänger 6d6d4044
  • Nachfolger 3af76802

PrintOptions_Helper: Dokumentation

Unterschiede anzeigen:

SL/Helper/PrintOptions.pm
136 136
}
137 137

  
138 138
1;
139

  
140
__END__
141

  
142
=pod
143

  
144
=encoding utf8
145

  
146
=head1 NAME
147

  
148
SL::Helper::PrintOptions - A helper for generating the print options for
149
templates
150

  
151
=head1 SYNOPSIS
152

  
153
  # render your template with print_options
154
  $self->render('letter/edit',
155
    %params,
156
    letter        => $letter,
157
    print_options => SL::Helper::PrintOptions->get_print_options (
158
      options => { no_postscript   => 1,
159
                   no_opendocument => 1,
160
                   no_html         => 1,
161
                   no_queue        => 1 }),
162

  
163
  );
164

  
165
Then, in the template, you can render the options with
166
    C<[% print_options %]>. Look at the template
167
    C<generic/print_options> to see, which variables you get back.
168

  
169
=head1 FUNCTIONS
170

  
171
=over 4
172

  
173
=item C<get_print_options %params>
174

  
175
Parses the template C<generic/print_options>. It does some guessings
176
    and settings according to the params, (namely C<form>).
177

  
178

  
179
The recognized parameters are:
180

  
181
=over 2
182

  
183
=item * C<form>: defaults to $::form if not given. There are several
184
    keys in C<form> which control the output of the options,
185
    e.g. C<format>, C<media>, C<copies>, C<printers>, C<printer_id>,
186
    C<type>, C<formname>, ...
187

  
188
=item * C<myconfig>: defaults to %::myconfig
189

  
190
=item * C<locale>: defaults to $::locale
191

  
192
=item * C<options>: Options can be:
193

  
194
* C<dialog_name_prefix>: a string prefixed to the template
195
    variables. E.g. if prefix is C<mypref_> the value for copies
196
    returned from the user is in $::form->{mypref_copies}
197

  
198
* C<show_header>: render headings for the input elements
199

  
200
* C<no_queue>: if set, do not show option for printing to queue
201

  
202
* C<no_opendocument>: if set, do not show option for printing
203
    opendocument format
204

  
205
* C<no_postscript>: if set, do not show option for printing
206
    postscript format
207

  
208
* C<no_html>: if set, do not show option for printing
209
    html format
210

  
211
* C<no_opendocument_pdf>
212

  
213
* C<no_excel>
214

  
215
* and some more
216

  
217
=back
218

  
219
=back
220

  
221
=head1 AUTHOR
222

  
223
?
224

  
225
Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt> (I just moved
226
    it from io.pl to here and did some minor changes)
227

  
228
=head1 BUGS
229

  
230
incomplete documentation
231

  
232
=cut

Auch abrufbar als: Unified diff