<?php
namespace JetStudio;

require_once 'parts/init_libs.php';

use Jet\Http_Request;
use Jet\Locale;
use Jet\SysConf_URI;
use Jet\Tr;
use Jet\UI;
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>PHP Jet Studio</title>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<jet_layout_meta_tags/>
	<jet_layout_css/>
	<jet_layout_javascripts/>


</head>


<body>

<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
	
	<a href="<?=SysConf_URI::getBase()?>"><img src="https://php-jet.net/images/logo-st.svg" style="width: 140px;height: auto"></a>
	<a class="navbar-brand" href="<?=SysConf_URI::getBase()?>">Studio</a>

	<div class="collapse navbar-collapse" id="mainNavBar">
		<ul class="nav navbar-nav">
			<li class="nav-item">
				<a class="nav-link"  href="<?=Tr::_( 'https://www.php-jet.net/doc/' )?>" target="_blank">
					<?=UI::icon( 'book' )?>
					<?=Tr::_( 'PHP Jet Documentation' )?>
				</a>
			</li>
			
			<li class="nav-item">
				<a class="nav-link"  href="<?=Tr::_( 'https://questions.php-jet.net/' )?>" target="_blank">
					<?=UI::icon( 'comments' )?>
					<?=Tr::_( 'Ask a question' )?>
				</a>
			</li>
			
		</ul>

		<ul class="navbar-nav ml-auto">

			<li class="nav-item dropdown">
				<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					<span><?=UI::flag( Locale::getCurrentLocale() )?></span>
					<span class="caret"></span>
				</a>
				<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
					<?php foreach( JetStudio::getLocales() as $locale ): ?>
						<a class="dropdown-item" href="<?=Http_Request::currentURI(['std_locale' =>$locale->toString()])?>">
							<?=UI::flag( $locale )?>
							<?=$locale->getLanguageName( $locale )?>
						</a>
					<?php endforeach; ?>
				</div>
			</li>


		</ul>

	</div>
</nav>


<div style="justify-content: center;display: grid;grid-template-columns: 500px;grid-template-rows: calc(100vh - 180px);align-items: center">
	<jet_layout_main_position/>
</div>


</body>

</html>