]> git.joonet.de Git - adminer.git/commitdiff
Plugins autoloading: Link help
authorJakub Vrana <jakub@vrana.cz>
Fri, 21 Mar 2025 07:18:40 +0000 (08:18 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 21 Mar 2025 21:23:45 +0000 (22:23 +0100)
adminer/include/plugins.inc.php
adminer/lang/cs.inc.php
adminer/lang/pl.inc.php
adminer/lang/xx.inc.php

index d1e9fcb5fd6a9bf3f2502299da4333d2c2bcdaf0..2a6eca6a18585c288b366e224ce957e59dc627bf 100644 (file)
@@ -2,8 +2,8 @@
 namespace Adminer;
 
 class Plugins extends Adminer {
-       public $plugins; ///< @var protected(set)
-       public $error = ''; ///< @var protected(set)
+       public $plugins; ///< @var protected(set) array
+       public $error = ''; ///< @var protected(set) string HTML
 
        /** Register plugins
        * @param array object instances or null to autoload plugins from adminer-plugins/
@@ -17,6 +17,7 @@ class Plugins extends Adminer {
                                        $include = include_once "./$filename";
                                }
                        }
+                       $help = " href='https://www.adminer.org/plugins/#use'" . target_blank();
                        if (file_exists("$basename.php")) {
                                $include = include_once "./$basename.php"; // example: return array(new AdminerLoginOtp($secret))
                                if (is_array($include)) {
@@ -24,7 +25,7 @@ class Plugins extends Adminer {
                                                $plugins[get_class($plugin)] = $plugin;
                                        }
                                } else {
-                                       $this->error .= lang('<b>%s</b> must return an array.', "$basename.php") . "<br>";
+                                       $this->error .= lang('%s must <a%s>return an array</a>.', "<b>$basename.php</b>", $help) . "<br>";
                                }
                        }
                        foreach (get_declared_classes() as $class) {
@@ -32,7 +33,7 @@ class Plugins extends Adminer {
                                        $reflection = new \ReflectionClass($class);
                                        $constructor = $reflection->getConstructor();
                                        if ($constructor && $constructor->getNumberOfRequiredParameters()) {
-                                               $this->error .= lang('Configure <b>%s</b> in <b>%s</b>.', $class, "$basename.php") . "<br>";
+                                               $this->error .= lang('<a%s>Configure</a> %s in %s.', $help, "<b>$class</b>", "<b>$basename.php</b>") . "<br>";
                                        } else {
                                                $plugins[$class] = new $class;
                                        }
index 6ae4cc967b895aa14b9c496f05949f7eae8eb577..2b8d4c4d149979ccae80b955635b85f473ac99dc 100644 (file)
@@ -14,8 +14,8 @@ $translations = array(
        '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',
-       '<b>%s</b> must return an array.' => '<b>%s</b> musí vracet pole.',
-       'Configure <b>%s</b> in <b>%s</b>.' => 'Nakonfigurujte <b>%s</b> v <b>%s</b>.',
+       '%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>.',
index aeaa263d6b19cf3698988b1356523a4ac55011b0..cacdab3505211a47c0ff111cd6cf1b065b1b4dea 100644 (file)
@@ -14,8 +14,8 @@ $translations = array(
        'Logout successful.' => 'Wylogowano pomyślnie.',
        'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Dziękujemy za używanie Adminera, rozważ <a href="https://www.adminer.org/pl/donation/">dotację</a>.',
        'Loaded plugins' => 'Wczytane wtyczki',
-       '<b>%s</b> must return an array.' => '<b>%s</b> musi zwrócić tablicę.',
-       'Configure <b>%s</b> in <b>%s</b>.' => 'Skonfiguruj <b>%s</b> w <b>%s</b>.',
+       '%s must <a%s>return an array</a>.' => '%s musi <a%s>zwrócić tablicę</a>.',
+       '<a%s>Configure</a> %s in %s.' => '<a%s>Skonfiguruj</a> %s w %s.',
        'Invalid credentials.' => 'Nieprawidłowe dane logowania.',
        'There is a space in the input password which might be the cause.' => 'W haśle wejściowym znajduje się spacja, która może być przyczyną.',
        'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nie obsługuje dostępu do bazy danych bez hasła, <a href="https://www.adminer.org/pl/password/"%s>więcej informacji</a>.',
index d0a4b5b563a4ee28f8af3a2fc4e9e1091546a6ea..63c68ae2bd16ebe46d2e37753c02fefbb6df54c3 100644 (file)
@@ -14,8 +14,8 @@ $translations = array(
        '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',
-       '<b>%s</b> must return an array.' => '<b>%s</b> xx.',
-       'Configure <b>%s</b> in <b>%s</b>.' => 'Xx <b>%s</b> xx <b>%s</b>.',
+       '%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>.',