1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 23:27:17 +02:00

Plugins autoloading: Link help

This commit is contained in:
Jakub Vrana
2025-03-21 08:18:40 +01:00
parent 83a8b18c85
commit 719c1e7067
4 changed files with 11 additions and 10 deletions

View 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;
}

View 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>.',

View 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>.',

View 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>.',