mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Nextcloud 32+ compatibility
adds NC32+ compatibility workaround src & credits go to: https://github.com/the-djmaze/snappymail/issues/1994#issuecomment-3366086651
This commit is contained in:
parent
ba496919dd
commit
c95f5fcf98
1 changed files with 13 additions and 3 deletions
|
|
@ -8,6 +8,12 @@ use OCA\SnappyMail\ContentSecurityPolicy;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
use OCP\AppFramework\Http\TemplateResponse;
|
||||||
|
|
||||||
|
// SnappyMail Nextcoud 32 compatibility workaound - START
|
||||||
|
// src: https://github.com/the-djmaze/snappymail/issues/1994#issuecomment-3366086651
|
||||||
|
|
||||||
|
use OCP\INavigationManager; // <<<<<<<<<<<< add this
|
||||||
|
use OCP\Server; // <<<<<<<<<<<< add this
|
||||||
|
|
||||||
class PageController extends Controller
|
class PageController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|
@ -17,7 +23,7 @@ class PageController extends Controller
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$config = \OC::$server->getConfig();
|
$config = \OC::$server->getConfig();
|
||||||
|
$nav = Server::get(INavigationManager::class); // <<<<<<<<<<<< add this
|
||||||
$bAdmin = false;
|
$bAdmin = false;
|
||||||
if (!empty($_SERVER['QUERY_STRING'])) {
|
if (!empty($_SERVER['QUERY_STRING'])) {
|
||||||
SnappyMailHelper::loadApp();
|
SnappyMailHelper::loadApp();
|
||||||
|
|
@ -28,7 +34,8 @@ class PageController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$bAdmin && $config->getAppValue('snappymail', 'snappymail-no-embed')) {
|
if (!$bAdmin && $config->getAppValue('snappymail', 'snappymail-no-embed')) {
|
||||||
\OC::$server->getNavigationManager()->setActiveEntry('snappymail');
|
// \OC::$server->getNavigationManager()->setActiveEntry('snappymail'); // <<<<<<<<<<<< Comment this
|
||||||
|
$nav->setActiveEntry('snappymail'); // <<<<<<<<<<<< add this
|
||||||
\OCP\Util::addScript('snappymail', 'snappymail');
|
\OCP\Util::addScript('snappymail', 'snappymail');
|
||||||
\OCP\Util::addStyle('snappymail', 'style');
|
\OCP\Util::addStyle('snappymail', 'style');
|
||||||
SnappyMailHelper::startApp();
|
SnappyMailHelper::startApp();
|
||||||
|
|
@ -43,7 +50,10 @@ class PageController extends Controller
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
\OC::$server->getNavigationManager()->setActiveEntry('snappymail');
|
// \OC::$server->getNavigationManager()->setActiveEntry('snappymail'); // <<<<<<<<<<<< Comment this
|
||||||
|
$nav->setActiveEntry('snappymail'); // <<<<<<<<<<<< add this
|
||||||
|
|
||||||
|
// SnappyMail Nextcoud 32 compatibility workaound - END
|
||||||
|
|
||||||
\OCP\Util::addStyle('snappymail', 'embed');
|
\OCP\Util::addStyle('snappymail', 'embed');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue