From ce9902b5f59ca20e2ade2f0e87d0bb8f9a9ea0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 10 Nov 2017 18:20:32 -0200 Subject: [PATCH] Use template for displayGroupHeader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- .../classes/Config/FormDisplayTemplate.php | 23 ++++++++----------- .../config/form_display/group_header.twig | 5 ++++ 2 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 templates/config/form_display/group_header.twig diff --git a/libraries/classes/Config/FormDisplayTemplate.php b/libraries/classes/Config/FormDisplayTemplate.php index 6f7bc03dfb..86d9b32a75 100644 --- a/libraries/classes/Config/FormDisplayTemplate.php +++ b/libraries/classes/Config/FormDisplayTemplate.php @@ -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 = ''; - $htmlOutput .= ''; - $htmlOutput .= $header_text; - $htmlOutput .= ''; - $htmlOutput .= ''; - 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, + ]); } /** diff --git a/templates/config/form_display/group_header.twig b/templates/config/form_display/group_header.twig new file mode 100644 index 0000000000..47f1388f46 --- /dev/null +++ b/templates/config/form_display/group_header.twig @@ -0,0 +1,5 @@ + + + {{ header_text }} + +