From 2f0fb83f7c2d599945db2842cb89696d42650dd2 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 20 May 2023 21:53:05 -0700 Subject: [PATCH] page: do not hide bg Signed-off-by: Varun Patil --- lib/Controller/PageController.php | 12 +++++++++++- lib/Controller/PublicAlbumController.php | 2 +- lib/Controller/PublicController.php | 2 +- templates/main.php | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 9817d2ee..f8ef419c 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -57,7 +57,7 @@ class PageController extends Controller OCPUtil::addTranslations('recognize'); } - $response = new TemplateResponse($this->appName, 'main'); + $response = new TemplateResponse($this->appName, 'main', self::getMainParams()); $response->setContentSecurityPolicy(self::getCSP()); $response->cacheFor(0); @@ -110,6 +110,16 @@ class PageController extends Controller return $policy; } + /** + * Get params for main.php template. + */ + public static function getMainParams() + { + return [ + 'native' => Util::callerIsNative(), + ]; + } + /** * @NoAdminRequired * diff --git a/lib/Controller/PublicAlbumController.php b/lib/Controller/PublicAlbumController.php index 89dc9e51..d4e73c97 100644 --- a/lib/Controller/PublicAlbumController.php +++ b/lib/Controller/PublicAlbumController.php @@ -86,7 +86,7 @@ class PublicAlbumController extends Controller // Scripts Util::addScript($this->appName, 'memories-main'); - $response = new PublicTemplateResponse($this->appName, 'main'); + $response = new PublicTemplateResponse($this->appName, 'main', PageController::getMainParams()); $response->setHeaderTitle($album['name']); $response->setFooterVisible(false); // wth is that anyway? $response->setContentSecurityPolicy(PageController::getCSP()); diff --git a/lib/Controller/PublicController.php b/lib/Controller/PublicController.php index 209a36c4..aa14f56b 100644 --- a/lib/Controller/PublicController.php +++ b/lib/Controller/PublicController.php @@ -127,7 +127,7 @@ class PublicController extends AuthPublicShareController Util::addOgMetadata($node, $node->getName(), $url, $params); // Render the template - $response = new PublicTemplateResponse($this->appName, 'main'); + $response = new PublicTemplateResponse($this->appName, 'main', PageController::getMainParams()); $response->setHeaderTitle($node->getName()); $response->setFooterVisible(false); // wth is that anyway? $response->setContentSecurityPolicy(PageController::getCSP()); diff --git a/templates/main.php b/templates/main.php index fa2061c9..419a2204 100644 --- a/templates/main.php +++ b/templates/main.php @@ -1,7 +1,9 @@ + +