2013-10-05 12:55:03 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2013-10-07 00:44:17 +02:00
|
|
|
<meta charset="utf-8"/>
|
2013-10-05 21:22:28 +02:00
|
|
|
<?php if (isset($this->context->subTitle)): ?>
|
|
|
|
<title><?php printf('%s – %s', $this->context->title, $this->context->subTitle) ?></title>
|
|
|
|
<?php else: ?>
|
|
|
|
<title><?php echo $this->context->title ?></title>
|
|
|
|
<?php endif ?>
|
2013-10-05 22:52:55 +02:00
|
|
|
<?php foreach ($this->context->stylesheets as $name): ?>
|
2013-10-07 00:44:17 +02:00
|
|
|
<link rel="stylesheet" type="text/css" href="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/css/' . $name) ?>"/>
|
|
|
|
<?php endforeach ?>
|
|
|
|
<?php foreach ($this->context->scripts as $name): ?>
|
|
|
|
<script type="text/javascript" src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/js/' . $name) ?>"></script>
|
2013-10-05 22:52:55 +02:00
|
|
|
<?php endforeach ?>
|
2013-10-05 12:55:03 +02:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2013-10-09 11:45:18 +02:00
|
|
|
<nav id="top-nav">
|
2013-10-05 22:52:55 +02:00
|
|
|
<div class="main-wrapper">
|
|
|
|
<ul>
|
|
|
|
<?php
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav = [];
|
|
|
|
|
|
|
|
$nav []= ['Home', \Chibi\UrlHelper::route('index', 'index')];
|
|
|
|
if (PrivilegesHelper::confirm($this->context->user, Privilege::ListPosts))
|
2013-10-07 23:17:33 +02:00
|
|
|
$nav []= ['Browse', \Chibi\UrlHelper::route('post', 'list')];
|
|
|
|
|
|
|
|
if (PrivilegesHelper::confirm($this->context->user, Privilege::ListComments))
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Comments', \Chibi\UrlHelper::route('comment', 'list')];
|
2013-10-07 23:17:33 +02:00
|
|
|
|
|
|
|
if (PrivilegesHelper::confirm($this->context->user, Privilege::ListPosts))
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Favorites', \Chibi\UrlHelper::route('post', 'favorites')];
|
2013-10-05 22:52:55 +02:00
|
|
|
|
2013-10-09 17:49:29 +02:00
|
|
|
if (PrivilegesHelper::confirm($this->context->user, Privilege::ListTags))
|
|
|
|
$nav []= ['Tags', \Chibi\UrlHelper::route('tag', 'list')];
|
|
|
|
|
2013-10-06 13:21:16 +02:00
|
|
|
if (PrivilegesHelper::confirm($this->context->user, Privilege::UploadPost))
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Upload', \Chibi\UrlHelper::route('post', 'upload')];
|
|
|
|
|
|
|
|
if (PrivilegesHelper::confirm($this->context->user, Privilege::ListUsers))
|
|
|
|
$nav []= ['Users', \Chibi\UrlHelper::route('user', 'list')];
|
2013-10-06 13:21:16 +02:00
|
|
|
|
2013-10-05 22:52:55 +02:00
|
|
|
if (!$this->context->loggedIn)
|
|
|
|
{
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Log in', \Chibi\UrlHelper::route('auth', 'login')];
|
|
|
|
$nav []= ['Register', \Chibi\UrlHelper::route('auth', 'register')];
|
2013-10-05 22:52:55 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['My account', \Chibi\UrlHelper::route('user', 'show', ['name' => $this->context->user->name])];
|
|
|
|
$nav []= ['Log out', \Chibi\UrlHelper::route('auth', 'logout')];
|
2013-10-05 22:52:55 +02:00
|
|
|
}
|
|
|
|
|
2013-10-07 20:44:14 +02:00
|
|
|
$nav []= ['Help', \Chibi\UrlHelper::route('index', 'help')];
|
|
|
|
|
|
|
|
foreach ($nav as $navItem)
|
2013-10-05 22:52:55 +02:00
|
|
|
{
|
2013-10-07 20:44:14 +02:00
|
|
|
list ($text, $link) = $navItem;
|
|
|
|
echo '<li>';
|
|
|
|
echo '<a href="' . $link . '">' . $text . '</a>';
|
|
|
|
echo '</li>';
|
2013-10-05 22:52:55 +02:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
2013-10-05 19:24:08 +02:00
|
|
|
</nav>
|
2013-10-05 12:55:03 +02:00
|
|
|
|
2013-10-05 22:52:55 +02:00
|
|
|
<section id="content">
|
|
|
|
<div class="main-wrapper">
|
|
|
|
<?php echo $this->renderView() ?>
|
|
|
|
</div>
|
2013-10-05 19:24:08 +02:00
|
|
|
</section>
|
2013-10-05 12:55:03 +02:00
|
|
|
</body>
|
|
|
|
</html>
|