add links

This commit is contained in:
Simon Vieille 2020-08-11 10:40:31 +02:00
parent 5a86e16861
commit 307f69906b
Signed by: deblan
GPG key ID: 03383D15A1D31745

View file

@ -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,
];
}