Skip to content

Commit

Permalink
Merge pull request #16 from pdir/1.3.1
Browse files Browse the repository at this point in the history
1.3.1
  • Loading branch information
seibtph authored Nov 5, 2024
2 parents 20d13df + 665d899 commit 78c2af8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Types of changes
Security in case of vulnerabilities.
)

## [1.3.1](https://github.com/contao-themes-net/animated-timeline-bundle/tree/1.3.1) – 2024-11-05

- [Fixed] Add TimelineElementListeners for multiSRC field handling [[#15](https://github.com/pdir/animated-timeline-bundle/pull/15) Thanks to [cgoIT](https://github.com/cgoIT)]
- [Fixed] Check if image slider is not null

## [1.3.0](https://github.com/contao-themes-net/animated-timeline-bundle/tree/1.3.0) – 2024-02-29

- [Added] Add Contao 5.3 support
Expand Down
22 changes: 12 additions & 10 deletions src/Element/TimelineSliderElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,18 @@ protected function compile(): void
$size = StringUtil::deserialize($this->contentSliderSize);
$sliderImages = [];

while ($objFiles->next()) {
$figure = System::getContainer()
->get('contao.image.studio')
->createFigureBuilder()
->from($objFiles->path)
->setSize($size)
->enableLightbox('1' === $this->contentSliderFullsize || true === $this->contentSliderFullsize ? true : false)
->buildIfResourceExists()
;
$sliderImages[] = $figure->getLegacyTemplateData();
if (null !== $objFiles) {
while ($objFiles->next()) {
$figure = System::getContainer()
->get('contao.image.studio')
->createFigureBuilder()
->from($objFiles->path)
->setSize($size)
->enableLightbox('1' === $this->contentSliderFullsize || true === $this->contentSliderFullsize ? true : false)
->buildIfResourceExists()
;
$sliderImages[] = $figure->getLegacyTemplateData();
}
}

$this->Template->sliderImages = $sliderImages;
Expand Down
19 changes: 18 additions & 1 deletion src/EventListener/DataContainer/TimelineElementListeners.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
<?php

declare(strict_types=1);

/*
* Animated timeline bundle for Contao Open Source CMS
*
* Copyright (c) 2024 pdir / digital agentur // pdir GmbH
*
* @package animated-timeline-bundle
* @link https://pdir.de
* @license LGPL-3.0+
* @author Philipp Seibt <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Pdir\AnimatedTimelineBundle\EventListener\DataContainer;

use Contao\CoreBundle\DependencyInjection\Attribute\AsCallback;
Expand All @@ -10,9 +26,10 @@ class TimelineElementListeners
#[AsCallback('tl_content', 'fields.multiSRC.load')]
public function setMultiSRCFlags(mixed $varValue, DataContainer $dc): mixed
{
if ($dc->activeRecord && $dc->activeRecord->type === 'timelineSliderElement') {
if ($dc->activeRecord && 'timelineSliderElement' === $dc->activeRecord->type) {
$GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['isGallery'] = true;
}

return $varValue;
}
}

0 comments on commit 78c2af8

Please sign in to comment.