Use a closure for the navigation entry, to speed up webdav and ajax calls

This commit is contained in:
Joas Schilling 2015-03-16 16:51:12 +01:00
Родитель 5e17666652
Коммит a20052a397
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -27,13 +27,15 @@ $app = new Application();
$c = $app->getContainer();
// add an navigation entry
$navigationEntry = array(
'id' => $c->getAppName(),
'order' => 1,
'name' => $c->query('ActivityL10N')->t('Activity'),
'href' => $c->query('URLGenerator')->linkToRoute('activity.Activities.showList'),
'icon' => $c->query('URLGenerator')->imagePath('activity', 'activity.svg'),
);
$navigationEntry = function () use ($c) {
return [
'id' => $c->getAppName(),
'order' => 1,
'name' => $c->query('ActivityL10N')->t('Activity'),
'href' => $c->query('URLGenerator')->linkToRoute('activity.Activities.showList'),
'icon' => $c->query('URLGenerator')->imagePath('activity', 'activity.svg'),
];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
// register the hooks for filesystem operations. All other events from other apps has to be send via the public api