Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-09-03 20:03:03 +0300
committerOlivier Paroz <github@oparoz.com>2015-09-03 20:03:03 +0300
commit0081580a1722a0842755ed8bf28e122f4cc26c52 (patch)
treeb9e9ac86f7745b6870141f92eb2df9f69b988af2 /appinfo
parente7daae24d35c8fa1b4528b3574f24009c6bc6d1b (diff)
Delay navigation route loading
Fix for #293
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/app.php42
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