diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst index 5e8891791c4887b4a1b7cb79a220d77cc8dacb6f..c6d0e29c1d87a75887a35bb91e1d6ac0bde98c69 100644 --- a/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-59396-TypolinkViewHelper.rst @@ -17,7 +17,7 @@ The full parameter usage in Fluid might look like this, where {link} is the fiel :: -<f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="" additionalAttributes="{type:'button'}"> +<f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParameters="&b=u" additionalAttributes="{type:'button'}"> .. @@ -27,7 +27,7 @@ While passing additional parameters to the ViewHelper, following rules apply: - target is overridden, the value from Fluid applies - class is merged from the values passed from the database and those of *class* - title is overridden, the value from Fluid applies -- additionalParams is merged from the values passed from the database and those of *additionalParams* +- additionalParameters is merged from the values passed from the database and those of *additionalParameters* - additionalAttributes is (as usual) added to the resulting tag as *type="button"* {link} contains *19 _blank - "testtitle with whitespace" &X=y*. @@ -35,7 +35,7 @@ For the given example, the output is: :: -<a href="index.php?id=19&X=y" title="some title" target="_blank" class="ico-class" type="button"> +<a href="index.php?id=19&X=y&b=u" title="some title" target="_blank" class="ico-class" type="button"> .. diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php index 5fa612443cd098d33fbe4cf828217b2021bd02eb..2939396b0a3e692f48c5207dfb13740156cdc1b3 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Link/TypolinkViewHelper.php @@ -37,7 +37,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; * </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" additionalParameters="&b=u" additionalAttributes="{type:'button'}"> * Linktext * </f:link.typolink> * </code> @@ -57,14 +57,14 @@ class TypolinkViewHelper extends AbstractViewHelper { * @param string $target * @param string $class * @param string $title - * @param string $additionalParams + * @param string $additionalParameters * @param array $additionalAttributes * * @return string */ - public function render($parameter, $target = '', $class = '', $title = '', $additionalParams = '', $additionalAttributes = array()) { + public function render($parameter, $target = '', $class = '', $title = '', $additionalParameters = '', $additionalAttributes = array()) { // Merge the $parameter with other arguments - $typolinkParameter = $this->createTypolinkParameterArrayFromArguments($parameter, $target, $class, $title, $additionalParams); + $typolinkParameter = $this->createTypolinkParameterArrayFromArguments($parameter, $target, $class, $title, $additionalParameters); // array(param1 -> value1, param2 -> value2) --> "param1=value1 param2=>value2" for typolink.ATagParams $extraAttributes = array(); @@ -101,11 +101,11 @@ class TypolinkViewHelper extends AbstractViewHelper { * @param string $target * @param string $class * @param string $title - * @param string $additionalParams + * @param string $additionalParameters * * @return array Final merged typolink.parameter as array to be imploded with empty string later */ - protected function createTypolinkParameterArrayFromArguments($parameter, $target = '', $class = '', $title = '', $additionalParams = '') { + protected function createTypolinkParameterArrayFromArguments($parameter, $target = '', $class = '', $title = '', $additionalParameters = '') { // Explode $parameter by whitespace and remove any " around resulting array values $parameterArray = GeneralUtility::unQuoteFilenames($parameter, TRUE); @@ -132,9 +132,9 @@ class TypolinkViewHelper extends AbstractViewHelper { $typolinkConfiguration[3] = $title; } - // Combine additionalParams - if ($additionalParams) { - $typolinkConfiguration[4] .= $additionalParams; + // Combine additionalParameters + if ($additionalParameters) { + $typolinkConfiguration[4] .= $additionalParameters; } // Unset unused parameters again from the end, wrap all given values with " diff --git a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php index b9f67d91ccdb3f18ee7d2aadb98b551605bad476..2938f6b546b4b9c7d524c3de8e2e6b61b2213e40 100644 --- a/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php +++ b/typo3/sysext/fluid/Tests/Unit/ViewHelpers/Link/TypolinkViewHelperTest.php @@ -55,7 +55,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase { $target = '-'; $class = 'fluid_class'; $title = 'a new title'; - $additionalParams = '&a=b'; + $additionalParameters = '&a=b'; $additionalAttributes = array( 'value1' => 'param1', 'value2' => 'par&am2', // Check htmlspecialchars is applied @@ -72,7 +72,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase { GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', $contentObjectRendererMock); - $subject->render($params, $target, $class, $title, $additionalParams, $additionalAttributes); + $subject->render($params, $target, $class, $title, $additionalParameters, $additionalAttributes); } /**