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/themes/futaba/layout.class.php

95 lines
2.7 KiB
PHP
Raw Normal View History

<?php
class Layout
{
public function display_page(Page $page)
{
global $config;
2009-01-20 11:17:49 +00:00
2019-08-02 19:40:03 +00:00
$theme_name = $config->get_string(SetupConfig::THEME, 'default');
$data_href = get_base_href();
$contact_link = contact_link();
$header_html = $page->get_all_html_headers();
$left_block_html = "";
$main_block_html = "";
$sub_block_html = "";
foreach ($page->blocks as $block) {
switch ($block->section) {
case "left":
$left_block_html .= $block->get_html(true);
break;
case "main":
$main_block_html .= $block->get_html(false);
break;
case "subheading":
$sub_block_html .= $block->body; // $this->block_to_html($block, true);
break;
default:
print "<p>error: {$block->header} using an unknown section ({$block->section})";
break;
}
}
$debug = get_debug_info();
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
if (empty($page->subheading)) {
$subheading = "";
} else {
$subheading = "<div id='subtitle'>{$page->subheading}</div>";
}
if ($page->left_enabled) {
$left = "<nav>$left_block_html</nav>";
$withleft = "withleft";
} else {
$left = "";
$withleft = "";
}
2019-12-16 00:02:34 +00:00
$flash_html = $page->flash ? "<b id='flash'>".nl2br(html_escape(implode("\n", $page->flash)))."</b>" : "";
print <<<EOD
2012-03-05 10:14:58 +00:00
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<title>{$page->title}</title>
$header_html
<script src='$data_href/themes/$theme_name/script.js' type='text/javascript'></script>
</head>
<body>
2012-03-11 16:18:37 +00:00
<header>
<h1>{$page->heading}</h1>
$subheading
$sub_block_html
</header>
$left
2012-03-11 16:18:37 +00:00
<article class="$withleft">
$flash_html
2012-03-11 16:18:37 +00:00
$main_block_html
</article>
<footer>
<hr>
Images &copy; their respective owners,
2018-09-26 21:49:37 +00:00
<a href="https://code.shishnet.org/shimmie2/">Shimmie</a> &copy;
<a href="https://www.shishnet.org/">Shish</a> &amp;
2014-02-25 17:40:07 +00:00
<a href="https://github.com/shish/shimmie2/graphs/contributors">The Team</a>
2019-06-12 22:36:36 +00:00
2007-2019,
2009-06-05 16:55:58 +00:00
based on the Danbooru concept.
<br>Futaba theme based on 4chan's layout and CSS :3
$debug
$contact
2012-03-11 16:18:37 +00:00
</footer>
</body>
</html>
EOD;
}
}