diff options
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index 581a2b44cea..0731239e884 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -73,6 +73,8 @@ use OC\Security\SecureRandom; use OC\Security\TrustedDomainHelper; use OC\Session\CryptoWrapper; use OC\Tagging\TagMapper; +use OCA\Theming\Template; +use OCP\IL10N; use OCP\IServerContainer; use OCP\Security\IContentSecurityPolicyManager; use Symfony\Component\EventDispatcher\EventDispatcher; @@ -562,6 +564,17 @@ class Server extends ServerContainer implements IServerContainer { $factory = new $factoryClass($this); return $factory->getManager(); }); + $this->registerService('ThemingDefaults', function(Server $c) { + if($this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) { + return new Template( + $this->getConfig(), + $this->getL10N('theming'), + $this->getURLGenerator(), + new \OC_Defaults() + ); + } + return new \OC_Defaults(); + }); $this->registerService('EventDispatcher', function () { return new EventDispatcher(); }); @@ -618,7 +631,8 @@ class Server extends ServerContainer implements IServerContainer { $c->getL10N('core'), $factory, $c->getUserManager(), - $c->getRootFolder() + $c->getRootFolder(), + $c->getEventDispatcher() ); return $manager; @@ -1206,6 +1220,14 @@ class Server extends ServerContainer implements IServerContainer { } /** + * @internal Not public by intention. + * @return \OC_Defaults + */ + public function getThemingDefaults() { + return $this->query('ThemingDefaults'); + } + + /** * @return \OC\IntegrityCheck\Checker */ public function getIntegrityCodeChecker() { |