fix template parser and attachments fields
This commit is contained in:
parent
cc26d97805
commit
d15891dbb9
2 changed files with 33 additions and 44 deletions
|
|
@ -163,7 +163,8 @@ sub toHtml {
|
|||
# Table headers
|
||||
$output .= '<table id="' . $self->get( 'id' ) . '"><thead><tr>';
|
||||
for my $field ( @{ $self->get('fields') } ) {
|
||||
$output .= '<th>' . $field->{label} . '</th>';
|
||||
my $label = ref $field->{label} eq 'ARRAY' ? $i18n->get(@{$field->{label}}) : $field->{label};
|
||||
$output .= '<th>' . $label . '</th>';
|
||||
}
|
||||
$output .= '<th> </th>'; # Extra column for buttons
|
||||
|
||||
|
|
@ -190,6 +191,10 @@ sub toHtml {
|
|||
for my $i ( 0 .. $opts-1 ) {
|
||||
my $optValue = $field->{options}[$i*2];
|
||||
my $optLabel = $field->{options}[$i*2+1];
|
||||
# If the label is an arrayref, get the i18n value
|
||||
if ( ref $optLabel eq 'ARRAY' ) {
|
||||
$optLabel = $i18n->get(@{$optLabel});
|
||||
}
|
||||
$fieldHtml .= '<option value="' . $optValue . '">' . $optLabel . '</option>';
|
||||
}
|
||||
$fieldHtml .= '</select>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue