summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/AppInfo
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-13 17:04:49 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-07-24 12:23:16 +0200
commit340cd81d2f9acd5c866638618c6a894f0b3de2d4 (patch)
treee77519a7f9fc50228795d48bda3f4d48cbe5cc9c /apps/theming/lib/AppInfo
parent6ef029d6f34da238a0a4119c00b8c1f699958e09 (diff)
downloadnextcloud-server-340cd81d2f9acd5c866638618c6a894f0b3de2d4.tar.gz
nextcloud-server-340cd81d2f9acd5c866638618c6a894f0b3de2d4.zip
Use IBootstrap for the app theming
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/theming/lib/AppInfo')
-rw-r--r--apps/theming/lib/AppInfo/Application.php29
1 files changed, 14 insertions, 15 deletions
diff --git a/apps/theming/lib/AppInfo/Application.php b/apps/theming/lib/AppInfo/Application.php
index 5d722a96276..2fc752f73a8 100644
--- a/apps/theming/lib/AppInfo/Application.php
+++ b/apps/theming/lib/AppInfo/Application.php
@@ -2,6 +2,7 @@
/**
* @copyright Copyright (c) 2019 Robin Appelman <robin@icewind.nl>
*
+ * @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
@@ -24,28 +25,26 @@
namespace OCA\Theming\AppInfo;
-use OCA\Theming\Service\JSDataService;
-use OCP\AppFramework\IAppContainer;
-use OCP\IInitialStateService;
+use OCA\Theming\Capabilities;
+use OCA\Theming\Listener\BeforeTemplateRenderedListener;
+use OCP\AppFramework\App;
+use OCP\AppFramework\Bootstrap\IBootContext;
+use OCP\AppFramework\Bootstrap\IBootstrap;
+use OCP\AppFramework\Bootstrap\IRegistrationContext;
+use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
-class Application extends \OCP\AppFramework\App {
+class Application extends App implements IBootstrap {
public const APP_ID = 'theming';
public function __construct() {
parent::__construct(self::APP_ID);
-
- $container = $this->getContainer();
- $this->registerInitialState($container);
}
- private function registerInitialState(IAppContainer $container) {
- /** @var IInitialStateService $initialState */
- $initialState = $container->query(IInitialStateService::class);
+ public function register(IRegistrationContext $context): void {
+ $context->registerCapability(Capabilities::class);
+ $context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
+ }
- $initialState->provideLazyInitialState(self::APP_ID, 'data', function () use ($container) {
- /** @var JSDataService $data */
- $data = $container->query(JSDataService::class);
- return $data;
- });
+ public function boot(IBootContext $context): void {
}
}