diff options
author | Phie <phie@phie.ovh> | 2019-05-28 21:11:20 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-05-28 21:11:20 +0300 |
commit | f0227a7025b428cecd764dfd7f8c3e5340b84697 (patch) | |
tree | 87a6d1cd5ffcd5b36af98f7c9332d5ad691d12fd /appinfo | |
parent | dd02aec8ba77ee2aceab732ab0be3f7e90a906ab (diff) |
do not display carnet twice
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/app.php | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index c9ff51d..427bfcb 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -30,38 +30,9 @@ class Application extends App { $container->registerService('UserManager', function($c) { return $c->query('ServerContainer')->getUserManager(); }); - $this->connectWatcher($container); - - $appName = $container->query('AppName'); - $container->query('OCP\INavigationManager') - ->add( - function () use ($container, $appName) { - $urlGenerator = $container->query('OCP\IURLGenerator'); - - return [ - 'id' => $appName, - - // Sorting weight for the navigation. The higher the number, the higher - // will it be listed in the navigation - 'order' => 2, - - // The route that will be shown on startup when called from within the GUI - // Public links are using another route, see appinfo/routes.php - 'href' => $urlGenerator->linkToRoute($appName . '.page.index'), - - // The icon that will be shown in the navigation - // This file needs to exist in img/ - 'icon' => $urlGenerator->imagePath($appName, 'app.svg'), - - // The title of the application. This will be used in the - // navigation or on the settings page - 'name' => 'Carnet' - ]; - } - ); } - private function connectWatcher(IAppContainer $container) { + public function connectWatcher(IAppContainer $container) { /** @var IRootFolder $root */ $root = $container->query(IRootFolder::class); $root->listen('\OC\Files', 'postWrite', function (Node $node) use ($container) { @@ -83,5 +54,36 @@ class Application extends App { } } $app = new Application(); +$container = $app->getContainer(); + +$app->connectWatcher($container); + +$appName = $container->query('AppName'); +$container->query('OCP\INavigationManager') + ->add( + function () use ($container, $appName) { + $urlGenerator = $container->query('OCP\IURLGenerator'); + + return [ + 'id' => $appName, + + // Sorting weight for the navigation. The higher the number, the higher + // will it be listed in the navigation + 'order' => 2, + + // The route that will be shown on startup when called from within the GUI + // Public links are using another route, see appinfo/routes.php + 'href' => $urlGenerator->linkToRoute($appName . '.page.index'), + + // The icon that will be shown in the navigation + // This file needs to exist in img/ + 'icon' => $urlGenerator->imagePath($appName, 'app.svg'), + + // The title of the application. This will be used in the + // navigation or on the settings page + 'name' => 'Carnet' + ]; + } +); ?>
\ No newline at end of file |