From 1395cdc1d0376f867078a346366992f97b4e815a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Mon, 2 Mar 2020 22:01:16 -0300 Subject: [PATCH] Extract HTML from MultSubmits::getHtmlForCopyMultipleTables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- libraries/classes/MultSubmits.php | 37 ++++--------- .../mult_submits/copy_multiple_tables.twig | 54 +++++++++++++++++++ 2 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 templates/mult_submits/copy_multiple_tables.twig diff --git a/libraries/classes/MultSubmits.php b/libraries/classes/MultSubmits.php index 3801701be5..ea700a0819 100644 --- a/libraries/classes/MultSubmits.php +++ b/libraries/classes/MultSubmits.php @@ -31,12 +31,16 @@ class MultSubmits /** @var Operations */ private $operations; + /** @var Template */ + private $template; + public function __construct() { $this->transformations = new Transformations(); $relation = new Relation($GLOBALS['dbi']); $this->relationCleanup = new RelationCleanup($GLOBALS['dbi'], $relation); $this->operations = new Operations($GLOBALS['dbi'], $relation); + $this->template = new Template(); } /** @@ -393,9 +397,6 @@ class MultSubmits */ public function getHtmlForCopyMultipleTables($action, array $urlParams) { - $html = '
'; - $html .= Url::getHiddenInputs($urlParams); - $html .= '
'; $databasesList = $GLOBALS['dblist']->databases; foreach ($databasesList as $key => $databaseName) { if ($databaseName == $GLOBALS['db']) { @@ -403,30 +404,12 @@ class MultSubmits break; } } - $html .= ''; - $html .= ''; - $html .= '

'; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= ''; - $html .= '

'; - $html .= ''; - $html .= '
'; - $html .= ''; - $html .= '
'; - $html .= ''; - $html .= '

'; - $html .= ''; - $html .= ''; - $html .= '
'; - $html .= ''; - $html .= '
'; - return $html; + + return $this->template->render('mult_submits/copy_multiple_tables', [ + 'action' => $action, + 'url_params' => $urlParams, + 'options' => $databasesList->getHtmlOptions(true, false), + ]); } /** diff --git a/templates/mult_submits/copy_multiple_tables.twig b/templates/mult_submits/copy_multiple_tables.twig new file mode 100644 index 0000000000..2f6ce211dc --- /dev/null +++ b/templates/mult_submits/copy_multiple_tables.twig @@ -0,0 +1,54 @@ +
+ {{ get_hidden_inputs(url_params) }} + +
+ + + +

+ + + +
+ + + + +
+ + + + +
+ + + + +

+ + + + +
+ + + + +
+ + + + +

+ + + +
+ + +