diff options
author | Olivier Paroz <github@oparoz.com> | 2015-09-03 20:03:03 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-09-03 20:03:03 +0300 |
commit | 0081580a1722a0842755ed8bf28e122f4cc26c52 (patch) | |
tree | b9e9ac86f7745b6870141f92eb2df9f69b988af2 /appinfo | |
parent | e7daae24d35c8fa1b4528b3574f24009c6bc6d1b (diff) |
Delay navigation route loading
Fix for #293
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/app.php | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index a108e0db..f80d5bb4 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -19,33 +19,37 @@ use OCP\Util; $app = new Application(); $c = $app->getContainer(); $appName = $c->query('AppName'); -$urlGenerator = $c->query('OCP\IURLGenerator'); -$l = $c->query('L10N'); /** * Menu entry in ownCloud */ -$navConfig = [ - 'id' => $appName, +$c->query('OCP\INavigationManager') + ->add( + function () use ($c, $appName) { + $urlGenerator = $c->query('OCP\IURLGenerator'); + $l10n = $c->query('OCP\IL10N'); - // Sorting weight for the navigation. The higher the number, the higher - // will it be listed in the navigation - 'order' => 3, + return [ + 'id' => $appName, - // The route that will be shown on startup when called from within ownCloud - // Public links are using another route, see appinfo/routes.php - 'href' => $urlGenerator->linkToRoute($appName . '.page.index'), + // Sorting weight for the navigation. The higher the number, the higher + // will it be listed in the navigation + 'order' => 3, - // The icon that will be shown in the navigation - // This file needs to exist in img/ - 'icon' => $urlGenerator->imagePath($appName, 'app.svg'), + // The route that will be shown on startup when called from within ownCloud + // Public links are using another route, see appinfo/routes.php + 'href' => $urlGenerator->linkToRoute($appName . '.page.index'), - // The title of the application. This will be used in the - // navigation or on the settings page - 'name' => $l->t('Gallery') -]; -$c->query('OCP\INavigationManager') - ->add($navConfig); + // 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' => $l10n->t('Gallery') + ]; + } + ); /** * Loading translations |