Project

General

Profile

Bug #61529 ยป fluid-checkbox-multiple.patch

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

View differences:

typo3/sysext/fluid/Classes/ViewHelpers/Form/CheckboxViewHelper.php
* Renders the checkbox.
*
* @param boolean $checked Specifies that the input element should be preselected
* @param boolean $multiple Specifies whether this checkbox belongs to a multivalue (is part of a checkbox group)
* @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
* @return string
* @api
*/
public function render($checked = NULL) {
public function render($checked = NULL, $multiple = NULL) {
$this->tag->addAttribute('type', 'checkbox');
$nameAttribute = $this->getName();
......
$checked = in_array($valueAttribute, $propertyValue);
}
$nameAttribute .= '[]';
} elseif (($multiple = FALSE) === TRUE) {
// @todo: implement correct as in Flow.Fluid
} elseif ($multiple === TRUE) {
$nameAttribute .= '[]';
} elseif ($checked === NULL && $propertyValue !== NULL) {
$checked = (boolean) $propertyValue === (boolean) $valueAttribute;
    (1-1/1)