/** * Revive the domain model of the accordant element. * * @param Element $element * @param array $userConfiguredElementTypoScript The configuration array * @param string $elementType The element type (e.g BUTTON) * @return void */ protected function reviveElement(Element $element, array $userConfiguredElementTypoScript, $elementType = '') { // @todo Check $userConfiguredElementTypoScript if ($elementType === 'IMAGEBUTTON') { GeneralUtility::deprecationLog('EXT:form: The element IMAGEBUTTON is deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8.'); } $element->setElementType($elementType); $element->setElementCounter($this->elementCounter->getElementId()); $elementBuilder = ElementBuilder::create($this, $element, $userConfiguredElementTypoScript); $elementBuilder->setPartialPaths(); $elementBuilder->setVisibility(); if ($element->getElementType() == 'CONTENTELEMENT') { $attributeValue = ''; if ($this->configuration->getContentElementRendering()) { $attributeValue = $this->formUtility->renderItem($userConfiguredElementTypoScript['cObj.'], $userConfiguredElementTypoScript['cObj']); } $element->setAdditionalArguments(array('content' => $attributeValue)); /* use the compatibility theme whenever if a layout is defined */ if ($this->configuration->getCompatibility()) { $this->compatibilityService->setElementLayouts($element, $userConfiguredElementTypoScript); if (isset($userConfiguredElementTypoScript['layout'])) { $this->configuration->setThemeName(static::COMPATIBILITY_THEME_NAME); unset($userConfiguredElementTypoScript['layout']); } } } else { $this->setAttributes($elementBuilder, $element, $userConfiguredElementTypoScript); $userConfiguredElementTypoScript = $elementBuilder->getUserConfiguredElementTypoScript(); $this->setValidationMessages($element); /* use the compatibility theme whenever if a layout is defined */ if ($this->configuration->getCompatibility()) { $this->compatibilityService->setElementLayouts($element, $userConfiguredElementTypoScript); if (isset($userConfiguredElementTypoScript['layout'])) { $this->configuration->setThemeName(static::COMPATIBILITY_THEME_NAME); unset($userConfiguredElementTypoScript['layout']); } } $this->signalSlotDispatcher->dispatch(__CLASS__, 'txFormAfterElementCreation', array($element, $this)); // create all child elements $this->setChildElementsByIntegerKey($element, $userConfiguredElementTypoScript); } }