Load theming app css as well if legacy theme is enabled
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
a22bc0e787
commit
805f503814
|
@ -26,38 +26,32 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$app = new \OCP\AppFramework\App('theming');
|
$app = new \OCP\AppFramework\App('theming');
|
||||||
/** @var \OCA\Theming\Util $util */
|
$app->getContainer()->registerCapability(\OCA\Theming\Capabilities::class);
|
||||||
$util = $app->getContainer()->query(\OCA\Theming\Util::class);
|
|
||||||
if(!$util->isAlreadyThemed()) {
|
|
||||||
|
|
||||||
$app->getContainer()->registerCapability(\OCA\Theming\Capabilities::class);
|
$linkToCSS = \OC::$server->getURLGenerator()->linkToRoute(
|
||||||
|
|
||||||
$linkToCSS = \OC::$server->getURLGenerator()->linkToRoute(
|
|
||||||
'theming.Theming.getStylesheet',
|
'theming.Theming.getStylesheet',
|
||||||
[
|
[
|
||||||
'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'),
|
'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
\OCP\Util::addHeader(
|
\OCP\Util::addHeader(
|
||||||
'link',
|
'link',
|
||||||
[
|
[
|
||||||
'rel' => 'stylesheet',
|
'rel' => 'stylesheet',
|
||||||
'href' => $linkToCSS,
|
'href' => $linkToCSS,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$linkToJs = \OC::$server->getURLGenerator()->linkToRoute(
|
$linkToJs = \OC::$server->getURLGenerator()->linkToRoute(
|
||||||
'theming.Theming.getJavascript',
|
'theming.Theming.getJavascript',
|
||||||
[
|
[
|
||||||
'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'),
|
'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
\OCP\Util::addHeader(
|
\OCP\Util::addHeader(
|
||||||
'script',
|
'script',
|
||||||
[
|
[
|
||||||
'src' => $linkToJs,
|
'src' => $linkToJs,
|
||||||
'nonce' => \OC::$server->getContentSecurityPolicyNonceManager()->getNonce()
|
'nonce' => \OC::$server->getContentSecurityPolicyNonceManager()->getNonce()
|
||||||
], ''
|
], ''
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue