1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-02 02:52:10 +01:00

Merge pull request #198 from owncloud/closure-for-navigation

Do not load routes when not needed
This commit is contained in:
blizzz 2015-11-05 18:07:42 +01:00
commit a154287116

View File

@ -15,20 +15,15 @@
namespace OCA\Bookmarks\AppInfo; namespace OCA\Bookmarks\AppInfo;
\OCP\App::addNavigationEntry(array( $navigationEntry = function () {
// the string under which your app will be referenced in owncloud return [
'id' => 'bookmarks', 'id' => 'bookmarks',
// sorting weight for the navigation. The higher the number, the higher
// will it be listed in the navigation
'order' => 10, 'order' => 10,
// the route that will be shown on startup 'name' => \OC::$server->getL10N('bookmarks')->t('Bookmarks'),
'href' => \OCP\Util::linkToRoute('bookmarks.web_view.index'), 'href' => \OC::$server->getURLGenerator()->linkToRoute('bookmarks.web_view.index'),
// the icon that will be shown in the navigation 'icon' => \OC::$server->getURLGenerator()->imagePath('bookmarks', 'bookmarks.svg'),
// this file needs to exist in img/ ];
'icon' => \OCP\Util::imagePath('bookmarks', 'bookmarks.svg'), };
// the title of your application. This will be used in the \OC::$server->getNavigationManager()->add($navigationEntry);
// navigation or on the settings page of your app
'name' => \OC_L10N::get('bookmarks')->t('Bookmarks')
));
\OC::$server->getSearch()->registerProvider('OCA\Bookmarks\Controller\Lib\Search', array('apps' => array('bookmarks'))); \OC::$server->getSearch()->registerProvider('OCA\Bookmarks\Controller\Lib\Search', array('apps' => array('bookmarks')));