diff --git a/lib/Controller/NavController.php b/lib/Controller/NavController.php index ba8da4b..b89baad 100644 --- a/lib/Controller/NavController.php +++ b/lib/Controller/NavController.php @@ -18,14 +18,15 @@ namespace OCA\SideMenu\Controller; +use OC\App\AppStore\Fetcher\CategoryFetcher; use OCA\SideMenu\Service\AppRepository; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; -use OC\App\AppStore\Fetcher\CategoryFetcher; use OCP\L10N\IFactory; +use OC\URLGenerator; class NavController extends Controller { @@ -54,6 +55,11 @@ class NavController extends Controller */ protected $categoryFetcher; + /** + * @var URLGenerator + */ + protected $router; + /** * @param string $appName */ @@ -62,16 +68,18 @@ class NavController extends Controller IRequest $request, IConfig $config, AppRepository $appRepository, - CategoryFetcher $categoryFetcher, - IFactory $l10nFactory, + CategoryFetcher $categoryFetcher, + URLGenerator $router, + IFactory $l10nFactory, IL10N $trans) { parent::__construct($appName, $request); $this->config = $config; $this->appRepository = $appRepository; - $this->categoryFetcher = $categoryFetcher; - $this->l10nFactory = $l10nFactory; + $this->categoryFetcher = $categoryFetcher; + $this->l10nFactory = $l10nFactory; + $this->router = $router; $this->trans = $trans; } @@ -108,7 +116,7 @@ class NavController extends Controller $items[$category]['apps'][$app['id']] = [ 'name' => $app['name'], - 'href' => '#', + 'href' => $this->router->linkTo($app['id'], ''), 'icon' => $app['previewAsIcon'] ? $app['preview'] : null, ]; }