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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user