Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a4f92ff1

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID a4f92ff17d2572ec3a0465fe4444c741d80ecc77
  • Vorgänger 391d6b54
  • Nachfolger f44e0506

Bei print_options() die Parameterübergabe umgestellt, sodass der Aufrufer das Verhalten etwas genauer beeinflussen kann.

Unterschiede anzeigen:

bin/mozilla/io.pl
1283 1283
  print $form->parse_html_template('generic/edit_email', 
1284 1284
                                  { title           => $title,
1285 1285
                                    a_filename      => $attachment_filename,
1286
                                    _print_options_ => print_options('inline'),
1286
                                    _print_options_ => print_options({ 'inline' => 1 }),
1287 1287
                                    HIDDEN          => [ map +{ name => $_, value => $form->{$_} }, @hidden_keys ],
1288 1288
                                    SHOW_BCC        => $myconfig{role} eq 'admin' });
1289 1289

  
......
1315 1315
#
1316 1316
# the inline options is untested, but intended to be used later in metatemplating
1317 1317
sub print_options {
1318
  $lxdebug->enter_sub() and my ($inline) = @_;
1318
  $lxdebug->enter_sub();
1319

  
1320
  my ($options) = @_;
1321

  
1322
  $options ||= { };
1319 1323

  
1320 1324
  # names 3 parameters and returns a hashref, for use in templates
1321 1325
  sub opthash { +{ value => shift, selected => shift, oname => shift } }
......
1370 1374
      opthash("screen", $form->{OP}{screen}, $locale->text('Screen')),
1371 1375
    (scalar @{ $form->{printers} } && $latex_templates) ?
1372 1376
      opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef,
1373
    ($latex_templates) ? 
1377
    ($latex_templates && !$options{no_queue}) ?
1374 1378
      opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef
1375 1379
        if ($form->{media} ne 'email');
1376 1380

  
......
1395 1399

  
1396 1400
  @SELECTS = map { sname => lc $_, DATA => \@$_, show => scalar @$_ }, qw(FORMNAME LANGUAGE_ID FORMAT SENDMODE MEDIA PRINTER_ID);
1397 1401

  
1402
  my %dont_display_groupitems = (
1403
    'dunning' => 1,
1404
    );
1405

  
1398 1406
  %template_vars = (
1399 1407
    display_copies       => scalar @{ $form->{printers} } && $latex_templates && $form->{media} ne 'email',
1400 1408
    display_remove_draft => (!$form->{id} && $form->{draft_id}),
1409
    display_groupitems   => !$dont_display_groupitems{$form->{type}},
1401 1410
    groupitems_checked   => $form->{groupitems} ? "checked" : '',
1402 1411
    remove_draft_checked => $form->{remove_draft} ? "checked" : ''
1403 1412
  );
1404 1413

  
1405 1414
  my $print_options = $form->parse_html_template("generic/print_options", { SELECTS  => \@SELECTS, %template_vars } );
1406 1415

  
1407
  if ($inline) {
1416
  if ($options{inline}) {
1408 1417
    $lxdebug->leave_sub() and return $print_options;
1409 1418
  } else {
1410 1419
    print $print_options; $lxdebug->leave_sub();

Auch abrufbar als: Unified diff