2015-12-27 15:10:01 +00:00
|
|
|
<?php
|
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
class CustomHomeTheme extends HomeTheme
|
|
|
|
{
|
|
|
|
public function display_page(Page $page, $sitename, $base_href, $theme_name, $body)
|
|
|
|
{
|
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();
|
|
|
|
$hh = $page->get_all_html_headers();
|
|
|
|
$page->set_data(
|
|
|
|
<<<EOD
|
2015-12-27 15:10:01 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>$sitename</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2016-01-06 22:21:55 +00:00
|
|
|
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
|
|
|
|
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
2016-01-07 12:13:50 +00:00
|
|
|
<link rel="stylesheet" href="{$base_href}/themes/{$theme_name}/material.min.css" rel="stylesheet">
|
2015-12-27 15:10:01 +00:00
|
|
|
$hh
|
2016-01-07 12:13:50 +00:00
|
|
|
<script type="text/javascript" src="{$base_href}/themes/{$theme_name}/material.min.js"></script>
|
2015-12-27 15:10:01 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
$body
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
EOD
|
2019-11-02 19:57:34 +00:00
|
|
|
);
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2015-12-27 15:10:01 +00:00
|
|
|
|
2019-05-28 16:59:38 +00:00
|
|
|
public function build_body(string $sitename, string $main_links, string $main_text, string $contact_link, $num_comma, string $counter_text)
|
|
|
|
{
|
|
|
|
$message_html = empty($main_text) ? "" : "<div class='space' id='message'>$main_text</div>";
|
|
|
|
$counter_html = empty($counter_text) ? "" : "<div class='mdl-typography--text-center' id='counter'>$counter_text</div>";
|
|
|
|
$contact_link = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a> -";
|
|
|
|
$main_links_html = empty($main_links) ? "" : preg_replace('data-clink-sel="" ', '', preg_replace('/shm-clink/', 'mdl-navigation__link', $main_links));
|
|
|
|
$search_html = "
|
2015-12-27 15:10:01 +00:00
|
|
|
<div class='mdl-grid'>
|
|
|
|
<div class='mdl-layout-spacer'></div>
|
|
|
|
<div class='mdl-cell mdl-cell--4-col'>
|
2015-12-28 02:01:12 +00:00
|
|
|
<form class='mdl-typography--text-center' action='".make_link("post/list")."' method='GET'>
|
|
|
|
<div class='mdl-textfield mdl-js-textfield'>
|
|
|
|
<input id='search' name='search' size='30' type='search' value='' class='autocomplete_tags mdl-textfield__input' autocomplete='off' />
|
|
|
|
<input type='hidden' name='q' value='/post/list'>
|
|
|
|
<label class='mdl-textfield__label' for='search'>Search</label>
|
|
|
|
</div>
|
|
|
|
</form>
|
2015-12-27 15:10:01 +00:00
|
|
|
</div>
|
|
|
|
<div class='mdl-layout-spacer'></div>
|
|
|
|
</div>
|
|
|
|
";
|
2019-05-28 16:59:38 +00:00
|
|
|
return "
|
2015-12-28 17:09:06 +00:00
|
|
|
<div class='mdl-layout mdl-js-layout mdl-layout--fixed-drawer vertical-center'>
|
2015-12-28 01:45:24 +00:00
|
|
|
<div class='mdl-layout__drawer'>
|
|
|
|
<span class='mdl-layout-title'>$sitename</span>
|
2015-12-28 17:42:55 +00:00
|
|
|
<nav class='mdl-navigation'>
|
2015-12-28 17:42:55 +00:00
|
|
|
$main_links_html
|
2015-12-28 17:42:55 +00:00
|
|
|
</nav>
|
2015-12-28 01:45:24 +00:00
|
|
|
</div>
|
2015-12-27 15:10:01 +00:00
|
|
|
<main class='mdl-layout__content'>
|
|
|
|
<div class='page-content'>
|
|
|
|
<h2 class='mdl-typography--text-center'><a style='text-decoration: none;' href='".make_link()."'><span>$sitename</span></a></h2>
|
|
|
|
$search_html
|
|
|
|
$message_html
|
|
|
|
$counter_html
|
|
|
|
<div class='mdl-typography--text-center' id='foot'>
|
2018-09-26 21:49:37 +00:00
|
|
|
<p>$contact_link Serving $num_comma posts - Running <a href='https://code.shishnet.org/shimmie2/'>Shimmie</a>
|
2015-12-27 15:10:01 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
</div>";
|
2019-05-28 16:59:38 +00:00
|
|
|
}
|
2015-12-27 15:10:01 +00:00
|
|
|
}
|