Bugfix: CKEditor failed to load

This commit is contained in:
djmaze 2020-09-23 11:20:00 +02:00
parent 3599c4c745
commit 65032e3b89
5 changed files with 205 additions and 248 deletions

View file

@ -1007,9 +1007,11 @@ class ServiceActions
$this->oActions->SetSpecAuthToken($sAuthAccountHash);
}
$sResult = $this->compileAppData($this->oActions->AppData($bAdmin,
0 === \strpos($sAdd, 'mobile'), '1' === \substr($sAdd, -1),
$sAuthAccountHash), false);
$sResult = 'rl.initData('
.\json_encode($this->oActions->AppData($bAdmin,
0 === \strpos($sAdd, 'mobile'), '1' === \substr($sAdd, -1),
$sAuthAccountHash))
.');';
$this->Logger()->Write($sResult, \MailSo\Log\Enumerations\Type::INFO, 'APPDATA');
@ -1092,13 +1094,4 @@ class ServiceActions
($bWrapByScriptTag ? '</script>' : '')
;
}
private function compileAppData(array $aAppData, bool $bWrapByScriptTag = true) : string
{
return
($bWrapByScriptTag ? '<script type="text/javascript" data-cfasync="false">' : '').
'if(window.__initAppData){window.__initAppData('.\json_encode($aAppData).');}'.
($bWrapByScriptTag ? '</script>' : '')
;
}
}