aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Template.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-12-03 14:10:59 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-01-08 10:14:53 +0100
commit806a176a57526b55c18817577325509dfb4ef648 (patch)
tree2338acdcf6e917ac1a86e7cb82d9b2755d764bea /lib/private/legacy/OC_Template.php
parent1261fa53845481adbbbeff2aabe23d0409446017 (diff)
downloadnextcloud-server-806a176a57526b55c18817577325509dfb4ef648.tar.gz
nextcloud-server-806a176a57526b55c18817577325509dfb4ef648.zip
Move backgroundjob script after main core scripts
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/legacy/OC_Template.php')
-rw-r--r--lib/private/legacy/OC_Template.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php
index dcca41fb1d0..16ad7273cd2 100644
--- a/lib/private/legacy/OC_Template.php
+++ b/lib/private/legacy/OC_Template.php
@@ -102,14 +102,9 @@ class OC_Template extends \OC\Template\Base {
public static function initTemplateEngine($renderAs) {
if (self::$initTemplateEngineFirstRun) {
- //apps that started before the template initialization can load their own scripts/styles
- //so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true
- //meaning the last script/style in this list will be loaded first
- if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== TemplateResponse::RENDER_AS_ERROR && !\OCP\Util::needUpgrade()) {
- if (\OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
- OC_Util::addScript('core', 'backgroundjobs', true);
- }
- }
+ // apps that started before the template initialization can load their own scripts/styles
+ // so to make sure this scripts/styles here are loaded first we put all core scripts first
+ // check lib/public/Util.php
OC_Util::addStyle('css-variables', null, true);
OC_Util::addStyle('server', null, true);
@@ -124,6 +119,15 @@ class OC_Template extends \OC\Template\Base {
Util::addScript('core', 'merged-template-prepend');
}
+ // If installed and background job is set to ajax, add dedicated script
+ if (\OC::$server->getSystemConfig()->getValue('installed', false)
+ && $renderAs !== TemplateResponse::RENDER_AS_ERROR
+ && !\OCP\Util::needUpgrade()) {
+ if (\OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
+ Util::addScript('core', 'backgroundjobs');
+ }
+ }
+
self::$initTemplateEngineFirstRun = false;
}
}