Skip to content
Snippets Groups Projects
Commit 096aba81 authored by Jigal van Hemert's avatar Jigal van Hemert
Browse files

Revert "[BUGFIX] Unify parameter names between uri and link typolink Viewhelper"

This reverts commit 00df56f2.

Change-Id: I54eaa8fcb3096c9da2a7fcb22dc7c24a22ee58a3
Reviewed-on: http://review.typo3.org/34555


Reviewed-by: default avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: default avatarJigal van Hemert <jigal.van.hemert@typo3.org>
parent 00df56f2
Branches
Tags
No related merge requests found
...@@ -17,7 +17,7 @@ The full parameter usage in Fluid might look like this, where {link} is the fiel ...@@ -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" additionalParameters="&b=u" additionalAttributes="{type:'button'}"> <f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="" additionalAttributes="{type:'button'}">
.. ..
...@@ -27,7 +27,7 @@ While passing additional parameters to the ViewHelper, following rules apply: ...@@ -27,7 +27,7 @@ While passing additional parameters to the ViewHelper, following rules apply:
- target is overridden, the value from Fluid applies - target is overridden, the value from Fluid applies
- class is merged from the values passed from the database and those of *class* - class is merged from the values passed from the database and those of *class*
- title is overridden, the value from Fluid applies - title is overridden, the value from Fluid applies
- additionalParameters is merged from the values passed from the database and those of *additionalParameters* - additionalParams is merged from the values passed from the database and those of *additionalParams*
- additionalAttributes is (as usual) added to the resulting tag as *type="button"* - additionalAttributes is (as usual) added to the resulting tag as *type="button"*
{link} contains *19 _blank - "testtitle with whitespace" &X=y*. {link} contains *19 _blank - "testtitle with whitespace" &X=y*.
...@@ -35,7 +35,7 @@ For the given example, the output is: ...@@ -35,7 +35,7 @@ For the given example, the output is:
:: ::
<a href="index.php?id=19&X=y&b=u" title="some title" target="_blank" class="ico-class" type="button"> <a href="index.php?id=19&X=y" title="some title" target="_blank" class="ico-class" type="button">
.. ..
......
...@@ -37,7 +37,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; ...@@ -37,7 +37,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
* </code> * </code>
* *
* <code title="Full parameter usage"> * <code title="Full parameter usage">
* <f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParameters="&b=u" additionalAttributes="{type:'button'}"> * <f:link.typolink parameter="{link}" target="_blank" class="ico-class" title="some title" additionalParams="&u=b" additionalAttributes="{type:'button'}">
* Linktext * Linktext
* </f:link.typolink> * </f:link.typolink>
* </code> * </code>
...@@ -57,14 +57,14 @@ class TypolinkViewHelper extends AbstractViewHelper { ...@@ -57,14 +57,14 @@ class TypolinkViewHelper extends AbstractViewHelper {
* @param string $target * @param string $target
* @param string $class * @param string $class
* @param string $title * @param string $title
* @param string $additionalParameters * @param string $additionalParams
* @param array $additionalAttributes * @param array $additionalAttributes
* *
* @return string * @return string
*/ */
public function render($parameter, $target = '', $class = '', $title = '', $additionalParameters = '', $additionalAttributes = array()) { public function render($parameter, $target = '', $class = '', $title = '', $additionalParams = '', $additionalAttributes = array()) {
// Merge the $parameter with other arguments // Merge the $parameter with other arguments
$typolinkParameter = $this->createTypolinkParameterArrayFromArguments($parameter, $target, $class, $title, $additionalParameters); $typolinkParameter = $this->createTypolinkParameterArrayFromArguments($parameter, $target, $class, $title, $additionalParams);
// array(param1 -> value1, param2 -> value2) --> "param1=value1 param2=>value2" for typolink.ATagParams // array(param1 -> value1, param2 -> value2) --> "param1=value1 param2=>value2" for typolink.ATagParams
$extraAttributes = array(); $extraAttributes = array();
...@@ -101,11 +101,11 @@ class TypolinkViewHelper extends AbstractViewHelper { ...@@ -101,11 +101,11 @@ class TypolinkViewHelper extends AbstractViewHelper {
* @param string $target * @param string $target
* @param string $class * @param string $class
* @param string $title * @param string $title
* @param string $additionalParameters * @param string $additionalParams
* *
* @return array Final merged typolink.parameter as array to be imploded with empty string later * @return array Final merged typolink.parameter as array to be imploded with empty string later
*/ */
protected function createTypolinkParameterArrayFromArguments($parameter, $target = '', $class = '', $title = '', $additionalParameters = '') { protected function createTypolinkParameterArrayFromArguments($parameter, $target = '', $class = '', $title = '', $additionalParams = '') {
// Explode $parameter by whitespace and remove any " around resulting array values // Explode $parameter by whitespace and remove any " around resulting array values
$parameterArray = GeneralUtility::unQuoteFilenames($parameter, TRUE); $parameterArray = GeneralUtility::unQuoteFilenames($parameter, TRUE);
...@@ -132,9 +132,9 @@ class TypolinkViewHelper extends AbstractViewHelper { ...@@ -132,9 +132,9 @@ class TypolinkViewHelper extends AbstractViewHelper {
$typolinkConfiguration[3] = $title; $typolinkConfiguration[3] = $title;
} }
// Combine additionalParameters // Combine additionalParams
if ($additionalParameters) { if ($additionalParams) {
$typolinkConfiguration[4] .= $additionalParameters; $typolinkConfiguration[4] .= $additionalParams;
} }
// Unset unused parameters again from the end, wrap all given values with " // Unset unused parameters again from the end, wrap all given values with "
......
...@@ -55,7 +55,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase { ...@@ -55,7 +55,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase {
$target = '-'; $target = '-';
$class = 'fluid_class'; $class = 'fluid_class';
$title = 'a new title'; $title = 'a new title';
$additionalParameters = '&a=b'; $additionalParams = '&a=b';
$additionalAttributes = array( $additionalAttributes = array(
'value1' => 'param1', 'value1' => 'param1',
'value2' => 'par&am2', // Check htmlspecialchars is applied 'value2' => 'par&am2', // Check htmlspecialchars is applied
...@@ -72,7 +72,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase { ...@@ -72,7 +72,7 @@ class TypolinkViewHelperTest extends ViewHelperBaseTestcase {
GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', $contentObjectRendererMock); GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', $contentObjectRendererMock);
$subject->render($params, $target, $class, $title, $additionalParameters, $additionalAttributes); $subject->render($params, $target, $class, $title, $additionalParams, $additionalAttributes);
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment