Fix list separator on first loop

This commit is contained in:
ATM john 2020-02-23 23:17:10 +01:00
parent 316fa4068a
commit acacbfd85e

View File

@ -1255,7 +1255,7 @@ abstract class CommonDocGenerator
}); });
// define some HTML content with style // define some HTML content with style
$html.= '<style>'.$params['style'].'</style>'; $html.= !empty($params['style'])?'<style>'.$params['style'].'</style>':'';
// auto select display format // auto select display format
if($params['display'] == 'auto') { if($params['display'] == 'auto') {
@ -1270,10 +1270,12 @@ abstract class CommonDocGenerator
if($params['display'] == 'list') { if($params['display'] == 'list') {
// Display in list format // Display in list format
$i=0;
foreach ($fields as $field) { foreach ($fields as $field) {
$html .= !empty($html)?$params['list']['separator']:''; $html .= !empty($i)?$params['list']['separator']:'';
$html .= '<strong>' . $field->label . ' : </strong>'; $html .= '<strong>' . $field->label . ' : </strong>';
$html .= $field->content; $html .= $field->content;
$i++;
} }
} }
elseif($params['display'] == 'table') { elseif($params['display'] == 'table') {