| @@ 185-241 (lines=57) @@ | ||
| 182 | $mainFieldHtml = implode(LF, $mainFieldHtml); |
|
| 183 | ||
| 184 | $fullElement = $mainFieldHtml; |
|
| 185 | if ($this->hasNullCheckboxButNoPlaceholder()) { |
|
| 186 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 187 | $fullElement = []; |
|
| 188 | $fullElement[] = '<div class="t3-form-field-disable"></div>'; |
|
| 189 | $fullElement[] = '<div class="checkbox t3-form-field-eval-null-checkbox">'; |
|
| 190 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 191 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="0" />'; |
|
| 192 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . ' />'; |
|
| 193 | $fullElement[] = $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.nullCheckbox'); |
|
| 194 | $fullElement[] = '</label>'; |
|
| 195 | $fullElement[] = '</div>'; |
|
| 196 | $fullElement[] = $mainFieldHtml; |
|
| 197 | $fullElement = implode(LF, $fullElement); |
|
| 198 | } elseif ($this->hasNullCheckboxWithPlaceholder()) { |
|
| 199 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 200 | $placeholder = $shortenedPlaceholder = $config['placeholder'] ?? ''; |
|
| 201 | $disabled = ''; |
|
| 202 | $fallbackValue = 0; |
|
| 203 | if (strlen($placeholder) > 0) { |
|
| 204 | $shortenedPlaceholder = GeneralUtility::fixed_lgd_cs($placeholder, 20); |
|
| 205 | if ($placeholder !== $shortenedPlaceholder) { |
|
| 206 | $overrideLabel = sprintf( |
|
| 207 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 208 | '<span title="' . htmlspecialchars($placeholder) . '">' . htmlspecialchars($shortenedPlaceholder) . '</span>' |
|
| 209 | ); |
|
| 210 | } else { |
|
| 211 | $overrideLabel = sprintf( |
|
| 212 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 213 | htmlspecialchars($placeholder) |
|
| 214 | ); |
|
| 215 | } |
|
| 216 | } else { |
|
| 217 | $fallbackValue = 1; |
|
| 218 | $checked = ' checked="checked"'; |
|
| 219 | $disabled = ' disabled="disabled"'; |
|
| 220 | $overrideLabel = $languageService->sL( |
|
| 221 | 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available' |
|
| 222 | ); |
|
| 223 | } |
|
| 224 | $fullElement = []; |
|
| 225 | $fullElement[] = '<div class="checkbox t3js-form-field-eval-null-placeholder-checkbox">'; |
|
| 226 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 227 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="' . $fallbackValue . '" />'; |
|
| 228 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . $disabled . ' />'; |
|
| 229 | $fullElement[] = $overrideLabel; |
|
| 230 | $fullElement[] = '</label>'; |
|
| 231 | $fullElement[] = '</div>'; |
|
| 232 | $fullElement[] = '<div class="t3js-formengine-placeholder-placeholder">'; |
|
| 233 | $fullElement[] = '<div class="form-control-wrap" style="max-width:' . $width . 'px">'; |
|
| 234 | $fullElement[] = '<input type="text" class="form-control" disabled="disabled" value="' . $shortenedPlaceholder . '" />'; |
|
| 235 | $fullElement[] = '</div>'; |
|
| 236 | $fullElement[] = '</div>'; |
|
| 237 | $fullElement[] = '<div class="t3js-formengine-placeholder-formfield">'; |
|
| 238 | $fullElement[] = $mainFieldHtml; |
|
| 239 | $fullElement[] = '</div>'; |
|
| 240 | $fullElement = implode(LF, $fullElement); |
|
| 241 | } |
|
| 242 | ||
| 243 | $resultArray['html'] = '<div class="formengine-field-item t3js-formengine-field-item">' . $fieldInformationHtml . $fullElement . '</div>'; |
|
| 244 | return $resultArray; |
|
| @@ 202-258 (lines=57) @@ | ||
| 199 | $expansionHtml = implode(LF, $expansionHtml); |
|
| 200 | ||
| 201 | $fullElement = $expansionHtml; |
|
| 202 | if ($this->hasNullCheckboxButNoPlaceholder()) { |
|
| 203 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 204 | $fullElement = []; |
|
| 205 | $fullElement[] = '<div class="t3-form-field-disable"></div>'; |
|
| 206 | $fullElement[] = '<div class="checkbox t3-form-field-eval-null-checkbox">'; |
|
| 207 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 208 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="0" />'; |
|
| 209 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . ' />'; |
|
| 210 | $fullElement[] = $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.nullCheckbox'); |
|
| 211 | $fullElement[] = '</label>'; |
|
| 212 | $fullElement[] = '</div>'; |
|
| 213 | $fullElement[] = $expansionHtml; |
|
| 214 | $fullElement = implode(LF, $fullElement); |
|
| 215 | } elseif ($this->hasNullCheckboxWithPlaceholder()) { |
|
| 216 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 217 | $placeholder = $shortenedPlaceholder = $config['placeholder'] ?? ''; |
|
| 218 | $disabled = ''; |
|
| 219 | $fallbackValue = 0; |
|
| 220 | if (strlen($placeholder) > 0) { |
|
| 221 | $shortenedPlaceholder = GeneralUtility::fixed_lgd_cs($placeholder, 20); |
|
| 222 | if ($placeholder !== $shortenedPlaceholder) { |
|
| 223 | $overrideLabel = sprintf( |
|
| 224 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 225 | '<span title="' . htmlspecialchars($placeholder) . '">' . htmlspecialchars($shortenedPlaceholder) . '</span>' |
|
| 226 | ); |
|
| 227 | } else { |
|
| 228 | $overrideLabel = sprintf( |
|
| 229 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 230 | htmlspecialchars($placeholder) |
|
| 231 | ); |
|
| 232 | } |
|
| 233 | } else { |
|
| 234 | $fallbackValue = 1; |
|
| 235 | $checked = ' checked="checked"'; |
|
| 236 | $disabled = ' disabled="disabled"'; |
|
| 237 | $overrideLabel = $languageService->sL( |
|
| 238 | 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available' |
|
| 239 | ); |
|
| 240 | } |
|
| 241 | $fullElement = []; |
|
| 242 | $fullElement[] = '<div class="checkbox t3js-form-field-eval-null-placeholder-checkbox">'; |
|
| 243 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 244 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="' . $fallbackValue . '" />'; |
|
| 245 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . $disabled . ' />'; |
|
| 246 | $fullElement[] = $overrideLabel; |
|
| 247 | $fullElement[] = '</label>'; |
|
| 248 | $fullElement[] = '</div>'; |
|
| 249 | $fullElement[] = '<div class="t3js-formengine-placeholder-placeholder">'; |
|
| 250 | $fullElement[] = '<div class="form-control-wrap" style="max-width:' . $width . 'px">'; |
|
| 251 | $fullElement[] = '<input type="text" class="form-control" disabled="disabled" value="' . $shortenedPlaceholder . '" />'; |
|
| 252 | $fullElement[] = '</div>'; |
|
| 253 | $fullElement[] = '</div>'; |
|
| 254 | $fullElement[] = '<div class="t3js-formengine-placeholder-formfield">'; |
|
| 255 | $fullElement[] = $expansionHtml; |
|
| 256 | $fullElement[] = '</div>'; |
|
| 257 | $fullElement = implode(LF, $fullElement); |
|
| 258 | } |
|
| 259 | ||
| 260 | $resultArray['html'] = '<div class="formengine-field-item t3js-formengine-field-item">' . $fieldInformationHtml . $fullElement . '</div>'; |
|
| 261 | return $resultArray; |
|
| @@ 235-291 (lines=57) @@ | ||
| 232 | $expansionHtml = implode(LF, $expansionHtml); |
|
| 233 | ||
| 234 | $fullElement = $expansionHtml; |
|
| 235 | if ($this->hasNullCheckboxButNoPlaceholder()) { |
|
| 236 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 237 | $fullElement = []; |
|
| 238 | $fullElement[] = '<div class="t3-form-field-disable"></div>'; |
|
| 239 | $fullElement[] = '<div class="checkbox t3-form-field-eval-null-checkbox">'; |
|
| 240 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 241 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="0" />'; |
|
| 242 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . ' />'; |
|
| 243 | $fullElement[] = $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.nullCheckbox'); |
|
| 244 | $fullElement[] = '</label>'; |
|
| 245 | $fullElement[] = '</div>'; |
|
| 246 | $fullElement[] = $expansionHtml; |
|
| 247 | $fullElement = implode(LF, $fullElement); |
|
| 248 | } elseif ($this->hasNullCheckboxWithPlaceholder()) { |
|
| 249 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 250 | $placeholder = $shortenedPlaceholder = $config['placeholder'] ?? ''; |
|
| 251 | $disabled = ''; |
|
| 252 | $fallbackValue = 0; |
|
| 253 | if (strlen($placeholder) > 0) { |
|
| 254 | $shortenedPlaceholder = GeneralUtility::fixed_lgd_cs($placeholder, 20); |
|
| 255 | if ($placeholder !== $shortenedPlaceholder) { |
|
| 256 | $overrideLabel = sprintf( |
|
| 257 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 258 | '<span title="' . htmlspecialchars($placeholder) . '">' . htmlspecialchars($shortenedPlaceholder) . '</span>' |
|
| 259 | ); |
|
| 260 | } else { |
|
| 261 | $overrideLabel = sprintf( |
|
| 262 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 263 | htmlspecialchars($placeholder) |
|
| 264 | ); |
|
| 265 | } |
|
| 266 | } else { |
|
| 267 | $fallbackValue = 1; |
|
| 268 | $checked = ' checked="checked"'; |
|
| 269 | $disabled = ' disabled="disabled"'; |
|
| 270 | $overrideLabel = $languageService->sL( |
|
| 271 | 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available' |
|
| 272 | ); |
|
| 273 | } |
|
| 274 | $fullElement = []; |
|
| 275 | $fullElement[] = '<div class="checkbox t3js-form-field-eval-null-placeholder-checkbox">'; |
|
| 276 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 277 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="' . $fallbackValue . '" />'; |
|
| 278 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . $disabled . ' />'; |
|
| 279 | $fullElement[] = $overrideLabel; |
|
| 280 | $fullElement[] = '</label>'; |
|
| 281 | $fullElement[] = '</div>'; |
|
| 282 | $fullElement[] = '<div class="t3js-formengine-placeholder-placeholder">'; |
|
| 283 | $fullElement[] = '<div class="form-control-wrap" style="max-width:' . $width . 'px">'; |
|
| 284 | $fullElement[] = '<input type="text" class="form-control" disabled="disabled" value="' . $shortenedPlaceholder . '" />'; |
|
| 285 | $fullElement[] = '</div>'; |
|
| 286 | $fullElement[] = '</div>'; |
|
| 287 | $fullElement[] = '<div class="t3js-formengine-placeholder-formfield">'; |
|
| 288 | $fullElement[] = $expansionHtml; |
|
| 289 | $fullElement[] = '</div>'; |
|
| 290 | $fullElement = implode(LF, $fullElement); |
|
| 291 | } |
|
| 292 | ||
| 293 | $resultArray['html'] = '<div class="formengine-field-item t3js-formengine-field-item">' . $fieldInformationHtml . $fullElement . '</div>'; |
|
| 294 | return $resultArray; |
|
| @@ 236-292 (lines=57) @@ | ||
| 233 | $mainFieldHtml = implode(LF, $mainFieldHtml); |
|
| 234 | ||
| 235 | $fullElement = $mainFieldHtml; |
|
| 236 | if ($this->hasNullCheckboxButNoPlaceholder()) { |
|
| 237 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 238 | $fullElement = []; |
|
| 239 | $fullElement[] = '<div class="t3-form-field-disable"></div>'; |
|
| 240 | $fullElement[] = '<div class="checkbox t3-form-field-eval-null-checkbox">'; |
|
| 241 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 242 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="0" />'; |
|
| 243 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . ' />'; |
|
| 244 | $fullElement[] = $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.nullCheckbox'); |
|
| 245 | $fullElement[] = '</label>'; |
|
| 246 | $fullElement[] = '</div>'; |
|
| 247 | $fullElement[] = $mainFieldHtml; |
|
| 248 | $fullElement = implode(LF, $fullElement); |
|
| 249 | } elseif ($this->hasNullCheckboxWithPlaceholder()) { |
|
| 250 | $checked = $itemValue !== null ? ' checked="checked"' : ''; |
|
| 251 | $placeholder = $shortenedPlaceholder = $config['placeholder'] ?? ''; |
|
| 252 | $disabled = ''; |
|
| 253 | $fallbackValue = 0; |
|
| 254 | if (strlen($placeholder) > 0) { |
|
| 255 | $shortenedPlaceholder = GeneralUtility::fixed_lgd_cs($placeholder, 20); |
|
| 256 | if ($placeholder !== $shortenedPlaceholder) { |
|
| 257 | $overrideLabel = sprintf( |
|
| 258 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 259 | '<span title="' . htmlspecialchars($placeholder) . '">' . htmlspecialchars($shortenedPlaceholder) . '</span>' |
|
| 260 | ); |
|
| 261 | } else { |
|
| 262 | $overrideLabel = sprintf( |
|
| 263 | $languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override'), |
|
| 264 | htmlspecialchars($placeholder) |
|
| 265 | ); |
|
| 266 | } |
|
| 267 | } else { |
|
| 268 | $fallbackValue = 1; |
|
| 269 | $checked = ' checked="checked"'; |
|
| 270 | $disabled = ' disabled="disabled"'; |
|
| 271 | $overrideLabel = $languageService->sL( |
|
| 272 | 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.placeholder.override_not_available' |
|
| 273 | ); |
|
| 274 | } |
|
| 275 | $fullElement = []; |
|
| 276 | $fullElement[] = '<div class="checkbox t3js-form-field-eval-null-placeholder-checkbox">'; |
|
| 277 | $fullElement[] = '<label for="' . $nullControlNameEscaped . '">'; |
|
| 278 | $fullElement[] = '<input type="hidden" name="' . $nullControlNameEscaped . '" value="' . $fallbackValue . '" />'; |
|
| 279 | $fullElement[] = '<input type="checkbox" name="' . $nullControlNameEscaped . '" id="' . $nullControlNameEscaped . '" value="1"' . $checked . $disabled . ' />'; |
|
| 280 | $fullElement[] = $overrideLabel; |
|
| 281 | $fullElement[] = '</label>'; |
|
| 282 | $fullElement[] = '</div>'; |
|
| 283 | $fullElement[] = '<div class="t3js-formengine-placeholder-placeholder">'; |
|
| 284 | $fullElement[] = '<div class="form-control-wrap" style="max-width:' . $width . 'px">'; |
|
| 285 | $fullElement[] = '<input type="text" class="form-control" disabled="disabled" value="' . $shortenedPlaceholder . '" />'; |
|
| 286 | $fullElement[] = '</div>'; |
|
| 287 | $fullElement[] = '</div>'; |
|
| 288 | $fullElement[] = '<div class="t3js-formengine-placeholder-formfield">'; |
|
| 289 | $fullElement[] = $mainFieldHtml; |
|
| 290 | $fullElement[] = '</div>'; |
|
| 291 | $fullElement = implode(LF, $fullElement); |
|
| 292 | } |
|
| 293 | ||
| 294 | $resultArray['html'] = '<div class="formengine-field-item t3js-formengine-field-item">' . $fieldInformationHtml . $fullElement . '</div>'; |
|
| 295 | return $resultArray; |
|