forked from Public/pics
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
|
<?php
|
||
|
/*****************************************************************************
|
||
|
* FeaturedThumbnailManager.php
|
||
|
* Contains the featured thumbnail manager template.
|
||
|
*
|
||
|
* Kabuki CMS (C) 2013-2021, Aaron van Geffen
|
||
|
*****************************************************************************/
|
||
|
|
||
|
class FeaturedThumbnailManager extends SubTemplate
|
||
|
{
|
||
|
private $assets;
|
||
|
private $currentThumbnailId;
|
||
|
|
||
|
public function __construct(AssetIterator $assets, $currentThumbnailId)
|
||
|
{
|
||
|
$this->assets = $assets;
|
||
|
$this->currentThumbnailId = $currentThumbnailId;
|
||
|
}
|
||
|
|
||
|
protected function html_content()
|
||
|
{
|
||
|
echo '
|
||
|
<h2>Select thumbnail</h2>
|
||
|
<ul id="featuredThumbnail">';
|
||
|
|
||
|
while ($asset = $this->assets->next())
|
||
|
{
|
||
|
$image = $asset->getImage();
|
||
|
echo '
|
||
|
<li>
|
||
|
<input class="form-check-input" type="radio" name="featuredThumbnail" value="', $image->getId(), '"',
|
||
|
$this->currentThumbnailId == $image->getId() ? ' checked' : '', '>
|
||
|
<img src="', $image->getThumbnailUrl(150, 100, 'top'), '" alt="" title="', $image->getTitle(), '" onclick="this.parentNode.children[0].checked = true">
|
||
|
</li>';
|
||
|
}
|
||
|
|
||
|
$this->assets->clean();
|
||
|
|
||
|
echo '
|
||
|
</ul>';
|
||
|
}
|
||
|
}
|