<?php
namespace JetApplicationModule\Admin\Content\Images;

use Jet\MVC_View;
use JetApplication\Content_Gallery;

/**
 * @var MVC_View $this
 * @var Content_Gallery[] $galleries
 * @var Content_Gallery $gallery
 */
$galleries = $this->getRaw( 'galleries' );
$current_gallery = $this->getRaw( 'gallery' );
$router = $this->getController()->getControllerRouter();

?>

<table class="table table-striped">
	<?php foreach( $galleries as $gallery ): ?>
		<tr>
			<td>
				<?php if( $current_gallery && $current_gallery->getId() == $gallery->getId() ): ?>
					<strong><?= $gallery->getTitle() ?></strong>
				<?php else: ?>
					<a href="<?= $router->action( 'edit' )->URI( $gallery->getId() ); ?>"><?= $gallery->getTitle() ?></a>
				<?php endif; ?>
			</td>
		</tr>
	<?php endforeach; ?>
</table>
