diff --git a/Classes/Controller/FlipbookController.php b/Classes/Controller/FlipbookController.php index 7e17120..4381c5f 100755 --- a/Classes/Controller/FlipbookController.php +++ b/Classes/Controller/FlipbookController.php @@ -9,7 +9,6 @@ use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; -use TYPO3\CMS\Extbase\Domain\Model\Folder; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; @@ -99,10 +98,14 @@ public function showAction() : ResponseInterface $bigImageFolder = $this->settings['folder']; /** @var ResourceFactory $factory */ $factory = GeneralUtility::makeInstance(ResourceFactory::class); - /** @var Folder $folder */ $folder = $factory->getFolderObjectFromCombinedIdentifier($bigImageFolder); - $this->view->assign('files', $folder->getFiles()); + $files = $folder->getFiles(); + $imageFiles = array_filter($files, function ($file) { + return in_array($file->getExtension(),['jpg','jpeg','png','gif','webp']); + }); + + $this->view->assign('files', $imageFiles); } diff --git a/Classes/ViewHelpers/InlineJsViewHelper.php b/Classes/ViewHelpers/InlineJsViewHelper.php index 1490703..062cd68 100755 --- a/Classes/ViewHelpers/InlineJsViewHelper.php +++ b/Classes/ViewHelpers/InlineJsViewHelper.php @@ -14,10 +14,6 @@ /** - * - * - * @package products - * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later * */ class InlineJsViewHelper extends AbstractTagBasedViewHelper @@ -86,11 +82,11 @@ public function render() if (count($files) > 0) { /** @var File $file */ foreach ($files as $file) { - $content .= '{src:"' . $file->getPublicUrl() . '",'; + $content .= '{src:"' . $file->getPublicUrl() . '"'; if ($thumbfolder !== NULL) { - $content .= 'thumb:"' . $thumbfolder->getPublicUrl() . $file->getName() . '",'; + $content .= ',thumb:"' . $thumbfolder->getPublicUrl() . $file->getName() . '"'; if ($file->getProperty('title')) { - $content .= 'title: "' . $file->getProperty('title') . '"'; + $content .= ',title: "' . $file->getProperty('title') . '"'; } } else { $content .= ''; @@ -144,7 +140,7 @@ public function render() } /** - * @param integer|NULL $pageUid target PID + * @param int $pageUid target PID * @param array $additionalParams query parameters to be attached to the resulting URI * @param integer $pageType type of the target page. See typolink.parameter * @param boolean $noCache set this to disable caching for the target page. You should not need this. @@ -154,10 +150,10 @@ public function render() * @param boolean $absolute If set, the URI of the rendered link is absolute * @param boolean $addQueryString If set, the current query parameters will be kept in the URI * @param array $argumentsToBeExcludedFromQueryString arguments to be removed from the URI. Only active if $addQueryString = TRUE - * @param string $addQueryStringMethod Set which parameters will be kept. Only active if $addQueryString = TRUE + * @param string|null $addQueryStringMethod Set which parameters will be kept. Only active if $addQueryString = TRUE * @return string Rendered page URI */ - public function uriPage(int $pageUid, array $additionalParams = [], $pageType = 0, $noCache = FALSE, $noCacheHash = FALSE, $section = '', $linkAccessRestrictedPages = FALSE, $absolute = FALSE, $addQueryString = FALSE, array $argumentsToBeExcludedFromQueryString = array(), $addQueryStringMethod = NULL) + public function uriPage(int $pageUid, array $additionalParams = [], int $pageType = 0, bool $noCache = false, bool $noCacheHash = false, string $section = '', bool $linkAccessRestrictedPages = false, bool $absolute = false, bool $addQueryString = FALSE, array $argumentsToBeExcludedFromQueryString = [], string $addQueryStringMethod = NULL) { /** @var UriBuilder $uriBuilder */ diff --git a/Resources/Private/Templates/Flipbook/Show.html b/Resources/Private/Templates/Flipbook/Show.html index 8673759..740163c 100755 --- a/Resources/Private/Templates/Flipbook/Show.html +++ b/Resources/Private/Templates/Flipbook/Show.html @@ -25,12 +25,15 @@

{settings.header}

-
- - -
{files.0.description}
-
-
+ +
+ + +
{file.description}
+
+
+
+