From 9cfea02e19fe1bcb919d4eee4aa463e6db0c58f5 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 18 Mar 2025 16:45:15 +0100 Subject: [PATCH] Avoid excessive PHP and HTML mixing --- adminer/include/adminer.inc.php | 18 +++++------------- adminer/include/design.inc.php | 15 ++++++--------- adminer/include/editing.inc.php | 14 ++++++-------- adminer/include/html.inc.php | 10 ++++------ editor/include/adminer.inc.php | 13 ++++--------- 5 files changed, 25 insertions(+), 45 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index a0e41ea3..778b1fa4 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -986,15 +986,10 @@ class Adminer { */ function navigation($missing) { global $VERSION, $drivers, $connection; - ?> -

-name(); ?> - - - id="version"> - -

-" . $this->name() . "$VERSION"; + $new_version = $_COOKIE["adminer_version"]; + echo " " . (version_compare($VERSION, $new_version) < 0 ? h($new_version) : "") . ""; + echo "\n"; // this is matched by compile.php switch_lang(); if ($missing == "auth") { @@ -1084,10 +1079,7 @@ class Adminer { if (DB && $databases && !in_array(DB, $databases)) { array_unshift($databases, DB); } - ?> -
-

-\n

\n"; hidden_fields_get(); $db_events = script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});"); echo "" . lang('DB') . ": " . ($databases diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 1d90e308..a96581b4 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -183,14 +183,11 @@ function page_messages($error) { */ function page_footer($missing = "") { global $adminer; - ?> - - -

- - + echo "\n\n\n\n"; + if ($missing != "auth") { + ?>

@@ -198,7 +195,7 @@ function page_footer($missing = "") {

- - -" : ""); ?> - - - -\n"; + echo ($type == "PROCEDURE" ? "" : ""); + echo "" . ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); + echo "" . lang('Type') . "" . script("qs('#enum-edit').onblur = editingLengthBlur;"); + echo "" . lang('Length'); + echo "" . lang('Options'); // no label required, options have their own label if ($type == "TABLE") { echo "NULL\n"; echo "AI"; diff --git a/adminer/include/html.inc.php b/adminer/include/html.inc.php index ca728e44..14b10e58 100644 --- a/adminer/include/html.inc.php +++ b/adminer/include/html.inc.php @@ -520,10 +520,8 @@ function edit_form($table, $fields, $row, $update) { if (isset($_GET["select"])) { hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"])); } - ?> -"> - - - -\n"; + echo "\n"; + echo input_token(); + echo "\n"; } diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index bab09e50..17fbbca0 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -590,15 +590,10 @@ qsl('div').onclick = whisperClick;", "") function navigation($missing) { global $VERSION; - ?> -

-name(); ?> - - - id="version"> - -

-" . $this->name() . "$VERSION"; + $new_version = $_COOKIE["adminer_version"]; + echo " " . (version_compare($VERSION, $new_version) < 0 ? h($new_version) : "") . ""; + echo "\n"; switch_lang(); if ($missing == "auth") { $first = true;