Use template for displayGroupHeader
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
parent
7efdc53d2a
commit
ce9902b5f5
@ -365,28 +365,25 @@ class FormDisplayTemplate
|
||||
/**
|
||||
* Display group header
|
||||
*
|
||||
* @param string $header_text Text of header
|
||||
* @param string $headerText Text of header
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public static function displayGroupHeader($header_text)
|
||||
public static function displayGroupHeader($headerText)
|
||||
{
|
||||
global $_FormDisplayGroup;
|
||||
|
||||
$_FormDisplayGroup++;
|
||||
if (! $header_text) {
|
||||
if (! $headerText) {
|
||||
return null;
|
||||
}
|
||||
$colspan = $GLOBALS['PMA_Config']->get('is_setup')
|
||||
? 3
|
||||
: 2;
|
||||
$htmlOutput = '<tr class="group-header group-header-' . $_FormDisplayGroup
|
||||
. '">';
|
||||
$htmlOutput .= '<th colspan="' . $colspan . '">';
|
||||
$htmlOutput .= $header_text;
|
||||
$htmlOutput .= '</th>';
|
||||
$htmlOutput .= '</tr>';
|
||||
return $htmlOutput;
|
||||
$colspan = $GLOBALS['PMA_Config']->get('is_setup') ? 3 : 2;
|
||||
|
||||
return Template::get('config/form_display/group_header')->render([
|
||||
'group' => $_FormDisplayGroup,
|
||||
'colspan' => $colspan,
|
||||
'header_text' => $headerText,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
5
templates/config/form_display/group_header.twig
Normal file
5
templates/config/form_display/group_header.twig
Normal file
@ -0,0 +1,5 @@
|
||||
<tr class="group-header group-header-{{ group }}">
|
||||
<th colspan="{{ colspan }}">
|
||||
{{ header_text }}
|
||||
</th>
|
||||
</tr>
|
||||
Loading…
Reference in New Issue
Block a user