Commit e4cc0f68 authored by Oliver Hader's avatar Oliver Hader Committed by Benni Mack
Browse files

[TASK] Purge onFocus occurrences from FormEngine

In TYPO3 6.2 palette fields have been handled by an individual on-focus
DOM events, depending on a particular user setting. During the FormEngine
rewrite with TYPO3 CMS 7, these parts have been kept and transported
through the system. Since this information is not used anymore, it can
be removed without any substitution.

Resolves: #75657
Releases: master
Change-Id: I7ab55d3f38b8f34e85027cdbbe8d5850f91dddb5
Reviewed-on: https://review.typo3.org/47699


Reviewed-by: default avatarSusanne Moog <typo3@susannemoog.de>
Tested-by: default avatarSusanne Moog <typo3@susannemoog.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent a657cda6
...@@ -86,7 +86,6 @@ class FlexFormElementContainer extends AbstractContainer ...@@ -86,7 +86,6 @@ class FlexFormElementContainer extends AbstractContainer
'onChange' => $flexFormFieldArray['onChange'], 'onChange' => $flexFormFieldArray['onChange'],
], ],
'fieldChangeFunc' => $parameterArray['fieldChangeFunc'], 'fieldChangeFunc' => $parameterArray['fieldChangeFunc'],
'onFocus' => $parameterArray['onFocus'],
'label' => $parameterArray['label'], 'label' => $parameterArray['label'],
]; ];
......
...@@ -435,7 +435,7 @@ abstract class AbstractFormElement extends AbstractNode ...@@ -435,7 +435,7 @@ abstract class AbstractFormElement extends AbstractNode
* @param array $itemArray The array of items. For "select" and "group"/"file" this is just a set of value. For "db" its an array of arrays with table/uid pairs. * @param array $itemArray The array of items. For "select" and "group"/"file" this is just a set of value. For "db" its an array of arrays with table/uid pairs.
* @param string $selector Alternative selector box. * @param string $selector Alternative selector box.
* @param array $params An array of additional parameters, eg: "size", "info", "headers" (array with "selector" and "items"), "noBrowser", "thumbnails * @param array $params An array of additional parameters, eg: "size", "info", "headers" (array with "selector" and "items"), "noBrowser", "thumbnails
* @param string $onFocus On focus attribute string * @param null $_ unused (onFocus in the past), will be removed in TYPO3 CMS 9
* @param string $table (optional) Table name processing for * @param string $table (optional) Table name processing for
* @param string $field (optional) Field of table name processing for * @param string $field (optional) Field of table name processing for
* @param string $uid (optional) uid of table record processing for * @param string $uid (optional) uid of table record processing for
...@@ -444,7 +444,7 @@ abstract class AbstractFormElement extends AbstractNode ...@@ -444,7 +444,7 @@ abstract class AbstractFormElement extends AbstractNode
* @throws \UnexpectedValueException * @throws \UnexpectedValueException
* @todo: Hack this mess into pieces and inline to group / select element depending on what they need * @todo: Hack this mess into pieces and inline to group / select element depending on what they need
*/ */
protected function dbFileIcons($fName, $mode, $allowed, $itemArray, $selector = '', $params = array(), $onFocus = '', $table = '', $field = '', $uid = '', $config = array()) protected function dbFileIcons($fName, $mode, $allowed, $itemArray, $selector = '', $params = array(), $_ = null, $table = '', $field = '', $uid = '', $config = array())
{ {
$languageService = $this->getLanguageService(); $languageService = $this->getLanguageService();
$disabled = ''; $disabled = '';
...@@ -508,7 +508,7 @@ abstract class AbstractFormElement extends AbstractNode ...@@ -508,7 +508,7 @@ abstract class AbstractFormElement extends AbstractNode
$selector = '<select id="' . StringUtility::getUniqueId('tceforms-multiselect-') . '" ' $selector = '<select id="' . StringUtility::getUniqueId('tceforms-multiselect-') . '" '
. ($params['noList'] ? 'style="display: none"' : 'size="' . $sSize . '" class="form-control tceforms-multiselect"') . ($params['noList'] ? 'style="display: none"' : 'size="' . $sSize . '" class="form-control tceforms-multiselect"')
. ($isMultiple ? ' multiple="multiple"' : '') . ($isMultiple ? ' multiple="multiple"' : '')
. ' data-formengine-input-name="' . htmlspecialchars($fName) . '" ' . $this->getValidationDataAsDataAttribute($config) . $onFocus . $params['style'] . $disabled . '>' . implode('', $opt) . ' data-formengine-input-name="' . htmlspecialchars($fName) . '" ' . $this->getValidationDataAsDataAttribute($config) . $params['style'] . $disabled . '>' . implode('', $opt)
. '</select>'; . '</select>';
} }
$icons = array( $icons = array(
...@@ -714,7 +714,6 @@ abstract class AbstractFormElement extends AbstractNode ...@@ -714,7 +714,6 @@ abstract class AbstractFormElement extends AbstractNode
'mode' => $mode, 'mode' => $mode,
'allowed' => $allowed, 'allowed' => $allowed,
'itemArray' => $itemArray, 'itemArray' => $itemArray,
'onFocus' => $onFocus,
'table' => $table, 'table' => $table,
'field' => $field, 'field' => $field,
'uid' => $uid, 'uid' => $uid,
......
...@@ -136,7 +136,6 @@ class CheckboxElement extends AbstractFormElement ...@@ -136,7 +136,6 @@ class CheckboxElement extends AbstractFormElement
value="1" value="1"
data-formengine-input-name="' . htmlspecialchars($additionalInformation['itemFormElName']) . '" data-formengine-input-name="' . htmlspecialchars($additionalInformation['itemFormElName']) . '"
' . $checkboxParameters . ' ' . $checkboxParameters . '
' . $additionalInformation['onFocus'] . '
' . (!$disabled ?: ' disabled="disabled"') . ' ' . (!$disabled ?: ' disabled="disabled"') . '
id="' . $checkboxId . '" /> id="' . $checkboxId . '" />
' . ($label ? htmlspecialchars($label) : '&nbsp;') . ' ' . ($label ? htmlspecialchars($label) : '&nbsp;') . '
......
...@@ -202,11 +202,12 @@ class GroupElement extends AbstractFormElement ...@@ -202,11 +202,12 @@ class GroupElement extends AbstractFormElement
$itemArray, $itemArray,
'', '',
$params, $params,
$parameterArray['onFocus'], null,
'', '',
'', '',
'', '',
$config); $config
);
if (!$disabled && !(isset($config['disable_controls']) && GeneralUtility::inList($config['disable_controls'], 'upload'))) { if (!$disabled && !(isset($config['disable_controls']) && GeneralUtility::inList($config['disable_controls'], 'upload'))) {
// Adding the upload field: // Adding the upload field:
$isDirectFileUploadEnabled = (bool)$this->getBackendUserAuthentication()->uc['edit_docModuleUpload']; $isDirectFileUploadEnabled = (bool)$this->getBackendUserAuthentication()->uc['edit_docModuleUpload'];
...@@ -240,8 +241,7 @@ class GroupElement extends AbstractFormElement ...@@ -240,8 +241,7 @@ class GroupElement extends AbstractFormElement
'', '',
$itemArray, $itemArray,
'', '',
$params, $params
$parameterArray['onFocus']
); );
break; break;
case 'db': case 'db':
...@@ -298,7 +298,7 @@ class GroupElement extends AbstractFormElement ...@@ -298,7 +298,7 @@ class GroupElement extends AbstractFormElement
$itemArray, $itemArray,
'', '',
$params, $params,
$parameterArray['onFocus'], null,
$table, $table,
$fieldName, $fieldName,
$row['uid'], $row['uid'],
......
...@@ -159,10 +159,7 @@ class InputTextElement extends AbstractFormElement ...@@ -159,10 +159,7 @@ class InputTextElement extends AbstractFormElement
$attributeString .= ' ' . $attributeName . '="' . htmlspecialchars($attributeValue) . '"'; $attributeString .= ' ' . $attributeName . '="' . htmlspecialchars($attributeValue) . '"';
} }
$html = ' $html = '<input type="text"' . $attributeString . ' />';
<input type="text"'
. $attributeString
. $parameterArray['onFocus'] . ' />';
// This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database. // This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database.
$html .= '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; $html .= '<input type="hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />';
......
...@@ -44,7 +44,6 @@ class RadioElement extends AbstractFormElement ...@@ -44,7 +44,6 @@ class RadioElement extends AbstractFormElement
. ' id="' . $radioId . '"' . ' id="' . $radioId . '"'
. ' value="' . htmlspecialchars($value) . '"' . ' value="' . htmlspecialchars($value) . '"'
. $radioChecked . $radioChecked
. $this->data['parameterArray']['onFocus']
. $disabled . $disabled
. ' onclick="' . htmlspecialchars(implode('', $this->data['parameterArray']['fieldChangeFunc'])) . '"' . ' onclick="' . htmlspecialchars(implode('', $this->data['parameterArray']['fieldChangeFunc'])) . '"'
. '/>' . '/>'
......
...@@ -139,8 +139,7 @@ class SelectCheckBoxElement extends AbstractFormElement ...@@ -139,8 +139,7 @@ class SelectCheckBoxElement extends AbstractFormElement
. 'value="' . htmlspecialchars($item['value']) . '" ' . 'value="' . htmlspecialchars($item['value']) . '" '
. 'onclick="' . htmlspecialchars($sOnChange) . '" ' . 'onclick="' . htmlspecialchars($sOnChange) . '" '
. ($item['checked'] ? 'checked=checked ' : '') . ($item['checked'] ? 'checked=checked ' : '')
. ($item['disabled'] ? 'disabled=disabled ' : '') . ($item['disabled'] ? 'disabled=disabled ' : '') . '>';
. $parameterArray['onFocus'] . '>';
$tableRows[] = '</td>'; $tableRows[] = '</td>';
$tableRows[] = '<td class="col-icon">'; $tableRows[] = '<td class="col-icon">';
$tableRows[] = '<label class="label-block" for="' . $item['id'] . '">' . $item['icon'] . '</label>'; $tableRows[] = '<label class="label-block" for="' . $item['id'] . '">' . $item['icon'] . '</label>';
......
...@@ -113,7 +113,6 @@ class SelectMultipleSideBySideElement extends AbstractFormElement ...@@ -113,7 +113,6 @@ class SelectMultipleSideBySideElement extends AbstractFormElement
. 'class="form-control t3js-formengine-select-itemstoselect" ' . 'class="form-control t3js-formengine-select-itemstoselect" '
. ($size ? ' size="' . $size . '" ' : '') . ($size ? ' size="' . $size . '" ' : '')
. 'onchange="' . htmlspecialchars($sOnChange) . '" ' . 'onchange="' . htmlspecialchars($sOnChange) . '" '
. $parameterArray['onFocus']
. $this->getValidationDataAsDataAttribute($config) . $this->getValidationDataAsDataAttribute($config)
. $selector_itemListStyle . $selector_itemListStyle
. '>'; . '>';
...@@ -171,7 +170,7 @@ class SelectMultipleSideBySideElement extends AbstractFormElement ...@@ -171,7 +170,7 @@ class SelectMultipleSideBySideElement extends AbstractFormElement
'rightbox' => implode(LF, $itemsToSelect), 'rightbox' => implode(LF, $itemsToSelect),
'readOnly' => $disabled 'readOnly' => $disabled
); );
$html .= $this->dbFileIcons($parameterArray['itemFormElName'], '', '', $itemsArray, '', $params, $parameterArray['onFocus']); $html .= $this->dbFileIcons($parameterArray['itemFormElName'], '', '', $itemsArray, '', $params);
// Wizards: // Wizards:
if (!$disabled) { if (!$disabled) {
......
...@@ -155,7 +155,7 @@ class SelectSingleBoxElement extends AbstractFormElement ...@@ -155,7 +155,7 @@ class SelectSingleBoxElement extends AbstractFormElement
} }
$html = [ $html = [
'<select ' . $this->implodeAttributes($attributes) . ' ' . $parameterArray['onFocus'] . ' ' . $this->getValidationDataAsDataAttribute($config) . '>', '<select ' . $this->implodeAttributes($attributes) . ' ' . $this->getValidationDataAsDataAttribute($config) . '>',
implode(LF, $optionElements), implode(LF, $optionElements),
'</select>', '</select>',
]; ];
......
...@@ -255,10 +255,7 @@ class SelectSingleElement extends AbstractFormElement ...@@ -255,10 +255,7 @@ class SelectSingleElement extends AbstractFormElement
'{', '{',
'onChange: function() {', 'onChange: function() {',
implode('', $parameterArray['fieldChangeFunc']), implode('', $parameterArray['fieldChangeFunc']),
'},', '}',
'onFocus: function() {',
$parameterArray['onFocus'],
'},',
'}', '}',
');', ');',
'}', '}',
......
...@@ -171,7 +171,6 @@ class TextElement extends AbstractFormElement ...@@ -171,7 +171,6 @@ class TextElement extends AbstractFormElement
$html .= '<textarea' $html .= '<textarea'
. $attributeString . $attributeString
. $placeholderAttribute . $placeholderAttribute
. $parameterArray['onFocus']
. '>' . htmlspecialchars($parameterArray['itemFormElValue']) . '</textarea>'; . '>' . htmlspecialchars($parameterArray['itemFormElValue']) . '</textarea>';
// Wrap a wizard around the item? // Wrap a wizard around the item?
......
...@@ -134,10 +134,7 @@ class RsaInputElement extends AbstractFormElement ...@@ -134,10 +134,7 @@ class RsaInputElement extends AbstractFormElement
$attributeString .= ' ' . $attributeName . '="' . htmlspecialchars($attributeValue) . '"'; $attributeString .= ' ' . $attributeName . '="' . htmlspecialchars($attributeValue) . '"';
} }
$html = ' $html = '<input' . $attributeString . ' />';
<input'
. $attributeString
. $parameterArray['onFocus'] . ' />';
// This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database. // This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database.
$html .= '<input type="hidden" data-rsa-encryption="" id="' . $parameterArray['itemFormElID'] . '_hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />'; $html .= '<input type="hidden" data-rsa-encryption="" id="' . $parameterArray['itemFormElID'] . '_hidden" name="' . $parameterArray['itemFormElName'] . '" value="' . htmlspecialchars($parameterArray['itemFormElValue']) . '" />';
......
Supports Markdown
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