[BUGFIX] Adds current media file to TypoScript 23/45223/7
authorThomas Löffler <loeffler@spooner-web.de>
Sat, 12 Dec 2015 13:48:36 +0000 (14:48 +0100)
committerFrank Nägler <frank.naegler@typo3.org>
Fri, 18 Dec 2015 10:57:29 +0000 (11:57 +0100)
Media file properties can be used in TypoScript.

Change-Id: I48f64851ce03abe7898d184109b2342eeeb441fc
Resolves: #72186
Releases: master
Reviewed-on: https://review.typo3.org/45223
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/fluid_styled_content/Classes/ViewHelpers/Link/ClickEnlargeViewHelper.php

index b523477..1284210 100644 (file)
@@ -19,6 +19,7 @@ use TYPO3\CMS\Extbase\Service\TypoScriptService;
 use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
 use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+use TYPO3\CMS\Core\Resource\FileInterface;
 
 /**
  * A view helper for creating a link for an image popup.
@@ -74,6 +75,9 @@ class ClickEnlargeViewHelper extends AbstractViewHelper
     public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
     {
         $image = $arguments['image'];
+        if ($image instanceof FileInterface) {
+            self::getContentObjectRenderer()->setCurrentFile($image);
+        }
         $configuration = self::getTypoScriptService()->convertPlainArrayToTypoScriptArray($arguments['configuration']);
         $content = $renderChildrenClosure();
         $configuration['enable'] = true;