diff options
Diffstat (limited to 'apps/comments/lib/AppInfo/Application.php')
-rw-r--r-- | apps/comments/lib/AppInfo/Application.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php index 793d1e9f7be..e2f79c96381 100644 --- a/apps/comments/lib/AppInfo/Application.php +++ b/apps/comments/lib/AppInfo/Application.php @@ -1,8 +1,9 @@ <?php /** - * + * @copyright Copyright (c) 2016, Arthur Schiwon <blizzz@arthur-schiwon.de> * * @author Arthur Schiwon <blizzz@arthur-schiwon.de> + * @author John Molakvoæ <skjnldsv@protonmail.com> * * @license GNU AGPL version 3 or any later version * @@ -27,33 +28,39 @@ use OCA\Comments\Controller\Notifications; use OCA\Comments\EventHandler; use OCA\Comments\JSSettingsHelper; use OCA\Comments\Listener\LoadAdditionalScripts; +use OCA\Comments\Listener\LoadSidebarScripts; use OCA\Comments\Notification\Notifier; use OCA\Comments\Search\Provider; use OCA\Files\Event\LoadAdditionalScriptsEvent; +use OCA\Files\Event\LoadSidebar; use OCP\AppFramework\App; use OCP\Comments\CommentsEntityEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Util; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Application extends App { + const APP_ID = 'comments'; + public function __construct (array $urlParams = array()) { - parent::__construct('comments', $urlParams); + parent::__construct(self::APP_ID, $urlParams); $container = $this->getContainer(); $container->registerAlias('NotificationsController', Notifications::class); $jsSettingsHelper = new JSSettingsHelper($container->getServer()); Util::connectHook('\OCP\Config', 'js', $jsSettingsHelper, 'extend'); + + $this->register(); } - public function register() { + private function register() { $server = $this->getContainer()->getServer(); /** @var IEventDispatcher $newDispatcher */ $dispatcher = $server->query(IEventDispatcher::class); - $this->registerSidebarScripts($dispatcher); + + $this->registerEventsScripts($dispatcher); $this->registerDavEntity($dispatcher); $this->registerNotifier(); $this->registerCommentsEventHandler(); @@ -61,8 +68,9 @@ class Application extends App { $server->getSearch()->registerProvider(Provider::class, ['apps' => ['files']]); } - protected function registerSidebarScripts(IEventDispatcher $dispatcher) { + protected function registerEventsScripts(IEventDispatcher $dispatcher) { $dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class); + $dispatcher->addServiceListener(LoadSidebar::class, LoadSidebarScripts::class); } protected function registerDavEntity(IEventDispatcher $dispatcher) { |