};
$self->{export} = {
'nextsub' => '',
- 'variable_list' => '',
+ 'variable_list' => [],
};
$self->{data_present} = 0;
$self->{export} = {
'nextsub' => shift,
- 'variable_list' => join(" ", @_),
+ 'variable_list' => [ @_ ],
};
}
}
}
- my @export_variables;
- foreach my $key (split m/ +/, $self->{export}->{variable_list}) {
- push @export_variables, { 'key' => $key, 'value' => $self->{form}->{$key} };
- }
+ my @export_variables = $self->{form}->flatten_variables(@{ $self->{export}->{variable_list} });
my $allow_pdf_export = $opts->{allow_pdf_export} && (-x $main::html2ps_bin) && (-x $main::ghostscript_bin);
'NUM_COLUMNS' => scalar @column_headers,
'ROWS' => \@rows,
'EXPORT_VARIABLES' => \@export_variables,
- 'EXPORT_VARIABLE_LIST' => $self->{export}->{variable_list},
+ 'EXPORT_VARIABLE_LIST' => join(' ', @{ $self->{export}->{variable_list} }),
'EXPORT_NEXTSUB' => $self->{export}->{nextsub},
'DATA_PRESENT' => $self->{data_present},
};
return;
}
- my @form_values;
- map { push @form_values, { 'key' => $_, 'value' => $form->{$_} } } keys %{ $form };
+ my @form_values = $form->flatten_variables(keys %{ $form });
$form->get_lists('printers' => 'ALL_PRINTERS');
map { $_->{selected} = $myconfig{default_printer_id} == $_->{id} } @{ $form->{ALL_PRINTERS} };
return;
}
- my @form_values;
- map { push @form_values, { 'key' => $_, 'value' => $form->{$_} } } keys %{ $form };
+ my @form_values = $form->flatten_variables(keys %{ $form });
$form->{title} = $locale->text('CSV export -- options');
$form->header();