Exemple #1
0
 /**
  * TODO: Document this Method! ( __construct )
  */
 public function __construct()
 {
     $this->view = new \TYPO3\Fluid\View\StandaloneView();
     $this->view->setTemplatePathAndFilename('resource://Debug.Toolbar/Private/Templates/Toolbar.html');
     $this->view->setPartialRootPath('resource://Debug.Toolbar/Private/Partials/');
     $this->view->setFormat('html');
 }
 /**
  * Prepare a Fluid view for rendering an error page with the Neos backend
  *
  * @return StandaloneView
  */
 protected function prepareFluidView()
 {
     $fluidView = new StandaloneView();
     $fluidView->setTemplatePathAndFilename('resource://TYPO3.Neos/Private/Templates/Error/NeosBackendMessage.html');
     $fluidView->setLayoutRootPath('resource://TYPO3.Neos/Private/Layouts');
     // FIXME find a better way than using templates as partials
     $fluidView->setPartialRootPath('resource://TYPO3.Neos/Private/Templates/TypoScriptObjects');
     $fluidView->setControllerContext($this->runtime->getControllerContext());
     $fluidView->setFormat('html');
     return $fluidView;
 }
 public function sendPasswordResetLink($email, $cryptJson)
 {
     $baseUrl = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['SERVER_NAME'] . '/';
     $requestLink = $baseUrl . 'changepassword?code=' . $cryptJson;
     $templatepath = 'resource://Incvisio.LostFound/Private/Templates/Emails/ForgotPassword.html';
     $this->standaloneView->setFormat('html');
     $this->standaloneView->setTemplatePathAndFilename($templatepath);
     $this->standaloneView->assign('requestLink', $requestLink);
     $emailBody = $this->standaloneView->render();
     $mail = new \TYPO3\SwiftMailer\Message();
     $mail->setTo($email)->setFrom(array('*****@*****.**' => 'LostFound UA'))->setSubject('Reset link')->setBody($emailBody, 'text/html')->send();
 }
 /**
  * @param NodeInterface $node
  * @return string
  * @throws NeosException
  */
 public function render(NodeInterface $node)
 {
     if ($this->privilegeManager->isPrivilegeTargetGranted('TYPO3.Neos:Backend.GeneralAccess') === false) {
         return '';
     }
     /** @var $actionRequest ActionRequest */
     $actionRequest = $this->controllerContext->getRequest();
     $innerView = new StandaloneView($actionRequest);
     $innerView->setTemplatePathAndFilename('resource://TYPO3.Neos/Private/Templates/Backend/Content/Container.html');
     $innerView->setFormat('html');
     $innerView->setPartialRootPath('resource://TYPO3.Neos/Private/Partials');
     $user = $this->securityContext->getPartyByType('TYPO3\\Neos\\Domain\\Model\\User');
     $innerView->assignMultiple(array('node' => $node, 'modules' => $this->menuHelper->buildModuleList($this->controllerContext), 'sites' => $this->menuHelper->buildSiteList($this->controllerContext), 'user' => $user));
     return $innerView->render();
 }
 /**
  * Prepares a Fluid view for rendering the custom error page.
  *
  * @param \Exception $exception
  * @param array $renderingOptions Rendering options as defined in the settings
  * @return StandaloneView
  */
 protected function buildCustomFluidView(\Exception $exception, array $renderingOptions)
 {
     $statusCode = 500;
     $referenceCode = NULL;
     if ($exception instanceof FlowException) {
         $statusCode = $exception->getStatusCode();
         $referenceCode = $exception->getReferenceCode();
     }
     $statusMessage = Response::getStatusMessageByCode($statusCode);
     $fluidView = new StandaloneView();
     $fluidView->getRequest()->setControllerPackageKey('TYPO3.Flow');
     $fluidView->setTemplatePathAndFilename($renderingOptions['templatePathAndFilename']);
     if (isset($renderingOptions['layoutRootPath'])) {
         $fluidView->setLayoutRootPath($renderingOptions['layoutRootPath']);
     }
     if (isset($renderingOptions['partialRootPath'])) {
         $fluidView->setPartialRootPath($renderingOptions['partialRootPath']);
     }
     if (isset($renderingOptions['format'])) {
         $fluidView->setFormat($renderingOptions['format']);
     }
     if (isset($renderingOptions['variables'])) {
         $fluidView->assignMultiple($renderingOptions['variables']);
     }
     $fluidView->assignMultiple(array('exception' => $exception, 'renderingOptions' => $renderingOptions, 'statusCode' => $statusCode, 'statusMessage' => $statusMessage, 'referenceCode' => $referenceCode));
     return $fluidView;
 }
Exemple #6
0
 /**
  * @test
  */
 public function setFormatSetsRequestFormat()
 {
     $this->mockRequest->expects($this->once())->method('setFormat')->with('xml');
     $this->view->setFormat('xml');
 }