/**
  * Try to explode the element layout into 2 parts to get the
  * outer wrapping
  *
  * @param string $elementType
  * @param string $elementLayout
  * @return string
  * @deprecated since TYPO3 CMS 7, this function will be removed in TYPO3 CMS 8, as the functionality is now done via fluid
  */
 protected function determineElementOuterWraps($elementType, $elementLayout = '')
 {
     if ($this->formBuilder->getControllerAction() === 'show') {
         if ($elementType === 'TEXTAREA') {
             $return = $this->replaceTagWithMarker('textarea', 'body', $elementLayout);
         } elseif ($elementType === 'CONTENTELEMENT') {
             $return = $this->replaceTagWithMarker('content', 'body', $elementLayout);
         } elseif ($elementType === 'SELECT') {
             $return = $this->replaceTagWithMarker('select', 'body', $elementLayout);
         } elseif (in_array($elementType, $this->containerElements)) {
             $return = $this->replaceTagWithMarker('fieldset', 'body', $elementLayout);
         } else {
             $return = $this->replaceTagWithMarker('input', 'body', $elementLayout);
         }
     } else {
         if ($elementType === 'CONTENTELEMENT') {
             $return = $this->replaceTagWithMarker('content', 'body', $elementLayout);
         } elseif ($elementType === 'SELECT') {
             $return = $this->replaceTagWithMarker('elements', 'body', $elementLayout);
         } elseif (in_array($elementType, $this->containerElements)) {
             if ($this->formBuilder->getControllerAction() === 'confirmation') {
                 $return = $this->replaceTagWithMarker('fieldset', 'body', $elementLayout);
             } else {
                 $return = $this->replaceTagWithMarker('containerwrap', 'body', $elementLayout);
             }
         } else {
             $return = $this->replaceTagWithMarker('inputvalue', 'body', $elementLayout);
         }
     }
     return $return;
 }
Exemplo n.º 2
0
 /**
  * Set the fluid partial path to the element
  *
  * @return void
  */
 public function setVisibility()
 {
     $visibility = false;
     if ($this->formBuilder->getControllerAction() === 'show') {
         if (!isset($this->userConfiguredElementTyposcript['visibleInShowAction'])) {
             $visibility = (bool) $this->typoScriptRepository->getModelConfigurationByScope($this->element->getElementType(), 'visibleInShowAction');
         } else {
             $visibility = (bool) $this->userConfiguredElementTyposcript['visibleInShowAction'];
         }
     } elseif ($this->formBuilder->getControllerAction() === 'confirmation') {
         if (!isset($this->userConfiguredElementTyposcript['visibleInConfirmationAction'])) {
             $visibility = (bool) $this->typoScriptRepository->getModelConfigurationByScope($this->element->getElementType(), 'visibleInConfirmationAction');
         } else {
             $visibility = (bool) $this->userConfiguredElementTyposcript['visibleInConfirmationAction'];
         }
     } elseif ($this->formBuilder->getControllerAction() === 'process') {
         if (!isset($this->userConfiguredElementTyposcript['visibleInMail'])) {
             $visibility = (bool) $this->typoScriptRepository->getModelConfigurationByScope($this->element->getElementType(), 'visibleInMail');
         } else {
             $visibility = (bool) $this->userConfiguredElementTyposcript['visibleInMail'];
         }
     }
     $this->element->setShowElement($visibility);
 }