[TASK] Make ViewHelpers compilable in ext:beuser 37/39237/2
authorWouter Wolters <typo3@wouterwolters.nl>
Sun, 3 May 2015 12:27:40 +0000 (14:27 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 4 May 2015 11:53:46 +0000 (13:53 +0200)
Resolves: #66775
Releases: master
Change-Id: Icc97f6587097a0eab155edbd6eb12ef03f65d524
Reviewed-on: http://review.typo3.org/39237
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/beuser/Classes/ViewHelpers/Display/PagesViewHelper.php
typo3/sysext/beuser/Classes/ViewHelpers/Display/SysFileMountsViewHelper.php
typo3/sysext/beuser/Classes/ViewHelpers/Display/SysLanguageViewHelper.php

index e840662..5b1040e 100644 (file)
@@ -14,13 +14,17 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
+use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
+use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
+
 /**
  * Converts comma separated list of pages uids to html unordered list (<ul>) with speaking titles
  *
  * @author Felix Kopp <felix-source@phorax.com>
  * @internal
  */
-class PagesViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
+class PagesViewHelper extends AbstractViewHelper implements CompilableInterface {
 
        /**
         * Render unordered list for pages
@@ -29,6 +33,24 @@ class PagesViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelpe
         * @return string
         */
        public function render($uids = '') {
+               return self::renderStatic(
+                       array(
+                               'uids' => $uids,
+                       ),
+                       $this->buildRenderChildrenClosure(),
+                       $this->renderingContext
+               );
+       }
+
+       /**
+        * @param array $arguments
+        * @param callable $renderChildrenClosure
+        * @param RenderingContextInterface $renderingContext
+        *
+        * @return string
+        */
+       static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
+               $uids = $arguments['uids'];
                if (!$uids) {
                        return '';
                }
index d55686c..f655490 100644 (file)
@@ -14,13 +14,17 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
+use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
+use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
+
 /**
  * Converts comma separated list of sys_filemounts uids to html unordered list (<ul>) with speaking titles
  *
  * @author Felix Kopp <felix-source@phorax.com>
  * @internal
  */
-class SysFileMountsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
+class SysFileMountsViewHelper extends AbstractViewHelper implements CompilableInterface {
 
        /**
         * Render unordered list for sys_filemounts
@@ -29,6 +33,24 @@ class SysFileMountsViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractV
         * @return string
         */
        public function render($uids = '') {
+               return self::renderStatic(
+                       array(
+                               'uids' => $uids,
+                       ),
+                       $this->buildRenderChildrenClosure(),
+                       $this->renderingContext
+               );
+       }
+
+       /**
+        * @param array $arguments
+        * @param callable $renderChildrenClosure
+        * @param RenderingContextInterface $renderingContext
+        *
+        * @return string
+        */
+       static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
+               $uids = $arguments['uids'];
                if (!$uids) {
                        return '';
                }
index 7b0ea5b..b3fe6c2 100644 (file)
@@ -14,13 +14,17 @@ namespace TYPO3\CMS\Beuser\ViewHelpers\Display;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
+use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
+use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
+
 /**
  * Converts comma separated list of sys_language uids to html unordered list (<ul>) with speaking titles
  *
  * @author Felix Kopp <felix-source@phorax.com>
  * @internal
  */
-class SysLanguageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
+class SysLanguageViewHelper extends AbstractViewHelper implements CompilableInterface {
 
        /**
         * Render unordered list for sys_language
@@ -29,6 +33,24 @@ class SysLanguageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractVie
         * @return string
         */
        public function render($uids = '') {
+               return self::renderStatic(
+                       array(
+                               'uids' => $uids,
+                       ),
+                       $this->buildRenderChildrenClosure(),
+                       $this->renderingContext
+               );
+       }
+
+       /**
+        * @param array $arguments
+        * @param callable $renderChildrenClosure
+        * @param RenderingContextInterface $renderingContext
+        *
+        * @return string
+        */
+       static public function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
+               $uids = $arguments['uids'];
                if (!$uids) {
                        return '';
                }