f84bcaec01
I wanted to ensure that all pages (even the downtime page, terms page, home page, etc) had the appropriate `data-` attributes on `<body>` (because those are required for certain javascript, eg autocomplete, to work). One thing led to another and now everything in `head` is microhtml'ed
29 lines
977 B
PHP
29 lines
977 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shimmie2;
|
|
|
|
use function MicroHTML\{META};
|
|
|
|
class FilterTheme extends Themelet
|
|
{
|
|
public function addFilterBox(): void
|
|
{
|
|
global $config, $page, $user, $user_config;
|
|
|
|
// If user is not able to set their own filters, use the default filters.
|
|
if ($user->can(Permissions::CHANGE_USER_SETTING)) {
|
|
$tags = $user_config->get_string("filter_tags");
|
|
} else {
|
|
$tags = $config->get_string("filter_tags");
|
|
}
|
|
$html = "<noscript>Post filtering requires JavaScript</noscript>
|
|
<ul id='filter-list' class='list-bulleted'></ul>
|
|
<a id='disable-all-filters' style='display: none;' href='#'>Disable all</a>
|
|
<a id='re-enable-all-filters' style='display: none;' href='#'>Re-enable all</a>
|
|
";
|
|
$page->add_html_header(META(['id' => 'filter-tags', 'tags' => $tags]));
|
|
$page->add_block(new Block("Filters", $html, "left", 10));
|
|
}
|
|
}
|