[TASK] Remove DocumentTemplate section in Wizard controllers
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / View / Wizard / LoadWizardView.php
1 <?php
2 namespace TYPO3\CMS\Form\View\Wizard;
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
17 /**
18 * The form wizard load view
19 */
20 class LoadWizardView extends \TYPO3\CMS\Form\View\Wizard\AbstractWizardView
21 {
22 /**
23 * The main render method
24 *
25 * Gathers all content and echos it to the screen
26 *
27 * @return void
28 */
29 public function render()
30 {
31 $jsonObject = $this->repository->getRecordAsJson();
32 $this->headerOutput($jsonObject);
33 }
34
35 /**
36 * Construct the response header
37 *
38 * @param mixed $jsonObject JSON string, FALSE if not succeeded
39 * @return void
40 */
41 protected function headerOutput($jsonObject)
42 {
43 if (!$jsonObject) {
44 header('HTTP/1.1 500 Internal Server Error');
45 $jsonArray = array('message' => $this->getLanguageService()->getLL('action_load_message_failed', false));
46 } else {
47 $jsonArray = array('configuration' => $jsonObject);
48 }
49 $json = json_encode($jsonArray);
50 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
51 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
52 header('Cache-Control: no-cache, must-revalidate');
53 header('Pragma: no-cache');
54 header('Content-Length: ' . strlen($json));
55 header('Content-Type: application/json; charset=utf-8');
56 header('Content-Transfer-Encoding: 8bit');
57 echo $json;
58 die;
59 }
60 }