AssetIterator: rewrite to standard Iterator interface
This commit is contained in:
@@ -8,12 +8,12 @@
|
||||
|
||||
class FeaturedThumbnailManager extends SubTemplate
|
||||
{
|
||||
private $assets;
|
||||
private $iterator;
|
||||
private $currentThumbnailId;
|
||||
|
||||
public function __construct(AssetIterator $assets, $currentThumbnailId)
|
||||
public function __construct(AssetIterator $iterator, $currentThumbnailId)
|
||||
{
|
||||
$this->assets = $assets;
|
||||
$this->iterator = $iterator;
|
||||
$this->currentThumbnailId = $currentThumbnailId;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class FeaturedThumbnailManager extends SubTemplate
|
||||
<h2>Select thumbnail</h2>
|
||||
<ul id="featuredThumbnail">';
|
||||
|
||||
while ($asset = $this->assets->next())
|
||||
foreach ($this->iterator as $asset)
|
||||
{
|
||||
$image = $asset->getImage();
|
||||
echo '
|
||||
@@ -36,8 +36,6 @@ class FeaturedThumbnailManager extends SubTemplate
|
||||
</li>';
|
||||
}
|
||||
|
||||
$this->assets->clean();
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
<input type="hidden" name="', Session::getSessionTokenKey(), '" value="', Session::getSessionToken(), '">
|
||||
|
||||
Reference in New Issue
Block a user