@@ -43,56 +43,56 @@ |
||
| 43 | 43 | use OCP\Util; |
| 44 | 44 | |
| 45 | 45 | class Application extends App { |
| 46 | - public const APP_ID = 'comments'; |
|
| 46 | + public const APP_ID = 'comments'; |
|
| 47 | 47 | |
| 48 | - public function __construct(array $urlParams = []) { |
|
| 49 | - parent::__construct(self::APP_ID, $urlParams); |
|
| 50 | - $container = $this->getContainer(); |
|
| 48 | + public function __construct(array $urlParams = []) { |
|
| 49 | + parent::__construct(self::APP_ID, $urlParams); |
|
| 50 | + $container = $this->getContainer(); |
|
| 51 | 51 | |
| 52 | - $container->registerAlias('NotificationsController', Notifications::class); |
|
| 52 | + $container->registerAlias('NotificationsController', Notifications::class); |
|
| 53 | 53 | |
| 54 | - $jsSettingsHelper = new JSSettingsHelper($container->getServer()); |
|
| 55 | - Util::connectHook('\OCP\Config', 'js', $jsSettingsHelper, 'extend'); |
|
| 54 | + $jsSettingsHelper = new JSSettingsHelper($container->getServer()); |
|
| 55 | + Util::connectHook('\OCP\Config', 'js', $jsSettingsHelper, 'extend'); |
|
| 56 | 56 | |
| 57 | - $this->register(); |
|
| 58 | - } |
|
| 57 | + $this->register(); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - private function register() { |
|
| 61 | - $server = $this->getContainer()->getServer(); |
|
| 60 | + private function register() { |
|
| 61 | + $server = $this->getContainer()->getServer(); |
|
| 62 | 62 | |
| 63 | - /** @var IEventDispatcher $newDispatcher */ |
|
| 64 | - $dispatcher = $server->query(IEventDispatcher::class); |
|
| 63 | + /** @var IEventDispatcher $newDispatcher */ |
|
| 64 | + $dispatcher = $server->query(IEventDispatcher::class); |
|
| 65 | 65 | |
| 66 | - $this->registerEventsScripts($dispatcher); |
|
| 67 | - $this->registerDavEntity($dispatcher); |
|
| 68 | - $this->registerNotifier(); |
|
| 69 | - $this->registerCommentsEventHandler(); |
|
| 66 | + $this->registerEventsScripts($dispatcher); |
|
| 67 | + $this->registerDavEntity($dispatcher); |
|
| 68 | + $this->registerNotifier(); |
|
| 69 | + $this->registerCommentsEventHandler(); |
|
| 70 | 70 | |
| 71 | - $this->getContainer()->registerCapability(Capabilities::class); |
|
| 72 | - $server->getSearch()->registerProvider(Provider::class, ['apps' => ['files']]); |
|
| 73 | - } |
|
| 71 | + $this->getContainer()->registerCapability(Capabilities::class); |
|
| 72 | + $server->getSearch()->registerProvider(Provider::class, ['apps' => ['files']]); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - protected function registerEventsScripts(IEventDispatcher $dispatcher) { |
|
| 76 | - $dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class); |
|
| 77 | - $dispatcher->addServiceListener(LoadSidebar::class, LoadSidebarScripts::class); |
|
| 78 | - } |
|
| 75 | + protected function registerEventsScripts(IEventDispatcher $dispatcher) { |
|
| 76 | + $dispatcher->addServiceListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScripts::class); |
|
| 77 | + $dispatcher->addServiceListener(LoadSidebar::class, LoadSidebarScripts::class); |
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - protected function registerDavEntity(IEventDispatcher $dispatcher) { |
|
| 81 | - $dispatcher->addListener(CommentsEntityEvent::EVENT_ENTITY, function (CommentsEntityEvent $event) { |
|
| 82 | - $event->addEntityCollection('files', function ($name) { |
|
| 83 | - $nodes = \OC::$server->getUserFolder()->getById((int)$name); |
|
| 84 | - return !empty($nodes); |
|
| 85 | - }); |
|
| 86 | - }); |
|
| 87 | - } |
|
| 80 | + protected function registerDavEntity(IEventDispatcher $dispatcher) { |
|
| 81 | + $dispatcher->addListener(CommentsEntityEvent::EVENT_ENTITY, function (CommentsEntityEvent $event) { |
|
| 82 | + $event->addEntityCollection('files', function ($name) { |
|
| 83 | + $nodes = \OC::$server->getUserFolder()->getById((int)$name); |
|
| 84 | + return !empty($nodes); |
|
| 85 | + }); |
|
| 86 | + }); |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - protected function registerNotifier() { |
|
| 90 | - $this->getContainer()->getServer()->getNotificationManager()->registerNotifierService(Notifier::class); |
|
| 91 | - } |
|
| 89 | + protected function registerNotifier() { |
|
| 90 | + $this->getContainer()->getServer()->getNotificationManager()->registerNotifierService(Notifier::class); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - protected function registerCommentsEventHandler() { |
|
| 94 | - $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () { |
|
| 95 | - return $this->getContainer()->query(EventHandler::class); |
|
| 96 | - }); |
|
| 97 | - } |
|
| 93 | + protected function registerCommentsEventHandler() { |
|
| 94 | + $this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () { |
|
| 95 | + return $this->getContainer()->query(EventHandler::class); |
|
| 96 | + }); |
|
| 97 | + } |
|
| 98 | 98 | } |
@@ -26,11 +26,11 @@ |
||
| 26 | 26 | use OCP\Capabilities\ICapability; |
| 27 | 27 | |
| 28 | 28 | class Capabilities implements ICapability { |
| 29 | - public function getCapabilities(): array { |
|
| 30 | - return [ |
|
| 31 | - 'files' => [ |
|
| 32 | - 'comments' => true, |
|
| 33 | - ] |
|
| 34 | - ]; |
|
| 35 | - } |
|
| 29 | + public function getCapabilities(): array { |
|
| 30 | + return [ |
|
| 31 | + 'files' => [ |
|
| 32 | + 'comments' => true, |
|
| 33 | + ] |
|
| 34 | + ]; |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -6,42 +6,42 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInitComments |
| 8 | 8 | { |
| 9 | - public static $prefixLengthsPsr4 = array ( |
|
| 9 | + public static $prefixLengthsPsr4 = array( |
|
| 10 | 10 | 'O' => |
| 11 | - array ( |
|
| 11 | + array( |
|
| 12 | 12 | 'OCA\\Comments\\' => 13, |
| 13 | 13 | ), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | - public static $prefixDirsPsr4 = array ( |
|
| 16 | + public static $prefixDirsPsr4 = array( |
|
| 17 | 17 | 'OCA\\Comments\\' => |
| 18 | - array ( |
|
| 19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
| 18 | + array( |
|
| 19 | + 0 => __DIR__.'/..'.'/../lib', |
|
| 20 | 20 | ), |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | - public static $classMap = array ( |
|
| 24 | - 'OCA\\Comments\\Activity\\Filter' => __DIR__ . '/..' . '/../lib/Activity/Filter.php', |
|
| 25 | - 'OCA\\Comments\\Activity\\Listener' => __DIR__ . '/..' . '/../lib/Activity/Listener.php', |
|
| 26 | - 'OCA\\Comments\\Activity\\Provider' => __DIR__ . '/..' . '/../lib/Activity/Provider.php', |
|
| 27 | - 'OCA\\Comments\\Activity\\Setting' => __DIR__ . '/..' . '/../lib/Activity/Setting.php', |
|
| 28 | - 'OCA\\Comments\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
| 29 | - 'OCA\\Comments\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php', |
|
| 30 | - 'OCA\\Comments\\Collaboration\\CommentersSorter' => __DIR__ . '/..' . '/../lib/Collaboration/CommentersSorter.php', |
|
| 31 | - 'OCA\\Comments\\Controller\\Notifications' => __DIR__ . '/..' . '/../lib/Controller/Notifications.php', |
|
| 32 | - 'OCA\\Comments\\EventHandler' => __DIR__ . '/..' . '/../lib/EventHandler.php', |
|
| 33 | - 'OCA\\Comments\\JSSettingsHelper' => __DIR__ . '/..' . '/../lib/JSSettingsHelper.php', |
|
| 34 | - 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalScripts.php', |
|
| 35 | - 'OCA\\Comments\\Listener\\LoadSidebarScripts' => __DIR__ . '/..' . '/../lib/Listener/LoadSidebarScripts.php', |
|
| 36 | - 'OCA\\Comments\\Notification\\Listener' => __DIR__ . '/..' . '/../lib/Notification/Listener.php', |
|
| 37 | - 'OCA\\Comments\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
| 38 | - 'OCA\\Comments\\Search\\Provider' => __DIR__ . '/..' . '/../lib/Search/Provider.php', |
|
| 39 | - 'OCA\\Comments\\Search\\Result' => __DIR__ . '/..' . '/../lib/Search/Result.php', |
|
| 23 | + public static $classMap = array( |
|
| 24 | + 'OCA\\Comments\\Activity\\Filter' => __DIR__.'/..'.'/../lib/Activity/Filter.php', |
|
| 25 | + 'OCA\\Comments\\Activity\\Listener' => __DIR__.'/..'.'/../lib/Activity/Listener.php', |
|
| 26 | + 'OCA\\Comments\\Activity\\Provider' => __DIR__.'/..'.'/../lib/Activity/Provider.php', |
|
| 27 | + 'OCA\\Comments\\Activity\\Setting' => __DIR__.'/..'.'/../lib/Activity/Setting.php', |
|
| 28 | + 'OCA\\Comments\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
| 29 | + 'OCA\\Comments\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php', |
|
| 30 | + 'OCA\\Comments\\Collaboration\\CommentersSorter' => __DIR__.'/..'.'/../lib/Collaboration/CommentersSorter.php', |
|
| 31 | + 'OCA\\Comments\\Controller\\Notifications' => __DIR__.'/..'.'/../lib/Controller/Notifications.php', |
|
| 32 | + 'OCA\\Comments\\EventHandler' => __DIR__.'/..'.'/../lib/EventHandler.php', |
|
| 33 | + 'OCA\\Comments\\JSSettingsHelper' => __DIR__.'/..'.'/../lib/JSSettingsHelper.php', |
|
| 34 | + 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => __DIR__.'/..'.'/../lib/Listener/LoadAdditionalScripts.php', |
|
| 35 | + 'OCA\\Comments\\Listener\\LoadSidebarScripts' => __DIR__.'/..'.'/../lib/Listener/LoadSidebarScripts.php', |
|
| 36 | + 'OCA\\Comments\\Notification\\Listener' => __DIR__.'/..'.'/../lib/Notification/Listener.php', |
|
| 37 | + 'OCA\\Comments\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
| 38 | + 'OCA\\Comments\\Search\\Provider' => __DIR__.'/..'.'/../lib/Search/Provider.php', |
|
| 39 | + 'OCA\\Comments\\Search\\Result' => __DIR__.'/..'.'/../lib/Search/Result.php', |
|
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | 42 | public static function getInitializer(ClassLoader $loader) |
| 43 | 43 | { |
| 44 | - return \Closure::bind(function () use ($loader) { |
|
| 44 | + return \Closure::bind(function() use ($loader) { |
|
| 45 | 45 | $loader->prefixLengthsPsr4 = ComposerStaticInitComments::$prefixLengthsPsr4; |
| 46 | 46 | $loader->prefixDirsPsr4 = ComposerStaticInitComments::$prefixDirsPsr4; |
| 47 | 47 | $loader->classMap = ComposerStaticInitComments::$classMap; |
@@ -6,20 +6,20 @@ |
||
| 6 | 6 | $baseDir = $vendorDir; |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'OCA\\Comments\\Activity\\Filter' => $baseDir . '/../lib/Activity/Filter.php', |
|
| 10 | - 'OCA\\Comments\\Activity\\Listener' => $baseDir . '/../lib/Activity/Listener.php', |
|
| 11 | - 'OCA\\Comments\\Activity\\Provider' => $baseDir . '/../lib/Activity/Provider.php', |
|
| 12 | - 'OCA\\Comments\\Activity\\Setting' => $baseDir . '/../lib/Activity/Setting.php', |
|
| 13 | - 'OCA\\Comments\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
| 14 | - 'OCA\\Comments\\Capabilities' => $baseDir . '/../lib/Capabilities.php', |
|
| 15 | - 'OCA\\Comments\\Collaboration\\CommentersSorter' => $baseDir . '/../lib/Collaboration/CommentersSorter.php', |
|
| 16 | - 'OCA\\Comments\\Controller\\Notifications' => $baseDir . '/../lib/Controller/Notifications.php', |
|
| 17 | - 'OCA\\Comments\\EventHandler' => $baseDir . '/../lib/EventHandler.php', |
|
| 18 | - 'OCA\\Comments\\JSSettingsHelper' => $baseDir . '/../lib/JSSettingsHelper.php', |
|
| 19 | - 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir . '/../lib/Listener/LoadAdditionalScripts.php', |
|
| 20 | - 'OCA\\Comments\\Listener\\LoadSidebarScripts' => $baseDir . '/../lib/Listener/LoadSidebarScripts.php', |
|
| 21 | - 'OCA\\Comments\\Notification\\Listener' => $baseDir . '/../lib/Notification/Listener.php', |
|
| 22 | - 'OCA\\Comments\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
| 23 | - 'OCA\\Comments\\Search\\Provider' => $baseDir . '/../lib/Search/Provider.php', |
|
| 24 | - 'OCA\\Comments\\Search\\Result' => $baseDir . '/../lib/Search/Result.php', |
|
| 9 | + 'OCA\\Comments\\Activity\\Filter' => $baseDir.'/../lib/Activity/Filter.php', |
|
| 10 | + 'OCA\\Comments\\Activity\\Listener' => $baseDir.'/../lib/Activity/Listener.php', |
|
| 11 | + 'OCA\\Comments\\Activity\\Provider' => $baseDir.'/../lib/Activity/Provider.php', |
|
| 12 | + 'OCA\\Comments\\Activity\\Setting' => $baseDir.'/../lib/Activity/Setting.php', |
|
| 13 | + 'OCA\\Comments\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
| 14 | + 'OCA\\Comments\\Capabilities' => $baseDir.'/../lib/Capabilities.php', |
|
| 15 | + 'OCA\\Comments\\Collaboration\\CommentersSorter' => $baseDir.'/../lib/Collaboration/CommentersSorter.php', |
|
| 16 | + 'OCA\\Comments\\Controller\\Notifications' => $baseDir.'/../lib/Controller/Notifications.php', |
|
| 17 | + 'OCA\\Comments\\EventHandler' => $baseDir.'/../lib/EventHandler.php', |
|
| 18 | + 'OCA\\Comments\\JSSettingsHelper' => $baseDir.'/../lib/JSSettingsHelper.php', |
|
| 19 | + 'OCA\\Comments\\Listener\\LoadAdditionalScripts' => $baseDir.'/../lib/Listener/LoadAdditionalScripts.php', |
|
| 20 | + 'OCA\\Comments\\Listener\\LoadSidebarScripts' => $baseDir.'/../lib/Listener/LoadSidebarScripts.php', |
|
| 21 | + 'OCA\\Comments\\Notification\\Listener' => $baseDir.'/../lib/Notification/Listener.php', |
|
| 22 | + 'OCA\\Comments\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
| 23 | + 'OCA\\Comments\\Search\\Provider' => $baseDir.'/../lib/Search/Provider.php', |
|
| 24 | + 'OCA\\Comments\\Search\\Result' => $baseDir.'/../lib/Search/Result.php', |
|
| 25 | 25 | ); |