[FEATURE] Add useCacheHash to typolink viewhelpers 24/51324/2
authorPhilipp Kitzberger <philipp@cron-it.de>
Mon, 16 Jan 2017 12:37:10 +0000 (12:37 +0000)
committerFrans Saris <franssaris@gmail.com>
Tue, 7 Feb 2017 18:52:43 +0000 (19:52 +0100)
Resolves: #79337
Releases: master
Change-Id: Ib93ac38f944d6ca74f6162e705f6bfa4fa3214a9
Reviewed-on: https://review.typo3.org/51324
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/core/Documentation/Changelog/master/Feature-79337-AddUseCacheHashParameterToFlinktypolinkAndFuritypolink.rst [new file with mode: 0644]
typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Uri/TypolinkViewHelper.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-79337-AddUseCacheHashParameterToFlinktypolinkAndFuritypolink.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-79337-AddUseCacheHashParameterToFlinktypolinkAndFuritypolink.rst
new file mode 100644 (file)
index 0000000..02ee591
--- /dev/null
@@ -0,0 +1,14 @@
+.. include:: ../../Includes.txt
+
+==================================================================================
+Feature: #79337 - Add useCacheHash parameter to f:link.typolink and f:uri.typolink
+==================================================================================
+
+See :issue:`79337`
+
+Description
+===========
+
+The current implementation of the two typolink viewhelpers is lacking support of all sorts of typolink parameters, the useCacheHash parameter being the most important one.
+
+.. index:: Fluid, Frontend
index 362b9e4..96f4600 100644 (file)
@@ -40,7 +40,7 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
  * </code>
  *
  * <code title="Full parameter usage">
- * <f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="&u=b" additionalAttributes="{type:'button'}">
+ * <f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="&u=b" additionalAttributes="{type:'button'}" useCacheHash="TRUE">
  * Linktext
  * </f:link.typolink>
  * </code>
@@ -74,6 +74,7 @@ class TypolinkViewHelper extends AbstractViewHelper
         $this->registerArgument('title', 'string', '', false, '');
         $this->registerArgument('additionalParams', 'string', '', false, '');
         $this->registerArgument('additionalAttributes', 'array', '', false, []);
+        $this->registerArgument('useCacheHash', 'bool', '', false, false);
     }
 
     /**
@@ -94,6 +95,7 @@ class TypolinkViewHelper extends AbstractViewHelper
         $title = $arguments['title'];
         $additionalParams = $arguments['additionalParams'];
         $additionalAttributes = $arguments['additionalAttributes'];
+        $useCacheHash = $arguments['useCacheHash'];
 
         // Merge the $parameter with other arguments
         $typolinkParameter = self::createTypolinkParameterArrayFromArguments($parameter, $target, $class, $title, $additionalParams);
@@ -118,6 +120,7 @@ class TypolinkViewHelper extends AbstractViewHelper
                     'typolink.' => [
                         'parameter' => $typolinkParameter,
                         'ATagParams' => $aTagParams,
+                        'useCacheHash' => $useCacheHash,
                     ]
                 ]
             );
index 80ce278..95a19c2 100644 (file)
@@ -38,7 +38,7 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
  * </code>
  *
  * <code title="Full parameter usage">
- * <f:uri.typolink parameter="{link}" additionalParams="&u=b" />
+ * <f:uri.typolink parameter="{link}" additionalParams="&u=b" useCacheHash="TRUE" />
  * </code>
  * <output>
  * index.php?id=19&X=y&u=b
@@ -57,6 +57,7 @@ class TypolinkViewHelper extends AbstractViewHelper
         parent::initializeArguments();
         $this->registerArgument('parameter', 'string', 'stdWrap.typolink style parameter string', true);
         $this->registerArgument('additionalParams', 'string', 'stdWrap.typolink additionalParams', false, '');
+        $this->registerArgument('useCacheHash', 'bool', '', false, false);
     }
 
     /**
@@ -70,6 +71,7 @@ class TypolinkViewHelper extends AbstractViewHelper
     {
         $parameter = $arguments['parameter'];
         $additionalParams = $arguments['additionalParams'];
+        $useCacheHash = $arguments['useCacheHash'];
 
         $content = '';
         if ($parameter) {
@@ -77,6 +79,7 @@ class TypolinkViewHelper extends AbstractViewHelper
             $content = $contentObject->typoLink_URL(
                 [
                     'parameter' => self::createTypolinkParameterFromArguments($parameter, $additionalParams),
+                    'useCacheHash' => $useCacheHash,
                 ]
             );
         }