This commit is contained in:
Simon Vieille 2020-03-28 17:40:53 +01:00
commit 7127355812
Signed by untrusted user: deblan
GPG key ID: 03383D15A1D31745
12 changed files with 522 additions and 0 deletions

View file

@ -0,0 +1,47 @@
<?php
namespace OCA\SideMenu\Controller;
use OCP\AppFramework\Controller;
use OCP\IRequest;
use OCP\INavigationManager;
use OCP\AppFramework\Http\DataDownloadResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Http\JSONResponse;
class ApiController extends Controller
{
/**
* @var INavigationManager
*/
protected $navigationManager;
/**
* @param string $appName
* @param IRequest $request
* @param INavigationManager $navigationManager
*/
public function __construct($appName, IRequest $request, INavigationManager $navigationManager)
{
parent::__construct($appName, $request);
$this->navigationManager = $navigationManager;
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* @return JSONResponse
*/
public function apps(): JSONResponse
{
$apps = $this->navigationManager->getAll();
$data = [
'apps' => $apps,
];
return new JSONResponse($apps);
}
}