2 namespace TYPO3\CMS\Form\Domain\Repository;
32 public function getRecord()
36 $table = (string)$getPostVariables[
'table'];
37 $recordId = (int)$getPostVariables[
'uid'];
41 $languageField =
$GLOBALS[
'TCA'][
'tt_content'][
'ctrl'][
'languageField'];
42 $transOrigPointerField =
$GLOBALS[
'TCA'][
'tt_content'][
'ctrl'][
'transOrigPointerField'];
43 if ($row[$languageField] > 0 && $row[$transOrigPointerField] > 0) {
44 $bodytext = preg_replace(
'/^\[.*?\] /',
'', $row[
'bodytext'], 1);
46 $bodytext = $row[
'bodytext'];
51 $typoScriptParser->parse($bodytext);
54 $record->setUid($row[
'uid']);
55 $record->setPageId($row[
'pid']);
56 $record->setTyposcript($typoScriptParser->setup);
68 return $this->getRecord() !==
false;
76 public function save()
83 $typoscript = $converter->convert($json);
88 $tce->stripslashes_values = 0;
91 $data[$parameters[
'table']][$parameters[
'uid']][$parameters[
'field']] = $typoscript;
93 $tce->start($data, array());
94 $tce->process_datamap();
105 public function getRecordAsJson()
108 $record = $this->getRecord();
110 $typoscript = $record->getTyposcript();
113 $json = $converter->convert($typoscript);