forked from Public/pics
EditAlbum: reorder asset loading
This commit is contained in:
parent
c9da46b36f
commit
b48c8ea820
@ -6,6 +6,7 @@
|
|||||||
* Kabuki CMS (C) 2013-2017, Aaron van Geffen
|
* Kabuki CMS (C) 2013-2017, Aaron van Geffen
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
// TODO: extend EditTag?
|
||||||
class EditAlbum extends HTMLController
|
class EditAlbum extends HTMLController
|
||||||
{
|
{
|
||||||
private $form;
|
private $form;
|
||||||
@ -102,16 +103,6 @@ class EditAlbum extends HTMLController
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
// Fetch image assets for this album
|
|
||||||
if (!empty($id_tag))
|
|
||||||
{
|
|
||||||
list($assets, $num_assets) = AssetIterator::getByOptions([
|
|
||||||
'direction' => 'desc',
|
|
||||||
'limit' => 500,
|
|
||||||
'id_tag' => $id_tag,
|
|
||||||
], true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->form = new Form([
|
$this->form = new Form([
|
||||||
'request_url' => BASEURL . '/editalbum/?' . ($id_tag ? 'id=' . $id_tag : 'add'),
|
'request_url' => BASEURL . '/editalbum/?' . ($id_tag ? 'id=' . $id_tag : 'add'),
|
||||||
'buttons_extra' => $after_form,
|
'buttons_extra' => $after_form,
|
||||||
@ -150,9 +141,18 @@ class EditAlbum extends HTMLController
|
|||||||
$this->formview = new FormView($this->form, $form_title ?? '');
|
$this->formview = new FormView($this->form, $form_title ?? '');
|
||||||
$this->page->adopt($this->formview);
|
$this->page->adopt($this->formview);
|
||||||
|
|
||||||
// If we have asset images, show the thumbnail manager
|
if (!empty($id_tag))
|
||||||
if (!empty($id_tag) && $num_assets > 0)
|
{
|
||||||
$this->page->adopt(new FeaturedThumbnailManager($assets, $id_tag ? $album->id_asset_thumb : 0));
|
list($assets, $num_assets) = AssetIterator::getByOptions([
|
||||||
|
'direction' => 'desc',
|
||||||
|
'limit' => 500,
|
||||||
|
'id_tag' => $id_tag,
|
||||||
|
], true);
|
||||||
|
|
||||||
|
// If we have asset images, show the thumbnail manager
|
||||||
|
if ($num_assets > 0)
|
||||||
|
$this->page->adopt(new FeaturedThumbnailManager($assets, $id_tag ? $album->id_asset_thumb : 0));
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_POST['changeThumbnail']))
|
if (isset($_POST['changeThumbnail']))
|
||||||
$this->processThumbnail($album);
|
$this->processThumbnail($album);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user