From 805f50381472849334a3ad95df68ef8ba49f753f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 10 Jul 2018 14:59:15 +0200 Subject: [PATCH] Load theming app css as well if legacy theme is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/theming/appinfo/app.php | 60 ++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/apps/theming/appinfo/app.php b/apps/theming/appinfo/app.php index 3d4b993f7b..dc8e00f4ed 100644 --- a/apps/theming/appinfo/app.php +++ b/apps/theming/appinfo/app.php @@ -26,38 +26,32 @@ */ $app = new \OCP\AppFramework\App('theming'); -/** @var \OCA\Theming\Util $util */ -$util = $app->getContainer()->query(\OCA\Theming\Util::class); -if(!$util->isAlreadyThemed()) { +$app->getContainer()->registerCapability(\OCA\Theming\Capabilities::class); - $app->getContainer()->registerCapability(\OCA\Theming\Capabilities::class); +$linkToCSS = \OC::$server->getURLGenerator()->linkToRoute( + 'theming.Theming.getStylesheet', + [ + 'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'), + ] +); +\OCP\Util::addHeader( + 'link', + [ + 'rel' => 'stylesheet', + 'href' => $linkToCSS, + ] +); - $linkToCSS = \OC::$server->getURLGenerator()->linkToRoute( - 'theming.Theming.getStylesheet', - [ - 'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'), - ] - ); - \OCP\Util::addHeader( - 'link', - [ - 'rel' => 'stylesheet', - 'href' => $linkToCSS, - ] - ); - - $linkToJs = \OC::$server->getURLGenerator()->linkToRoute( - 'theming.Theming.getJavascript', - [ - 'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'), - ] - ); - \OCP\Util::addHeader( - 'script', - [ - 'src' => $linkToJs, - 'nonce' => \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() - ], '' - ); - -} \ No newline at end of file +$linkToJs = \OC::$server->getURLGenerator()->linkToRoute( + 'theming.Theming.getJavascript', + [ + 'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'), + ] +); +\OCP\Util::addHeader( + 'script', + [ + 'src' => $linkToJs, + 'nonce' => \OC::$server->getContentSecurityPolicyNonceManager()->getNonce() + ], '' +); \ No newline at end of file