aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Template.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-08-14 17:45:53 +0200
committerRobin Appelman <robin@icewind.nl>2023-08-17 10:57:56 +0200
commit222ed1f8498ecc232708db002f1c0c886961a3e8 (patch)
treeb64b10d70793319d26272817cc1ecc7c9ebfc4ea /lib/private/legacy/OC_Template.php
parentdaf3b29572921562abcb700052c1de19fdd2fe4e (diff)
downloadnextcloud-server-222ed1f8498ecc232708db002f1c0c886961a3e8.tar.gz
nextcloud-server-222ed1f8498ecc232708db002f1c0c886961a3e8.zip
move core script loading from static template to event listener
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/legacy/OC_Template.php')
-rw-r--r--lib/private/legacy/OC_Template.php39
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php
index 70477ea6a06..3d27475590f 100644
--- a/lib/private/legacy/OC_Template.php
+++ b/lib/private/legacy/OC_Template.php
@@ -59,8 +59,6 @@ class OC_Template extends \OC\Template\Base {
/** @var string */
protected $app; // app id
- protected static $initTemplateEngineFirstRun = true;
-
/**
* Constructor
*
@@ -73,9 +71,6 @@ class OC_Template extends \OC\Template\Base {
* @param bool $registerCall = true
*/
public function __construct($app, $name, $renderAs = TemplateResponse::RENDER_AS_BLANK, $registerCall = true) {
- // Read the selected theme from the config file
- self::initTemplateEngine($renderAs);
-
$theme = OC_Util::getTheme();
$requestToken = (OC::$server->getSession() && $registerCall) ? \OCP\Util::callRegister() : '';
@@ -95,40 +90,6 @@ class OC_Template extends \OC\Template\Base {
parent::__construct($template, $requestToken, $l10n, $themeDefaults);
}
- /**
- * @param string $renderAs
- */
- 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 put all core scripts first
- // check lib/public/Util.php
- OC_Util::addStyle('server', null, true);
-
- // include common nextcloud webpack bundle
- Util::addScript('core', 'common');
- Util::addScript('core', 'main');
- Util::addTranslations('core');
-
- if (\OC::$server->getSystemConfig()->getValue('installed', false) && !\OCP\Util::needUpgrade()) {
- Util::addScript('core', 'files_fileinfo');
- Util::addScript('core', 'files_client');
- 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;
- }
- }
-
/**
* find the template with the given name