1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 19:44:00 +02:00

Plugins: Link screenshot

This commit is contained in:
Jakub Vrana
2025-04-07 19:09:53 +02:00
parent e33ead15e5
commit bf24198e68
12 changed files with 55 additions and 9 deletions

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

View 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