Draft code to run SnappyMail inside Nextcloud without iframe for

This commit is contained in:
the-djmaze 2022-10-11 22:36:53 +02:00
parent dcf4983a7d
commit d52f2adb2b
4 changed files with 82 additions and 12 deletions

View file

@ -17,15 +17,7 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
$this->addHook('filter.app-data', 'FilterAppData');
$this->addHook('json.attachments', 'SaveAttachments');
$sAppPath = \rtrim(\trim(\OC::$server->getAppManager()->getAppWebPath()), '\\/').'/app/';
if (!$sAppPath) {
$sUrl = \MailSo\Base\Http::SingletonInstance()->GetUrl();
if (\str_contains($sUrl, '/index.php/apps/snappymail/')) {
$sAppPath = \preg_replace('/\/index\.php\/apps\/snappymail.+$/',
'/apps/snappymail/app/', $sUrl);
}
}
$_SERVER['SCRIPT_NAME'] = $sAppPath;
$this->addJs('js/attachments.js');
}
}