Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-05-23 16:20:54 +0300
committerJulius Härtl <jus@bitgrid.net>2017-07-12 12:42:15 +0300
commitce5ad7e7f48751b25ef9dd377fbbface2adb30b4 (patch)
tree7a9b951dd6458071ac8db0fa016d7c8fe5a6a348 /apps/theming/appinfo
parentd23bc9a99a6aa59aac9a0635ebbb7fa95fcba05a (diff)
Prefer custom theme over theming app
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/appinfo')
-rw-r--r--apps/theming/appinfo/app.php62
1 files changed, 34 insertions, 28 deletions
diff --git a/apps/theming/appinfo/app.php b/apps/theming/appinfo/app.php
index 152504c4179..941df6f73df 100644
--- a/apps/theming/appinfo/app.php
+++ b/apps/theming/appinfo/app.php
@@ -23,33 +23,39 @@
*
*/
-$linkToCSS = \OC::$server->getURLGenerator()->linkToRoute(
- 'theming.Theming.getStylesheet',
- [
- 'v' => \OC::$server->getConfig()->getAppValue('theming', 'cachebuster', '0'),
- ]
-);
-\OCP\Util::addHeader(
- 'link',
- [
- 'rel' => 'stylesheet',
- 'href' => $linkToCSS,
- ]
-);
+$app = new \OCP\AppFramework\App('theming');
+/** @var \OCA\Theming\Util $util */
+$util = $app->getContainer()->query(\OCA\Theming\Util::class);
+if(!$util->isAlreadyThemed()) {
-$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()
- ], ''
-);
+ $app->getContainer()->registerCapability(\OCA\Theming\Capabilities::class);
-$app = new \OCP\AppFramework\App('theming');
-$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,
+ ]
+ );
+
+ $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