diff options
Diffstat (limited to 'apps/weather_status/lib/AppInfo/Application.php')
-rw-r--r-- | apps/weather_status/lib/AppInfo/Application.php | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/apps/weather_status/lib/AppInfo/Application.php b/apps/weather_status/lib/AppInfo/Application.php index e69215148e0..19cfd643a7e 100644 --- a/apps/weather_status/lib/AppInfo/Application.php +++ b/apps/weather_status/lib/AppInfo/Application.php @@ -26,14 +26,12 @@ declare(strict_types=1); namespace OCA\WeatherStatus\AppInfo; use OCA\WeatherStatus\Capabilities; +use OCA\WeatherStatus\Listeners\BeforeTemplateRenderedListener; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; -use OCP\Dashboard\RegisterWidgetEvent; -use OCP\EventDispatcher\Event; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Util; +use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent; /** * Class Application @@ -52,11 +50,6 @@ class Application extends App implements IBootstrap { */ public function __construct(array $urlParams = []) { parent::__construct(self::APP_ID, $urlParams); - - $dispatcher = $this->getContainer()->query(IEventDispatcher::class); - $dispatcher->addListener(RegisterWidgetEvent::class, function (Event $e) { - Util::addScript(self::APP_ID, 'weather-status'); - }); } /** @@ -65,6 +58,7 @@ class Application extends App implements IBootstrap { public function register(IRegistrationContext $context): void { // Register OCS Capabilities $context->registerCapability(Capabilities::class); + $context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class); } public function boot(IBootContext $context): void { |