diff --git a/ext/tag_categories/theme.php b/ext/tag_categories/theme.php index 31af0a706..dc61b9e2c 100644 --- a/ext/tag_categories/theme.php +++ b/ext/tag_categories/theme.php @@ -103,6 +103,9 @@ public function show_tag_categories(Page $page, array $tc_dict): void '; // add html to stuffs + $page->set_title("Tag Categories"); + $page->set_heading("Tag Categories"); + $page->add_block(new NavBlock()); $page->add_block(new Block("Editing", $html, "main", 10)); } diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index bbeccfd2b..3080e3f25 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -52,27 +52,26 @@ public function onPageRequest(PageRequestEvent $event): void $tags_min = $config->get_int(TagListConfig::TAGS_MIN); // get the default. } - if($user->is_logged_in()) { - switch ($sub) { - default: - case 'map': - $this->theme->set_heading("Tag Map"); - $this->theme->set_tag_list($this->build_tag_map($starts_with, $tags_min)); - break; - case 'alphabetic': - $this->theme->set_heading("Alphabetic Tag List"); - $this->theme->set_tag_list($this->build_tag_alphabetic($starts_with, $tags_min)); - break; - case 'popularity': - $this->theme->set_heading("Tag List by Popularity"); - $this->theme->set_tag_list($this->build_tag_popularity($tags_min)); - break; - } - } else { - $errMessage = "You must be registered and logged in to use tags."; - $this->theme->display_error(401, "Unauthorized", $errMessage); + switch ($sub) { + case 'map': + $this->theme->set_heading("Tag Map"); + $this->theme->set_tag_list($this->build_tag_map($starts_with, $tags_min)); + $this->theme->display_page($page); + break; + case 'alphabetic': + $this->theme->set_heading("Alphabetic Tag List"); + $this->theme->set_tag_list($this->build_tag_alphabetic($starts_with, $tags_min)); + $this->theme->display_page($page); + break; + case 'popularity': + $this->theme->set_heading("Tag List by Popularity"); + $this->theme->set_tag_list($this->build_tag_popularity($tags_min)); + $this->theme->display_page($page); + break; + default: + // don't display anything + break; } - $this->theme->display_page($page); } elseif ($event->page_matches("tags")) { $page->set_mode(PageMode::REDIRECT); $page->set_redirect(make_link("tags/map")); diff --git a/ext/tag_list/test.php b/ext/tag_list/test.php index a345508da..b58979c4e 100644 --- a/ext/tag_list/test.php +++ b/ext/tag_list/test.php @@ -7,7 +7,7 @@ class TagListTest extends ShimmiePHPUnitTestCase { /** @var string[] */ - private array $pages = ["map", "alphabetic", "popularity", "categories"]; + private array $pages = ["map", "alphabetic", "popularity"]; public function testTagList(): void { @@ -20,9 +20,6 @@ public function testTagList(): void $this->get_page('tags/popularity'); $this->assert_title('Tag List'); - $this->get_page('tags/categories'); - $this->assert_title('Tag List'); - # FIXME: test that these show the right stuff }