TYPO3  7.6
RedirectPostProcessor.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Form\PostProcess;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
25  protected $form;
26 
30  protected $typoScript;
31 
35  protected $destination;
36 
43  public function __construct(\TYPO3\CMS\Form\Domain\Model\Element $form, array $typoScript)
44  {
45  $this->form = $form;
46  $this->typoScript = $typoScript;
47  }
48 
54  public function process()
55  {
56  $this->setDestination();
57  $this->render();
58  }
59 
65  protected function setDestination()
66  {
67  $this->destination = '';
68  if ($this->typoScript['destination']) {
69  $urlConf = array('parameter' => $this->typoScript['destination']);
70  $this->destination = $GLOBALS['TSFE']->cObj->typoLink_URL($urlConf);
71  }
72  }
73 
79  protected function render()
80  {
81  \TYPO3\CMS\Core\Utility\HttpUtility::redirect($this->destination);
82  return;
83  }
84 }