szurubooru/src/Views/layout-normal.phtml
Marcin Kurczewski 35cdc0cf3a Refactored scripts and stylesheets
Styles, scripts and page titles are no longer set from controllers level.
Changed because it was breaking MVC pattern and led to spaghetti code.

Also, optimized JS/CSS inclusions a bit.
2014-02-01 11:24:03 +01:00

63 lines
1.9 KiB
PHTML

<?php
LayoutHelper::addStylesheet('../lib/jquery-ui/jquery-ui.css');
LayoutHelper::addStylesheet('core.css');
LayoutHelper::addScript('../lib/jquery/jquery.min.js');
LayoutHelper::addScript('../lib/jquery-ui/jquery-ui.min.js');
LayoutHelper::addScript('../lib/mousetrap/mousetrap.min.js');
LayoutHelper::addScript('core.js');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
</head>
<body>
<script type="text/javascript">
var lastSearchQuery = <?php echo json_encode(isset($this->context->transport->lastSearchQuery) ? $this->context->transport->lastSearchQuery : '') ?>;
</script>
<nav id="top-nav">
<div class="main-wrapper">
<?php $this->renderFile('top-navigation') ?>
</div>
<div class="clear"></div>
</nav>
<section id="content">
<div class="main-wrapper">
<?php echo $this->renderView() ?>
</div>
<div class="clear"></div>
</section>
<footer>
<div class="main-wrapper">
<span>Load: <?php echo sprintf('%.05f', microtime(true) - $this->context->startTime) ?>s</span>
<span>Queries: <?php echo count(Database::getLogs()) ?></span>
<span><a href="<?php echo SZURU_LINK ?>">szurubooru v<?php echo SZURU_VERSION ?></a></span>
<?php if (PrivilegesHelper::confirm(Privilege::ListLogs)): ?>
<span><a href="<?php echo \Chibi\UrlHelper::route('log', 'list') ?>">Logs</a></span>
<?php endif ?>
</div>
<?php if ($this->config->misc->debugQueries): ?>
<hr>
<div class="main-wrapper">
<pre class="debug">
<?php foreach (Database::getLogs() as $query)
{
$bindings = [];
foreach ($query->getBindings() as $k => $v)
$bindings []= $k . '=' . $v;
printf('<p>%s [%s]</p>', htmlspecialchars($query->getSql()), join(', ', $bindings));
} ?>
</pre>
</div>
<?php endif ?>
</footer>
<div id="small-screen"></div>
</body>
</html>