data['databaseRow']; $parameterArray = $this->data['parameterArray']; $isPublic = (bool)$this->data['tcaSchemata']->get('sys_file_storage')->getField('is_public')->getDefaultValue(); if ($this->data['command'] === 'edit') { // Make sure the storage object can be retrieved which is not the case when new storage. $lang = $this->getLanguageService(); $defaultFlashMessageQueue = $this->flashMessageService->getMessageQueueByIdentifier(); try { $storage = $this->storageRepository->findByUid((int)$row['uid']); $storageRecord = $storage->getStorageRecord(); $isPublic = $storage->isPublic() && $storageRecord['is_public']; // Display a warning to the BE User in case settings is not inline with storage capability. if ($storageRecord['is_public'] && !$storage->isPublic()) { $message = new FlashMessage( $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.message.storage_is_no_public'), $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.header.storage_is_no_public'), ContextualFeedbackSeverity::WARNING ); $defaultFlashMessageQueue->enqueue($message); } } catch (InvalidPathException $e) { $message = new FlashMessage( $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:filestorage.invalidpathexception.message'), $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:filestorage.invalidpathexception.title'), ContextualFeedbackSeverity::ERROR ); $defaultFlashMessageQueue->enqueue($message); } } $isPublicAsString = $isPublic ? '1' : '0'; $fieldInformationResult = $this->renderFieldInformation(); $fieldInformationHtml = $fieldInformationResult['html']; $resultArray = $this->initializeResultArray(); $resultArray = $this->mergeChildReturnIntoExistingResult($resultArray, $fieldInformationResult, false); $checkboxParameters = $this->checkBoxParams( $parameterArray['itemFormElName'], $isPublic ? 1 : 0, 0, 1, $parameterArray['fieldChangeFunc'] ?? [] ); $checkboxId = htmlspecialchars(StringUtility::getUniqueId('formengine-fal-is-public-')); $html = []; $html[] = '
'; $html[] = $fieldInformationHtml; $html[] = '
'; $html[] = '
'; $html[] = '
'; $html[] = ''; $html[] = $this->appendValueToLabelInDebugMode('', $isPublicAsString); $html[] = ''; $html[] = 'wrapWithFieldsetAndLegend(implode(LF, $html)); return $resultArray; } }