]> git.joonet.de Git - adminer.git/commitdiff
Plugins: Link screenshot
authorJakub Vrana <jakub@vrana.cz>
Mon, 7 Apr 2025 17:09:53 +0000 (19:09 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 7 Apr 2025 17:18:43 +0000 (19:18 +0200)
12 files changed:
adminer/include/connect.inc.php
adminer/include/plugin.inc.php
adminer/lang/cs.inc.php
adminer/lang/xx.inc.php
plugins/backward-keys.php
plugins/codemirror.php
plugins/config.php
plugins/dark-switcher.php
plugins/designs.php
plugins/login-otp.php
plugins/menu-links.php
plugins/sql-gemini.php

index 884acdb22808d78e0b203e12ad62bcf0ed4b184e..58dac265b31e9f6e3b651501f5de1f4c8d6fbac2 100644 (file)
@@ -100,7 +100,12 @@ if (
                                                $description = $match[1];
                                        }
                                }
-                               echo "<li><b>" . get_class($plugin) . "</b>" . h($description ? ": $description" : "") . "\n";
+                               $screenshot = (method_exists($plugin, 'screenshot') ? $plugin->screenshot() : "");
+                               echo "<li><b>" . get_class($plugin) . "</b>"
+                                       . h($description ? ": $description" : "")
+                                       . ($screenshot ? " (<a href='" . h($screenshot) . "'" . target_blank() . ">" . lang('screenshot') . "</a>)" : "")
+                                       . "\n"
+                               ;
                        }
                        echo "</ul>\n";
                        echo "</div>\n";
index 08c8f216f4396a53eadebdf1bf64db7c9710e0d2..dfbf78711137c10c04dd9c004146de02e4a1dfe6 100644 (file)
@@ -12,6 +12,13 @@ abstract class Plugin {
                return $this->lang('');
        }
 
+       /** Get URL of plugin screenshot
+       * @return string
+       */
+       function screenshot() {
+               return "";
+       }
+
        /** Translate a string from static::$translations; use Adminer\lang() for strings used by Adminer
        * @param literal-string $idf
        * @param float|string $number
index 308cf0618c8a4f5542db13b579ffb63e71d77f53..21c4575dab6f458665dda2ef82ca07bd3e4a5a31 100644 (file)
@@ -13,9 +13,6 @@ Lang::$translations = array(
        'Logged as: %s' => 'Přihlášen jako: %s',
        'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
        'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Díky za použití Admineru, <a href="https://www.adminer.org/cs/donation/">přispějte</a> na vývoj.',
-       'Loaded plugins' => 'Nahrané pluginy',
-       '%s must <a%s>return an array</a>.' => '%s musí <a%s>vracet pole</a>.',
-       '<a%s>Configure</a> %s in %s.' => '<a%s>Nakonfigurujte</a> %s v %s.',
        'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
        'There is a space in the input password which might be the cause.' => 'Problém může být, že je v zadaném hesle mezera.',
        'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nepodporuje přístup k databázi bez hesla, <a href="https://www.adminer.org/cs/password/"%s>více informací</a>.',
@@ -352,6 +349,11 @@ Lang::$translations = array(
        'Check has been created.' => 'Kontrola byla vytvořena.',
        'Check has been altered.' => 'Kontrola byla změněna.',
        'Check has been dropped.' => 'Kontrola byla odstraněna.',
+
+       'Loaded plugins' => 'Nahrané pluginy',
+       '%s must <a%s>return an array</a>.' => '%s musí <a%s>vracet pole</a>.',
+       '<a%s>Configure</a> %s in %s.' => '<a%s>Nakonfigurujte</a> %s v %s.',
+       'screenshot' => 'obrázek',
 );
 
 // run `php ../../lang.php cs` to update this file
index b74fb8116b1813e5482266a22a6fbc6a254dd094..7217c8a4d7112ae04d4bed1b76e2afefaaed7314 100644 (file)
@@ -13,9 +13,6 @@ Lang::$translations = array(
        'Logged as: %s' => 'Xx: %s',
        'Logout successful.' => 'Xx.',
        'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Xx <a href="https://www.adminer.org/en/donation/">xx</a>.',
-       'Loaded plugins' => 'Xx',
-       '%s must <a%s>return an array</a>.' => '%s xx <a%s>xx</a>.',
-       '<a%s>Configure</a> %s in %s.' => '<a%s>Xx</a> %s xx %s.',
        'Invalid credentials.' => 'Xx.',
        'There is a space in the input password which might be the cause.' => 'Xx.',
        'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Xx, <a href="https://www.adminer.org/en/password/"%s>xx</a>.',
@@ -354,6 +351,11 @@ Lang::$translations = array(
        'Check has been created.' => 'Xx.',
        'Check has been altered.' => 'Xx.',
        'Check has been dropped.' => 'Xx.',
+
+       'Loaded plugins' => 'Xx',
+       '%s must <a%s>return an array</a>.' => '%s xx <a%s>xx</a>.',
+       '<a%s>Configure</a> %s in %s.' => '<a%s>Xx</a> %s xx %s.',
+       'screenshot' => 'xx',
 );
 
 // run `php ../../lang.php xx` to update this file
index 67bb5a085d23a0bbbccc1e5b331073d6ef6f430e..33754ea92d8dd405fd061a22d03f1714e70b5e3b 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 
 /** Display links to tables referencing current row, same as in Adminer Editor
-* @link https://www.adminer.org/static/plugins/backward-keys.png
 * @link https://www.adminer.org/plugins/#use
 * @author Jakub Vrana, https://www.vrana.cz/
 * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
@@ -53,6 +52,10 @@ ORDER BY ORDINAL_POSITION", null, "") as $row
                }
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/plugins/backward-keys.png";
+       }
+
        protected static $translations = array(
                'cs' => array('' => 'Zobrazí odkazy na tabulky odkazující aktuální řádek, stejně jako Adminer Editor'),
        );
index 746a1ac6766e0daf86d7733e1c3f4beadb97dac8..d51c53d3df901cef3a8f97b1d30be4d689c3d7c3 100644 (file)
@@ -98,6 +98,10 @@ addEventListener('DOMContentLoaded', () => {
                return true;
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/plugins/codemirror.gif";
+       }
+
        protected static $translations = array(
                'cs' => array('' => 'Použít CodeMirror 5 pro zvýrazňování syntaxe a <textarea> včetně našeptávání klíčových slov  a tabulek'),
        );
index b7106325c7faf11ccd58907901c574287e8f7053..0853a42cdbfb2e09b314f58d7f9ccfc012303cb4 100644 (file)
@@ -67,6 +67,10 @@ class AdminerConfig extends Adminer\Plugin {
                }
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/plugins/config.png";
+       }
+
        protected static $translations = array(
                'cs' => array(
                        '' => 'Konfigurace možností uživateli a jejich uložení do cookie',
index d47ec69204bb0efa45f381d6beddfde0068b20e7..ee7399b7fd120a1ecc745974b05efd309e76deb9 100644 (file)
@@ -39,6 +39,10 @@ if (saved) {
                ;
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/plugins/dark-switcher.gif";
+       }
+
        protected static $translations = array(
                'cs' => array('' => 'Dovoluje přepínání světlého a tmavého vzhledu'),
        );
index 0c0934d6c17c4b0a99982b8b005e7a9838cdb6cc..2ec8d60d8e6e2109f934cc6e4f6ea3f6cdad2c19 100644 (file)
@@ -39,6 +39,10 @@ class AdminerDesigns extends Adminer\Plugin {
                echo "</form>\n";
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/plugins/designs.png";
+       }
+
        protected static $translations = array(
                'cs' => array('' => 'Umožní změnit vzhled'),
                'de' => array('' => 'Designwechsel ermöglichen'),
index 2574d909fab0b4160711b17c7447e161a61868bb..7648eda670956e2a1e38e5fab6e94b38d25309d5 100644 (file)
@@ -51,6 +51,10 @@ class AdminerLoginOtp extends Adminer\Plugin {
                return ($unpacked[1] & 0x7FFFFFFF) % 1e6;
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/login-otp.png";
+       }
+
        protected static $translations = array(
                'cs' => array('' => 'Při přihlášení požaduje jednorázové heslo'),
                'de' => array('' => 'Bei der Anmeldung ist ein Einmalpasswort (Zwei-Faktor-Authentifizierung) erforderlich'),
index 0fac5ae4e177abf360dc68cf56c20e13c411bfc4..dffbcb58b32bb384f21f0a3a9985e94f5fccf45a 100644 (file)
@@ -67,6 +67,10 @@ class AdminerMenuLinks extends Adminer\Plugin {
                return true;
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/plugins/menu-links.png";
+       }
+
        protected static $translations = array(
                'cs' => array(
                        '' => 'Konfigurace odkazů na tabulky v menu; kombinovatelné s AdminerConfig',
index 7f7846bf1b0d810d667d83a8dff50b057c780af0..7bcc6febba855d445859d7e57d423d7415a532a8 100644 (file)
@@ -2,7 +2,6 @@
 
 /** AI prompt in SQL command generating the queries with Google Gemini
 * Beware that this sends your whole database structure (not data) to Google Gemini.
-* @link https://www.adminer.org/static/plugins/sql-gemini.gif
 * @link https://gemini.google.com/
 * @link https://www.adminer.org/plugins/#use
 * @author Jakub Vrana, https://www.vrana.cz/
@@ -92,6 +91,10 @@ geminiText.onkeydown = event => {
 <?php
        }
 
+       function screenshot() {
+               return "https://www.adminer.org/static/plugins/sql-gemini.gif";
+       }
+
        // use the phrases from https://gemini.google.com/
        protected static $translations = array(
                'cs' => array(