This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/terms/theme.php

26 lines
628 B
PHP
Raw Normal View History

2024-06-03 14:08:51 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
use function MicroHTML\{emptyHTML, TITLE, META, rawHTML};
2024-06-03 14:08:51 +00:00
class TermsTheme extends Themelet
{
public function display_page(Page $page, string $sitename, string $path, string $body): void
{
$html =
"<div id='terms-modal-bg'>
<dialog id='terms-modal' class='setupblock' open>
<h1><span>$sitename</span></h1>
$body
<form action='/accept_terms/$path' method='POST'>
<button class='terms-modal-enter' autofocus>Enter</button>
</form>
</dialog>
</div>";
$page->add_block(new Block(null, $html, "main", 1));
2024-06-03 14:08:51 +00:00
}
}