fluid-checkbox-multiple.patch

Implement multiple attribute for checkbox viewhelper - Mathias Brodala, 2014-09-11 12:17

Download (1.4 KB)

View differences:

typo3/sysext/fluid/Classes/ViewHelpers/Form/CheckboxViewHelper.php
65 65
	 * Renders the checkbox.
66 66
	 *
67 67
	 * @param boolean $checked Specifies that the input element should be preselected
68
	 * @param boolean $multiple Specifies whether this checkbox belongs to a multivalue (is part of a checkbox group)
68 69
	 * @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
69 70
	 * @return string
70 71
	 * @api
71 72
	 */
72
	public function render($checked = NULL) {
73
	public function render($checked = NULL, $multiple = NULL) {
73 74
		$this->tag->addAttribute('type', 'checkbox');
74 75

  
75 76
		$nameAttribute = $this->getName();
......
89 90
					$checked = in_array($valueAttribute, $propertyValue);
90 91
				}
91 92
				$nameAttribute .= '[]';
92
			} elseif (($multiple = FALSE) === TRUE) {
93
				// @todo: implement correct as in Flow.Fluid
93
			} elseif ($multiple === TRUE) {
94 94
				$nameAttribute .= '[]';
95 95
			} elseif ($checked === NULL && $propertyValue !== NULL) {
96 96
				$checked = (boolean) $propertyValue === (boolean) $valueAttribute;