<?php
namespace JetStudioModule\Pages;

use Jet\UI;
use Jet\MVC;

if( Main::getCurrentPage() ) {
	return;
}

$bases = MVC::getBases();
?>


<div style="padding-top: 10px;">
	<?php foreach( $bases as $base ): ?>
		<h5><?= $base->getName() ?></h5>
		<table class="table table-striped">
			<?php foreach( $base->getLocales() as $locale ):
				$link = Main::getActionUrl( '', [], MVC::HOMEPAGE_ID, $locale, $base->getId() );
				?>
				<tr>
					<td style="width: 30px"><a href="<?= $link ?>"><?= UI::flag( $locale ) ?></a></td>
					<td style="width: 250px;"><a href="<?= $link ?>"><?= $locale->getName() ?></a></td>
					<td><a href="<?= $link ?>"><?= $locale->getName( $locale ) ?></a></td>
					<td></td>
				</tr>
			<?php endforeach; ?>
		</table>
	<?php endforeach; ?>
</div>