1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-31 18:11:52 +02:00

Add 'Home' to breadcrumb navigation

This commit is contained in:
Peter Knut
2024-10-09 23:07:51 +02:00
parent e5a7f75807
commit 62246338bf
46 changed files with 76 additions and 11 deletions

View File

@@ -1010,7 +1010,14 @@ class Adminer {
if ($password !== null) { if ($password !== null) {
$dbs = $_SESSION["db"][$vendor][$server][$username]; $dbs = $_SESSION["db"][$vendor][$server][$username];
foreach (($dbs ? array_keys($dbs) : array("")) as $db) { foreach (($dbs ? array_keys($dbs) : array("")) as $db) {
$output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($drivers[$vendor]) " . h($username . ($server != "" ? "@" . $this->serverName($server) : "") . ($db != "" ? " - $db" : "")) . "</a>\n"; $output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>"
. h($drivers[$vendor])
. ($username != "" || $server != "" ? " - " : "")
. h($username)
. ($username != "" && $server != "" ? "@" : "")
. ($server != "" ? h($this->serverName($server)) : "")
. ($db != "" ? h(" - $db") : "")
. "</a></li>\n";
} }
} }
} }

View File

@@ -6,7 +6,7 @@
* @param string used after colon in title and heading, should be HTML escaped * @param string used after colon in title and heading, should be HTML escaped
* @return null * @return null
*/ */
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { function page_header($title, $error = "", $breadcrumb = [], $title2 = "") {
global $LANG, $VERSION, $adminer, $drivers, $jush; global $LANG, $VERSION, $adminer, $drivers, $jush;
page_headers(); page_headers();
if (is_ajax() && $error) { if (is_ajax() && $error) {
@@ -67,32 +67,46 @@ var thousandsSeparator = '<?php echo js_escape(lang(',')); ?>';
<div id="content"> <div id="content">
<?php <?php
if ($breadcrumb !== null) { if ($breadcrumb !== null) {
echo '<p id="breadcrumb">';
$link = substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1); $link = substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1);
echo '<p id="breadcrumb"><a href="' . h($link ? $link : ".") . '">' . $drivers[DRIVER] . '</a> &raquo; '; echo '<a href="' . h($link ?: ".") . '">' . lang('Home') . '</a> » ';
$link = substr(preg_replace('~\b(db|ns)=[^&]*&~', '', ME), 0, -1);
$server = $adminer->serverName(SERVER); $server = "";
$server = ($server != "" ? $server : lang('Server'));
if ($breadcrumb === false) { if ($breadcrumb === false) {
echo "$server\n"; $server .= h($drivers[DRIVER]) . ": ";
} else {
echo "<a href='" . h($link) . "' accesskey='1' title='Alt+Shift+1'>$server</a> &raquo; ";
if ($_GET["ns"] != "" || (DB != "" && is_array($breadcrumb))) {
echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> &raquo; ';
} }
$server_name = $adminer->serverName(SERVER);
$server .= $server_name != "" ? h($server_name) : lang('Server');
if ($breadcrumb === false) {
echo h($server), "\n";
} else {
$link = substr(preg_replace('~\b(db|ns)=[^&]*&~', '', ME), 0, -1);
echo "<a href='" . h($link) . "' accesskey='1' title='Alt+Shift+1'>$server</a> » ";
if ($_GET["ns"] != "" || (DB != "" && is_array($breadcrumb))) {
echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> » ';
}
if (is_array($breadcrumb)) { if (is_array($breadcrumb)) {
if ($_GET["ns"] != "") { if ($_GET["ns"] != "") {
echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> &raquo; '; echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> » ';
} }
foreach ($breadcrumb as $key => $val) { foreach ($breadcrumb as $key => $val) {
$desc = (is_array($val) ? $val[1] : h($val)); $desc = (is_array($val) ? $val[1] : h($val));
if ($desc != "") { if ($desc != "") {
echo "<a href='" . h(ME . "$key=") . urlencode(is_array($val) ? $val[0] : $val) . "'>$desc</a> &raquo; "; echo "<a href='" . h(ME . "$key=") . urlencode(is_array($val) ? $val[0] : $val) . "'>$desc</a> » ";
} }
} }
} }
echo "$title\n"; echo "$title\n";
} }
} }
echo "<h2>$title_all</h2>\n"; echo "<h2>$title_all</h2>\n";
echo "<div id='ajaxstatus' class='jsonly hidden'></div>\n"; echo "<div id='ajaxstatus' class='jsonly hidden'></div>\n";
restart_session(); restart_session();

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'تسجيل الدخول', 'Login' => 'تسجيل الدخول',
'Logout successful.' => 'تم تسجيل الخروج بنجاح.', 'Logout successful.' => 'تم تسجيل الخروج بنجاح.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Система', 'System' => 'Система',
'Server' => 'Сървър', 'Server' => 'Сървър',
'Username' => 'Потребител', 'Username' => 'Потребител',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'লগইন', 'Login' => 'লগইন',
'Logout successful.' => 'সফলভাবে লগআউট হয়েছে।', 'Logout successful.' => 'সফলভাবে লগআউট হয়েছে।',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Sistem', 'System' => 'Sistem',
'Server' => 'Server', 'Server' => 'Server',
'Username' => 'Korisničko ime', 'Username' => 'Korisničko ime',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Inicia la sessió', 'Login' => 'Inicia la sessió',
'Logout successful.' => 'Desconnexió correcta.', 'Logout successful.' => 'Desconnexió correcta.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => 'Domů',
'System' => 'Systém', 'System' => 'Systém',
'Server' => 'Server', 'Server' => 'Server',
'Username' => 'Uživatel', 'Username' => 'Uživatel',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'System' => 'System', 'System' => 'System',
'Server' => 'Server', 'Server' => 'Server',
'Username' => 'Brugernavn', 'Username' => 'Brugernavn',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Login', 'Login' => 'Login',
'Logout successful.' => 'Abmeldung erfolgreich.', 'Logout successful.' => 'Abmeldung erfolgreich.',
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Danke, dass Sie Adminer genutzt haben. <a href="https://www.adminer.org/de/donation/">Spenden willkommen!</a>', 'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Danke, dass Sie Adminer genutzt haben. <a href="https://www.adminer.org/de/donation/">Spenden willkommen!</a>',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Σύστημα', 'System' => 'Σύστημα',
'Server' => 'Διακομιστής', 'Server' => 'Διακομιστής',
'Username' => 'Όνομα Χρήστη', 'Username' => 'Όνομα Χρήστη',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Login', 'Login' => 'Login',
'Logout successful.' => 'Sesión finalizada con éxito.', 'Logout successful.' => 'Sesión finalizada con éxito.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Logi sisse', 'Login' => 'Logi sisse',
'Logout successful.' => 'Väljalogimine õnnestus.', 'Logout successful.' => 'Väljalogimine õnnestus.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'سیستم', 'System' => 'سیستم',
'Server' => 'سرور', 'Server' => 'سرور',
'Username' => 'نام کاربری', 'Username' => 'نام کاربری',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Järjestelmä', 'System' => 'Järjestelmä',
'Server' => 'Palvelin', 'Server' => 'Palvelin',
'Username' => 'Käyttäjänimi', 'Username' => 'Käyttäjänimi',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Authentification', 'Login' => 'Authentification',
'Logout successful.' => 'Au revoir !', 'Logout successful.' => 'Au revoir !',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Conectar', 'Login' => 'Conectar',
'Logout successful.' => 'Pechouse a sesión con éxito.', 'Logout successful.' => 'Pechouse a sesión con éxito.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'התחברות', 'Login' => 'התחברות',
'Logout successful.' => 'ההתחברות הצליחה', 'Logout successful.' => 'ההתחברות הצליחה',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Belépés', 'Login' => 'Belépés',
'Logout successful.' => 'Sikeres kilépés.', 'Logout successful.' => 'Sikeres kilépés.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Sistem', 'System' => 'Sistem',
'Server' => 'Server', 'Server' => 'Server',
'Username' => 'Pengguna', 'Username' => 'Pengguna',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Autenticazione', 'Login' => 'Autenticazione',
'Logout successful.' => 'Uscita effettuata con successo.', 'Logout successful.' => 'Uscita effettuata con successo.',
'Invalid server or credentials.' => 'Server o credenziali non valide.', 'Invalid server or credentials.' => 'Server o credenziali non valide.',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'ログイン', 'Login' => 'ログイン',
'Logout successful.' => 'ログアウト', 'Logout successful.' => 'ログアウト',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'შესვლა', 'Login' => 'შესვლა',
'Logout successful.' => 'გამოხვედით სისტემიდან.', 'Logout successful.' => 'გამოხვედით სისტემიდან.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'$1-$3-$5' => '$1-$3-$5', '$1-$3-$5' => '$1-$3-$5',
'%.3f s' => '%.3f 초', '%.3f s' => '%.3f 초',
'%d byte(s)' => '%d 바이트', '%d byte(s)' => '%d 바이트',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Sistema', 'System' => 'Sistema',
'Server' => 'Serveris', 'Server' => 'Serveris',
'Username' => 'Vartotojas', 'Username' => 'Vartotojas',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Ieiet', 'Login' => 'Ieiet',
'Logout successful.' => 'Jūs veiksmīgi izgājāt no sistēmas.', 'Logout successful.' => 'Jūs veiksmīgi izgājāt no sistēmas.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Sistem', 'System' => 'Sistem',
'Server' => 'Pelayan', 'Server' => 'Pelayan',
'Username' => 'Nama pengguna', 'Username' => 'Nama pengguna',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Aanmelden', 'Login' => 'Aanmelden',
'Logout successful.' => 'Successvol afgemeld.', 'Logout successful.' => 'Successvol afgemeld.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'System' => 'System', 'System' => 'System',
'Server' => 'Server', 'Server' => 'Server',
'Username' => 'Brukernavn', 'Username' => 'Brukernavn',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Rodzaj bazy', 'System' => 'Rodzaj bazy',
'Server' => 'Serwer', 'Server' => 'Serwer',
'Username' => 'Użytkownik', 'Username' => 'Użytkownik',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Entrar', 'Login' => 'Entrar',
'Logout successful.' => 'Saída bem sucedida.', 'Logout successful.' => 'Saída bem sucedida.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Entrar', 'Login' => 'Entrar',
'Logout successful.' => 'Sessão terminada com sucesso.', 'Logout successful.' => 'Sessão terminada com sucesso.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Intră', 'Login' => 'Intră',
'Logout successful.' => 'Ați ieșit cu succes.', 'Logout successful.' => 'Ați ieșit cu succes.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'Войти', 'Login' => 'Войти',
'Logout successful.' => 'Вы успешно покинули систему.', 'Logout successful.' => 'Вы успешно покинули систему.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => 'Domov',
'Login' => 'Prihlásiť sa', 'Login' => 'Prihlásiť sa',
'Logout successful.' => 'Odhlásenie prebehlo v poriadku.', 'Logout successful.' => 'Odhlásenie prebehlo v poriadku.',
'Invalid server or credentials.' => 'Neplatný server alebo prihlasovacie údaje.', 'Invalid server or credentials.' => 'Neplatný server alebo prihlasovacie údaje.',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Sistem', 'System' => 'Sistem',
'Server' => 'Strežnik', 'Server' => 'Strežnik',
'Username' => 'Uporabniško ime', 'Username' => 'Uporabniško ime',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Систем', 'System' => 'Систем',
'Server' => 'Сервер', 'Server' => 'Сервер',
'Username' => 'Корисничко име', 'Username' => 'Корисничко име',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'System', 'System' => 'System',
'Server' => 'Server', 'Server' => 'Server',
'Username' => 'Användarnamn', 'Username' => 'Användarnamn',

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'நுழை', 'Login' => 'நுழை',
'Logout successful.' => 'வெற்றிக‌ர‌மாய் வெளியேறியாயிற்று.', 'Logout successful.' => 'வெற்றிக‌ர‌மாய் வெளியேறியாயிற்று.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,5 +1,6 @@
<?php <?php
$translations = array( $translations = array(
'Home' => null,
'Login' => 'เข้าสู่ระบบ', 'Login' => 'เข้าสู่ระบบ',
'Logout successful.' => 'ออกจากระบบเรียบร้อยแล้ว.', 'Logout successful.' => 'ออกจากระบบเรียบร้อยแล้ว.',
'Invalid server or credentials.' => null, 'Invalid server or credentials.' => null,

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Sistem', 'System' => 'Sistem',
'Server' => 'Sunucu', 'Server' => 'Sunucu',
'Username' => 'Kullanıcı', 'Username' => 'Kullanıcı',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Система Бази Даних', 'System' => 'Система Бази Даних',
'Server' => 'Сервер', 'Server' => 'Сервер',
'Username' => 'Користувач', 'Username' => 'Користувач',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => 'Hệ thống', 'System' => 'Hệ thống',
'Server' => 'Máy chủ', 'Server' => 'Máy chủ',
'Username' => 'Tên người dùng', 'Username' => 'Tên người dùng',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => 'Xx',
'System' => 'Xx', 'System' => 'Xx',
'Server' => 'Xx', 'Server' => 'Xx',
'Username' => 'Xx', 'Username' => 'Xx',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => '資料庫系統', 'System' => '資料庫系統',
'Server' => '伺服器', 'Server' => '伺服器',
'Username' => '帳號', 'Username' => '帳號',

View File

@@ -1,6 +1,7 @@
<?php <?php
$translations = array( $translations = array(
// label for database system selection (MySQL, SQLite, ...) // label for database system selection (MySQL, SQLite, ...)
'Home' => null,
'System' => '系统', 'System' => '系统',
'Server' => '服务器', 'Server' => '服务器',
'Username' => '用户名', 'Username' => '用户名',