1
0

Application.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Comments\AppInfo;
  7. use OCA\Comments\Capabilities;
  8. use OCA\Comments\Listener\CommentsEntityEventListener;
  9. use OCA\Comments\Listener\CommentsEventListener;
  10. use OCA\Comments\Listener\LoadAdditionalScripts;
  11. use OCA\Comments\Listener\LoadSidebarScripts;
  12. use OCA\Comments\MaxAutoCompleteResultsInitialState;
  13. use OCA\Comments\Notification\Notifier;
  14. use OCA\Comments\Search\CommentsSearchProvider;
  15. use OCA\Files\Event\LoadAdditionalScriptsEvent;
  16. use OCA\Files\Event\LoadSidebar;
  17. use OCP\AppFramework\App;
  18. use OCP\AppFramework\Bootstrap\IBootContext;
  19. use OCP\AppFramework\Bootstrap\IBootstrap;
  20. use OCP\AppFramework\Bootstrap\IRegistrationContext;
  21. use OCP\Comments\CommentsEntityEvent;
  22. use OCP\Comments\CommentsEvent;
  23. class Application extends App implements IBootstrap {
  24. public const APP_ID = 'comments';
  25. public function __construct(array $urlParams = []) {
  26. parent::__construct(self::APP_ID, $urlParams);
  27. }
  28. public function register(IRegistrationContext $context): void {
  29. $context->registerCapability(Capabilities::class);
  30. $context->registerEventListener(
  31. LoadAdditionalScriptsEvent::class,
  32. LoadAdditionalScripts::class
  33. );
  34. $context->registerEventListener(
  35. LoadSidebar::class,
  36. LoadSidebarScripts::class
  37. );
  38. $context->registerEventListener(
  39. CommentsEntityEvent::class,
  40. CommentsEntityEventListener::class
  41. );
  42. $context->registerEventListener(
  43. CommentsEvent::class,
  44. CommentsEventListener::class,
  45. );
  46. $context->registerSearchProvider(CommentsSearchProvider::class);
  47. $context->registerInitialStateProvider(MaxAutoCompleteResultsInitialState::class);
  48. $context->registerNotifierService(Notifier::class);
  49. }
  50. public function boot(IBootContext $context): void {
  51. }
  52. }