2 namespace TYPO3\CMS\T3editor\Hook;
33 protected $ajaxSaveType =
'TypoScriptTemplateInformationModuleFunctionController';
40 if ($this->t3editor === null) {
56 $t3editor->setModeByFile($parameters[
'target']);
61 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/T3editor/FileEdit');
77 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/T3editor/FileEdit');
94 $attributes =
'rows="30" ' .
'wrap="off" ' . $pObj->doc->formWidth(48,
true,
'width:98%;height:60%');
95 $title =
$GLOBALS[
'LANG']->getLL(
'file') .
' ' . htmlspecialchars($pObj->target);
96 $outCode =
$t3editor->getCodeEditor(
'file[editfile][0][data]',
'text-monospace enable-tab',
'$1', $attributes, $title, array(
97 'target' => (
int)$pObj->target
99 $parameters[
'pageContent'] = preg_replace(
'/\\<textarea .*name="file\\[editfile\\]\\[0\\]\\[data\\]".*\\>([^\\<]*)\\<\\/textarea\\>/mi', $outCode, $parameters[
'pageContent']);
108 public function save($parameters, $pObj)
110 $savingsuccess =
false;
111 if ($parameters[
'type'] === $this->ajaxSaveType) {
114 $response = $tceFile->processAjaxRequest($parameters[
'request'], $parameters[
'response']);
115 $result = json_decode((
string)
$response->getBody(),
true);
116 $savingsuccess = is_array($result) && $result[
'editfile'][0];
118 return $savingsuccess;