Пример #1
0
 /**
  * Add an CSS class if this view helper has errors
  *
  * @return void
  */
 protected function setErrorClassAttribute()
 {
     if ($this->hasArgument('class')) {
         $cssClass = $this->arguments['class'] . ' ';
     } else {
         $cssClass = '';
     }
     if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
         $mappingResultsForProperty = $this->getMappingResultsForProperty();
         if ($mappingResultsForProperty->hasErrors()) {
             if ($this->hasArgument('errorClass')) {
                 $cssClass .= $this->arguments['errorClass'];
             } else {
                 $cssClass .= 'error';
             }
             $this->tag->addAttribute('class', $cssClass);
         }
     } else {
         // @deprecated since Extbase 1.4.0, will be removed in Extbase 1.6.0.
         $errors = $this->getErrorsForProperty();
         if (count($errors) > 0) {
             if ($this->hasArgument('errorClass')) {
                 $cssClass .= $this->arguments['errorClass'];
             } else {
                 $cssClass .= 'error';
             }
             $this->tag->addAttribute('class', $cssClass);
         }
     }
 }
Пример #2
0
 /**
  * Renders hidden form fields for referrer information about
  * the current controller and action.
  *
  * @return string Hidden fields with referrer information
  * @todo filter out referrer information that is equal to the target (e.g. same packageKey)
  */
 protected function renderHiddenReferrerFields()
 {
     $request = $this->controllerContext->getRequest();
     $extensionName = $request->getControllerExtensionName();
     $controllerName = $request->getControllerName();
     $actionName = $request->getControllerActionName();
     $result = chr(10);
     if ($this->configurationManager->isFeatureEnabled('rewrittenPropertyMapper')) {
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@extension]') . '" value="' . $extensionName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@controller]') . '" value="' . $controllerName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[@action]') . '" value="' . $actionName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[arguments]') . '" value="' . htmlspecialchars($this->hashService->appendHmac(base64_encode(serialize($request->getArguments())))) . '" />' . chr(10);
     } else {
         // @deprecated since Extbase 1.4.0, will be removed with Extbase 1.6.0.
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[extensionName]') . '" value="' . $extensionName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[controllerName]') . '" value="' . $controllerName . '" />' . chr(10);
         $result .= '<input type="hidden" name="' . $this->prefixFieldName('__referrer[actionName]') . '" value="' . $actionName . '" />' . chr(10);
     }
     return $result;
 }