From deac369d26a8d806ca94ddeb2d289a3205e546d5 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Mon, 23 Mar 2020 22:45:31 +1000 Subject: [PATCH] Colour wiki titles using tag categories --- ext/wiki/theme.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/wiki/theme.php b/ext/wiki/theme.php index 4167951c..7bf334b8 100644 --- a/ext/wiki/theme.php +++ b/ext/wiki/theme.php @@ -25,11 +25,19 @@ class WikiTheme extends Themelet $tfe->formatted .= "

(Edit)"; } + // see if title is a category'd tag + $title_html = html_escape($wiki_page->title); + if (class_exists('TagCategories')) { + $this->tagcategories = new TagCategories; + $tag_category_dict = $this->tagcategories->getKeyedDict(); + $title_html = $this->tagcategories->getTagHtml($title_html, $tag_category_dict); + } + $page->set_title(html_escape($wiki_page->title)); $page->set_heading(html_escape($wiki_page->title)); $page->add_block(new NavBlock()); $page->add_block(new Block("Wiki Index", $tfe->formatted, "left", 20)); - $page->add_block(new Block(html_escape($wiki_page->title), $this->create_display_html($wiki_page))); + $page->add_block(new Block($title_html, $this->create_display_html($wiki_page))); } public function display_page_editor(Page $page, WikiPage $wiki_page)