diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-11-17 08:32:16 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-12-07 22:32:05 +0100 |
commit | 3e5838198c6e5f879d3448cfb6c25babd83ca0c4 (patch) | |
tree | 78d072159ea235cd0897458ddd9a39cf911df6f4 /lib/private/Template | |
parent | b2af916872b88d1cb1739904ec66fc4417ac0112 (diff) | |
download | nextcloud-server-3e5838198c6e5f879d3448cfb6c25babd83ca0c4.tar.gz nextcloud-server-3e5838198c6e5f879d3448cfb6c25babd83ca0c4.zip |
Use single resource locator instance
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Template')
-rw-r--r-- | lib/private/Template/CSSResourceLocator.php | 10 | ||||
-rw-r--r-- | lib/private/Template/JSResourceLocator.php | 4 | ||||
-rwxr-xr-x | lib/private/Template/ResourceLocator.php | 17 |
3 files changed, 11 insertions, 20 deletions
diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php index 2cbf12ce65d..beb5178476b 100644 --- a/lib/private/Template/CSSResourceLocator.php +++ b/lib/private/Template/CSSResourceLocator.php @@ -34,14 +34,8 @@ namespace OC\Template; use Psr\Log\LoggerInterface; class CSSResourceLocator extends ResourceLocator { - - /** - * @param string $theme - * @param array $core_map - * @param array $party_map - */ - public function __construct(LoggerInterface $logger, $theme, $core_map, $party_map) { - parent::__construct($logger, $theme, $core_map, $party_map); + public function __construct(LoggerInterface $logger) { + parent::__construct($logger); } /** diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php index 9e76655aba2..00cfde1f9f5 100644 --- a/lib/private/Template/JSResourceLocator.php +++ b/lib/private/Template/JSResourceLocator.php @@ -34,8 +34,8 @@ class JSResourceLocator extends ResourceLocator { /** @var JSCombiner */ protected $jsCombiner; - public function __construct(LoggerInterface $logger, $theme, array $core_map, array $party_map, JSCombiner $JSCombiner) { - parent::__construct($logger, $theme, $core_map, $party_map); + public function __construct(LoggerInterface $logger, JSCombiner $JSCombiner) { + parent::__construct($logger); $this->jsCombiner = $JSCombiner; } diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php index 5a50cc6fd1b..dec74ed1ab8 100755 --- a/lib/private/Template/ResourceLocator.php +++ b/lib/private/Template/ResourceLocator.php @@ -43,18 +43,15 @@ abstract class ResourceLocator { protected LoggerInterface $logger; - /** - * @param string $theme - * @param array $core_map - * @param array $party_map - */ - public function __construct(LoggerInterface $logger, $theme, $core_map, $party_map) { + public function __construct(LoggerInterface $logger) { $this->logger = $logger; - $this->theme = $theme; - $this->mapping = $core_map + $party_map; - $this->serverroot = key($core_map); - $this->thirdpartyroot = key($party_map); + $this->mapping = [ + \OC::$SERVERROOT => \OC::$WEBROOT + ]; + $this->serverroot = \OC::$SERVERROOT; + $this->thirdpartyroot = \OC::$SERVERROOT; $this->webroot = $this->mapping[$this->serverroot]; + $this->theme = \OC_Util::getTheme(); } /** |