<!DOCTYPE html>
<html>
<head>
	<title><?php echo $layout['title'] ?></title>
	<meta charset="<?php echo CHARSET ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="robots" content="noindex,nofollow">
	<meta name="generator" content="Koblog">

	<!-- Favicon -->
	<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🦎</text></svg>">

	<!-- CSS -->
	<?php
		echo Theme::cssBootstrap();
		echo Theme::cssFontAwesome();
		echo Theme::css(array(
			'koblog.css',
			'koblog.bootstrap.css'
		), DOMAIN_ADMIN_THEME_CSS);
		echo Theme::css(array(
			'jquery.datetimepicker.min.css',
			'select2.min.css',
			'select2-bootstrap4.min.css'
		), DOMAIN_CORE_CSS);
	?>

	<!-- Javascript -->
	<?php
		echo Theme::jquery();
		echo Theme::jsBootstrap();
		echo Theme::jsSortable();
		echo Theme::js(array(
			'jquery.datetimepicker.full.min.js',
			'select2.full.min.js',
			'functions.js'
		), DOMAIN_CORE_JS, null);
	?>

	<!-- Plugins -->
	<?php Theme::plugins('adminHead') ?>

</head>
<body>

<!-- Plugins -->
<?php Theme::plugins('adminBodyBegin') ?>

<!-- Javascript dynamic generated by PHP -->
<?php
	echo '<script charset="utf-8">'.PHP_EOL;
	include(PATH_CORE_JS.'variables.php');
	echo '</script>'.PHP_EOL;

	echo '<script charset="utf-8">'.PHP_EOL;
	include(PATH_CORE_JS.'koblog-ajax.php');
	echo '</script>'.PHP_EOL;
?>

<!-- Overlay background -->
<div id="jsshadow"></div>


<!-- LEFT SIDEBAR - Display only on large devices -->
<div class="bg-dark admin-sidebar text-white d-none d-lg-block">
	<?php include('html/sidebar.php'); ?>
</div>

<div class="h-100" id="main-area">
	<!-- 25%/75% split on large devices, small, medium devices hide -->
	<div class="h-100">

	<!-- Alert -->
	<?php include('html/alert.php'); ?>

	<!-- Navbar -->
	<?php include('html/navbar.php'); ?>

		<!-- RIGHT MAIN -->
		<div class="container h-100">
		<?php
			if (Sanitize::pathFile(PATH_ADMIN_VIEWS, $layout['view'].'.php')) {
				include(PATH_ADMIN_VIEWS.$layout['view'].'.php');
			} elseif ($layout['plugin'] && method_exists($layout['plugin'], 'adminView')) {
				echo $layout['plugin']->adminView();
			} else {
				echo '<h1 class="text-center">'.$L->g('Page not found').'</h1>';
				echo '<h2 class="text-center">'.$L->g('Choose a page from the sidebar.').'</h2>';
			}
		?>
		</div>
	</div>
</div>

<!-- Plugins -->
<?php Theme::plugins('adminBodyEnd') ?>

</body>
</html>
