From 18a5086a0cc181340f933c9ecf120d733f60ba9f Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 14 Dec 2024 22:04:37 +0000 Subject: [PATCH] [themes] remove redundant block headings --- core/page.php | 2 +- ext/blocks/theme.php | 2 +- ext/ext_manager/theme.php | 4 ++-- ext/ipban/test.php | 4 ++-- ext/ipban/theme.php | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/page.php b/core/page.php index 792188433..b1c5c29aa 100644 --- a/core/page.php +++ b/core/page.php @@ -246,7 +246,7 @@ public function add_block(Block $block): void * Find a block which contains the given text * (Useful for unit tests) */ - public function find_block(string $text): Block + public function find_block(?string $text): Block { foreach ($this->blocks as $block) { if ($block->header == $text) { diff --git a/ext/blocks/theme.php b/ext/blocks/theme.php index 4404703a6..f03b4d5bc 100644 --- a/ext/blocks/theme.php +++ b/ext/blocks/theme.php @@ -74,6 +74,6 @@ public function display_blocks(array $blocks): void $page->set_title("Blocks"); $page->add_block(new NavBlock()); - $page->add_block(new Block("Block Editor", $html)); + $page->add_block(new Block(null, $html)); } } diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php index 07e07682d..6a9c473fa 100644 --- a/ext/ext_manager/theme.php +++ b/ext/ext_manager/theme.php @@ -123,7 +123,7 @@ public function display_table(Page $page, array $extensions, bool $editable): vo $page->set_title("Extensions"); $page->add_block(new Block("Navigation", \MicroHTML\joinHTML(BR(), $cat_html), "left", 0)); - $page->add_block(new Block("Extension Manager", $form)); + $page->add_block(new Block(null, $form)); } public function display_doc(Page $page, ExtensionInfo $info): void @@ -154,6 +154,6 @@ public function display_doc(Page $page, ExtensionInfo $info): void $page->set_title("Documentation for {$info->name}"); $page->set_heading($info->name); $page->add_block(new NavBlock()); - $page->add_block(new Block("Documentation", $html)); + $page->add_block(new Block(null, $html)); } } diff --git a/ext/ipban/test.php b/ext/ipban/test.php index e503ffffd..00b96b01c 100644 --- a/ext/ipban/test.php +++ b/ext/ipban/test.php @@ -37,7 +37,7 @@ public function testIPBan(): void $page = $this->get_page('ip_ban/list'); $this->assertStringContainsString( "42.42.42.42", - (string)$page->find_block("Edit IP Bans")->body + (string)$page->find_block(null)->body ); // Delete ban @@ -48,7 +48,7 @@ public function testIPBan(): void $page = $this->get_page('ip_ban/list'); $this->assertStringNotContainsString( "42.42.42.42", - (string)$page->find_block("Edit IP Bans")->body + (string)$page->find_block(null)->body ); } diff --git a/ext/ipban/theme.php b/ext/ipban/theme.php index c5c4fa098..da943511f 100644 --- a/ext/ipban/theme.php +++ b/ext/ipban/theme.php @@ -15,13 +15,13 @@ public function display_bans(Page $page, HTMLElement $table, HTMLElement $pagina $html = " Show All Active / Show EVERYTHING - + $table - + $paginator "; $page->set_title("IP Bans"); $page->add_block(new NavBlock()); - $page->add_block(new Block("Edit IP Bans", rawHTML($html))); + $page->add_block(new Block(null, rawHTML($html))); } }