Application.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Theming\AppInfo;
  7. use OCA\Theming\Capabilities;
  8. use OCA\Theming\Listener\BeforePreferenceListener;
  9. use OCA\Theming\Listener\BeforeTemplateRenderedListener;
  10. use OCA\Theming\SetupChecks\PhpImagickModule;
  11. use OCP\AppFramework\App;
  12. use OCP\AppFramework\Bootstrap\IBootContext;
  13. use OCP\AppFramework\Bootstrap\IBootstrap;
  14. use OCP\AppFramework\Bootstrap\IRegistrationContext;
  15. use OCP\AppFramework\Http\Events\BeforeLoginTemplateRenderedEvent;
  16. use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
  17. use OCP\Config\BeforePreferenceDeletedEvent;
  18. use OCP\Config\BeforePreferenceSetEvent;
  19. class Application extends App implements IBootstrap {
  20. public const APP_ID = 'theming';
  21. public function __construct() {
  22. parent::__construct(self::APP_ID);
  23. }
  24. public function register(IRegistrationContext $context): void {
  25. $context->registerCapability(Capabilities::class);
  26. $context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
  27. $context->registerEventListener(BeforeLoginTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
  28. $context->registerEventListener(BeforePreferenceSetEvent::class, BeforePreferenceListener::class);
  29. $context->registerEventListener(BeforePreferenceDeletedEvent::class, BeforePreferenceListener::class);
  30. $context->registerSetupCheck(PhpImagickModule::class);
  31. }
  32. public function boot(IBootContext $context): void {
  33. }
  34. }