diff --git a/libraries/classes/Config/FormDisplayTemplate.php b/libraries/classes/Config/FormDisplayTemplate.php index d4dff1997b..cb82e32a79 100644 --- a/libraries/classes/Config/FormDisplayTemplate.php +++ b/libraries/classes/Config/FormDisplayTemplate.php @@ -413,30 +413,16 @@ class FormDisplayTemplate /** * Displays bottom part of a fieldset * - * @param bool $show_buttons whether show submit and reset button + * @param bool $showButtons Whether show submit and reset button * * @return string */ - public static function displayFieldsetBottom($show_buttons = true) + public static function displayFieldsetBottom($showButtons = true) { - $colspan = 2; - if ($GLOBALS['PMA_Config']->get('is_setup')) { - $colspan++; - } - $htmlOutput = ''; - if ($show_buttons) { - $htmlOutput .= ''; - $htmlOutput .= ''; - $htmlOutput .= ''; - $htmlOutput .= ''; - $htmlOutput .= ''; - $htmlOutput .= ''; - } - $htmlOutput .= ''; - $htmlOutput .= ''; - return $htmlOutput; + return Template::get('config/form_display/fieldset_bottom')->render([ + 'show_buttons' => $showButtons, + 'is_setup' => $GLOBALS['PMA_Config']->get('is_setup'), + ]); } /** diff --git a/templates/config/form_display/fieldset_bottom.twig b/templates/config/form_display/fieldset_bottom.twig new file mode 100644 index 0000000000..bc745d3e75 --- /dev/null +++ b/templates/config/form_display/fieldset_bottom.twig @@ -0,0 +1,14 @@ +{% set colspan = 2 %} +{% if is_setup %} + {% set colspan = colspan + 1 %} +{% endif %} +{% if show_buttons %} + + + + + + +{% endif %} + +