2021-12-14 18:32:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2007-07-28 20:47:54 +00:00
|
|
|
|
2023-01-10 22:44:09 +00:00
|
|
|
namespace Shimmie2;
|
|
|
|
|
2024-06-21 17:29:26 +00:00
|
|
|
use function MicroHTML\{emptyHTML, TITLE, META, rawHTML};
|
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
class HomeTheme extends Themelet
|
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public function display_page(Page $page, string $sitename, string $base_href, string $theme_name, string $body): void
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
2019-06-19 01:58:28 +00:00
|
|
|
$page->set_mode(PageMode::DATA);
|
2019-05-28 16:59:38 +00:00
|
|
|
$page->add_auto_html_headers();
|
2024-06-21 17:29:26 +00:00
|
|
|
|
|
|
|
$page->set_data((string)$page->html_html(
|
|
|
|
emptyHTML(
|
|
|
|
TITLE($sitename),
|
|
|
|
META(["http-equiv" => "Content-Type", "content" => "text/html;charset=utf-8"]),
|
|
|
|
META(["name" => "viewport", "content" => "width=device-width, initial-scale=1"]),
|
|
|
|
$page->get_all_html_headers(),
|
|
|
|
),
|
|
|
|
$body
|
|
|
|
));
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2007-07-28 20:47:54 +00:00
|
|
|
|
2024-01-20 14:10:59 +00:00
|
|
|
public function build_body(string $sitename, string $main_links, string $main_text, string $contact_link, string $num_comma, string $counter_text): string
|
2019-05-28 16:59:38 +00:00
|
|
|
{
|
|
|
|
$main_links_html = empty($main_links) ? "" : "<div class='space' id='links'>$main_links</div>";
|
2021-12-14 18:32:47 +00:00
|
|
|
$message_html = empty($main_text) ? "" : "<div class='space' id='message'>$main_text</div>";
|
|
|
|
$counter_html = empty($counter_text) ? "" : "<div class='space' id='counter'>$counter_text</div>";
|
2019-05-28 16:59:38 +00:00
|
|
|
$contact_link = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a> –";
|
|
|
|
$search_html = "
|
2009-08-24 01:15:08 +00:00
|
|
|
<div class='space' id='search'>
|
2024-02-10 16:45:41 +00:00
|
|
|
<form action='".search_link()."' method='GET'>
|
2023-12-26 12:53:46 +00:00
|
|
|
<input name='search' size='30' type='search' value='' class='autocomplete_tags' autofocus='autofocus' />
|
2024-02-12 11:11:14 +00:00
|
|
|
<input type='hidden' name='q' value='post/list'>
|
2007-07-28 20:47:54 +00:00
|
|
|
<input type='submit' value='Search'/>
|
|
|
|
</form>
|
|
|
|
</div>
|
2009-08-24 01:15:08 +00:00
|
|
|
";
|
2019-05-28 16:59:38 +00:00
|
|
|
return "
|
2009-08-24 01:15:08 +00:00
|
|
|
<div id='front-page'>
|
|
|
|
<h1><a style='text-decoration: none;' href='".make_link()."'><span>$sitename</span></a></h1>
|
|
|
|
$main_links_html
|
|
|
|
$search_html
|
|
|
|
$message_html
|
|
|
|
$counter_html
|
|
|
|
<div class='space' id='foot'>
|
|
|
|
<small><small>
|
2023-06-26 03:36:30 +00:00
|
|
|
$contact_link" . (empty($num_comma) ? "" : " Serving $num_comma posts –") . "
|
2020-03-25 11:47:00 +00:00
|
|
|
Running <a href='https://code.shishnet.org/shimmie2/'>Shimmie2</a>
|
2009-08-24 01:15:08 +00:00
|
|
|
</small></small>
|
2007-07-28 20:47:54 +00:00
|
|
|
</div>
|
|
|
|
</div>";
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2007-07-28 20:47:54 +00:00
|
|
|
}
|