diff --git a/protected/humhub/modules/ui/assets/UiImageSetAsset.php b/protected/humhub/modules/ui/content/assets/UiImageSetAsset.php similarity index 68% rename from protected/humhub/modules/ui/assets/UiImageSetAsset.php rename to protected/humhub/modules/ui/content/assets/UiImageSetAsset.php index aa012dc018..168d04f249 100644 --- a/protected/humhub/modules/ui/assets/UiImageSetAsset.php +++ b/protected/humhub/modules/ui/content/assets/UiImageSetAsset.php @@ -1,12 +1,12 @@ hiddenImageWidth === null) { $this->hiddenImageHeight = $this->hiddenImageWidth; } + + if($this->items && !is_array($this->items)) { + $this->items = [$this->items]; + } } public function run() { $visibleItems = array_slice($this->items, 0, $this->max); $hiddenItems = array_slice($this->items, $this->max); - return $this->render('@ui/widgets/views/containerImageSet', [ + return $this->render('@ui/content/widgets/views/containerImageSet', [ 'visibleItems' => $visibleItems, 'hiddenItems' => $hiddenItems, 'max' => $this->max, @@ -64,4 +70,4 @@ class ContainerImageSet extends BaseImage 'height' => $this->hiddenImageHeight ]; } -} \ No newline at end of file +} diff --git a/protected/humhub/modules/ui/widgets/views/containerImageSet.php b/protected/humhub/modules/ui/content/widgets/views/containerImageSet.php similarity index 94% rename from protected/humhub/modules/ui/widgets/views/containerImageSet.php rename to protected/humhub/modules/ui/content/widgets/views/containerImageSet.php index f5b638a229..ffb5d5743f 100644 --- a/protected/humhub/modules/ui/widgets/views/containerImageSet.php +++ b/protected/humhub/modules/ui/content/widgets/views/containerImageSet.php @@ -5,8 +5,9 @@ use humhub\modules\user\models\User; use humhub\modules\space\widgets\Image as SpaceImage; use humhub\modules\user\widgets\Image as UserImage; use yii\helpers\Html; +use humhub\modules\ui\content\assets\UiImageSetAsset; -humhub\modules\ui\assets\UiImageSetAsset::register($this); +UiImageSetAsset::register($this); ?>