feat: Loosen-IT logo top right on the settings page

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-26 15:26:44 +02:00
co-authored by Claude Opus 5.5
parent 909ac82594
commit 68ca4f45ec
4 changed files with 42 additions and 4 deletions
+23 -3
View File
@@ -14,8 +14,11 @@ final class SettingsPage
/** @var array<string, AdminTab> */
private array $tabs = [];
/** @param list<AdminTab> $tabs The first tab is the default. */
public function __construct(array $tabs)
/**
* @param list<AdminTab> $tabs The first tab is the default.
* @param string $logoUrl Loosen-IT logo shown top right of the page ('' = none).
*/
public function __construct(array $tabs, private string $logoUrl = '')
{
foreach ($tabs as $tab) {
$this->tabs[$tab->slug()] = $tab;
@@ -78,7 +81,9 @@ final class SettingsPage
}
$current = $this->currentTab();
echo '<div class="wrap"><h1>' . esc_html__('LIT MCP', 'wp-lit-mcp') . '</h1>';
echo '<div class="wrap">';
$this->renderLogo();
echo '<h1>' . esc_html__('LIT MCP', 'wp-lit-mcp') . '</h1>';
$this->renderNotice();
echo '<nav class="nav-tab-wrapper">';
foreach ($this->tabs as $slug => $tab) {
@@ -94,6 +99,21 @@ final class SettingsPage
echo '</div>';
}
private function renderLogo(): void
{
if ($this->logoUrl === '') {
return;
}
printf(
'<div class="lit-mcp-header"><a href="https://loosen-it.de" target="_blank" rel="noopener">'
. '<img src="%s" alt="Loosen-IT Logo" class="lit-mcp-logo"></a></div>'
. '<style>.lit-mcp-header{position:relative}.lit-mcp-logo{position:absolute;padding:10px;right:0;'
. 'top:0;height:30px;width:auto}@media (max-width:782px){.lit-mcp-logo{height:24px}}</style>',
esc_url($this->logoUrl)
);
}
private function renderNotice(): void
{
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- display only.
+1 -1
View File
@@ -90,7 +90,7 @@ final class Plugin
new ToolsTab($registry, $policy),
new LogTab($changeLog, $limits),
new LimitsTab(),
]);
], plugins_url('assets/img/loosen-it-logo.svg', self::$pluginFile));
if (is_admin()) {
self::$settingsPage->register();
(new AdminNotices($status))->register();