Inheritance: extends Neos\Flow\Mvc\Controller\ActionController, use trait Neos\Neos\Controller\BackendUserTranslationTrait
 /**
  * @return void
  */
 protected function initializeAction()
 {
     parent::initializeAction();
     $translationHelper = new TranslationHelper();
     $this->setTitle($translationHelper->translate($this->moduleConfiguration['label']) . ' :: ' . $translationHelper->translate(str_replace('label', 'action.', $this->moduleConfiguration['label']) . $this->request->getControllerActionName()));
     if ($this->arguments->hasArgument('user')) {
         $propertyMappingConfigurationForUser = $this->arguments->getArgument('user')->getPropertyMappingConfiguration();
         $propertyMappingConfigurationForUserName = $propertyMappingConfigurationForUser->forProperty('user.name');
         $propertyMappingConfigurationForPrimaryAccount = $propertyMappingConfigurationForUser->forProperty('user.primaryAccount');
         $propertyMappingConfigurationForPrimaryAccount->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_TARGET_TYPE, Account::class);
         /** @var PropertyMappingConfiguration $propertyMappingConfiguration */
         foreach (array($propertyMappingConfigurationForUser, $propertyMappingConfigurationForUserName, $propertyMappingConfigurationForPrimaryAccount) as $propertyMappingConfiguration) {
             $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED, true);
         }
     }
     $this->currentUser = $this->userService->getCurrentUser();
 }
示例#2
0
 /**
  * Simply sets the TypoScript path pattern on the view.
  *
  * @param ViewInterface $view
  * @return void
  */
 protected function initializeView(ViewInterface $view)
 {
     parent::initializeView($view);
     $view->setTypoScriptPathPattern('resource://Neos.Neos/Private/Fusion/Backend');
 }
 /**
  * @return void
  */
 protected function initializeUpdateAction()
 {
     $converter = new PersistentObjectConverter();
     $this->arguments->getArgument('workspace')->getPropertyMappingConfiguration()->forProperty('owner')->setTypeConverter($converter)->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_TARGET_TYPE, User::class);
     parent::initializeAction();
 }
 /**
  * @param string $actionName Name of the action to forward to
  * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
  * @param string $packageKey Key of the package containing the controller to forward to. If not specified, the current package is assumed.
  * @param array $arguments Array of arguments for the target action
  * @param integer $delay (optional) The delay in seconds. Default is no delay.
  * @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other"
  * @param string $format The format to use for the redirect URI
  * @return void
  */
 protected function unsetLastVisitedNodeAndRedirect($actionName, $controllerName = null, $packageKey = null, array $arguments = null, $delay = 0, $statusCode = 303, $format = null)
 {
     $this->session->putData('lastVisitedNode', null);
     parent::redirect($actionName, $controllerName, $packageKey, $arguments, $delay, $statusCode, $format);
 }