TYPO3 CMS  TYPO3_6-2
SaveWizardView.php
Go to the documentation of this file.
1 <?php
3 
22 
30  public function render() {
31  $success = FALSE;
32  // Check if the referenced record is available
33  $this->recordIsAvailable = $this->repository->hasRecord();
34  if ($this->recordIsAvailable) {
35  // Save the data
36  $success = $this->repository->save();
37  }
38  $this->headerOutput($success);
39  }
40 
47  protected function headerOutput($success) {
48  if (!$success) {
49  header('HTTP/1.1 500 Internal Server Error');
50  $jsonArray = array('message' => 'Failed to save the form');
51  } else {
52  $jsonArray = array('message' => 'Changes saved successfully');
53  }
54  $json = json_encode($jsonArray);
55  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
56  header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
57  header('Cache-Control: no-cache, must-revalidate');
58  header('Pragma: no-cache');
59  header('Content-Length: ' . strlen($json));
60  header('Content-Type: application/json; charset=utf-8');
61  header('Content-Transfer-Encoding: 8bit');
62  echo $json;
63  die;
64  }
65 
66 }
die
Definition: index.php:6