コード例 #1
0
 /**
  * Updates the local properties - called after
  * new TypoScript has been assigned in this object.
  */
 protected function update()
 {
     // Determine content rendering mode. If activated, cObject and stdWrap can be
     // used to execute various processes that must not be allowed on TypoScript
     // that has been created by non-privileged backend users (= insecure TypoScript)
     $this->setContentElementRendering(empty($this->typoScript[static::DISABLE_CONTENT_ELEMENT_RENDERING]));
     // Determine the HTML form element prefix to distinguish
     // different form components on the same page in the frontend
     if (!empty($this->typoScript['prefix'])) {
         $this->setPrefix($this->typoScript['prefix']);
     }
     // Determine compatibility behavior
     $this->setCompatibility((bool) $this->typoScriptRepository->getModelConfigurationByScope('FORM', 'compatibilityMode'));
     if (isset($this->typoScript['compatibilityMode'])) {
         if ((int) $this->typoScript['compatibilityMode'] === 0) {
             $this->setCompatibility(false);
         } else {
             $this->setCompatibility(true);
         }
     }
     // Set the theme name
     if (!empty($this->typoScript['themeName'])) {
         $this->setThemeName($this->typoScript['themeName']);
     } elseif (!empty($this->typoScriptRepository->getModelConfigurationByScope('FORM', 'themeName'))) {
         $this->setThemeName($this->typoScriptRepository->getModelConfigurationByScope('FORM', 'themeName'));
     } else {
         $this->setThemeName(static::DEFAULT_THEME_NAME);
     }
 }
コード例 #2
0
 /**
  * Set the name and id attribute
  *
  * @return array
  */
 public function setNameAndId()
 {
     if ($this->element->getParentElement() && (int) $this->typoScriptRepository->getModelConfigurationByScope($this->element->getParentElement()->getElementType(), 'childrenInheritName') == 1) {
         $this->htmlAttributes['name'] = $this->element->getParentElement()->getName();
         $this->additionalArguments['multiple'] = '1';
         $name = $this->sanitizeNameAttribute($this->userConfiguredElementTyposcript['name']);
         $this->element->setName($name);
     } else {
         $this->htmlAttributes['name'] = $this->sanitizeNameAttribute($this->htmlAttributes['name']);
         $this->element->setName($this->htmlAttributes['name']);
     }
     $this->htmlAttributes['id'] = $this->sanitizeIdAttribute($this->htmlAttributes['id']);
     $this->element->setId($this->htmlAttributes['id']);
 }