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
35 lines
808 B
PHP
35 lines
808 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shimmie2;
|
|
|
|
use function MicroHTML\TITLE;
|
|
|
|
class EmoticonListTheme extends Themelet
|
|
{
|
|
/**
|
|
* @param string[] $list
|
|
*/
|
|
public function display_emotes(array $list): void
|
|
{
|
|
global $page;
|
|
$data_href = get_base_href();
|
|
$body = "<table><tr>";
|
|
$n = 1;
|
|
foreach ($list as $item) {
|
|
$name = pathinfo($item, PATHINFO_FILENAME);
|
|
$body .= "<td><img alt='$name' src='$data_href/$item'> :$name:</td>";
|
|
if ($n++ % 3 == 0) {
|
|
$body .= "</tr><tr>";
|
|
}
|
|
}
|
|
$body .= "</tr></table>";
|
|
|
|
$page->set_mode(PageMode::DATA);
|
|
$page->set_data((string)$page->html_html(
|
|
TITLE("Emoticon list"),
|
|
$body
|
|
));
|
|
}
|
|
}
|