forked from deblan/side_menu
retrieve tables apps
This commit is contained in:
parent
38f400b24c
commit
05c35b9a63
1 changed files with 24 additions and 35 deletions
|
|
@ -5,6 +5,11 @@ namespace OCA\SideMenu\Service;
|
|||
use OC\User\User;
|
||||
use OCP\INavigationManager;
|
||||
use OCP\L10N\IFactory;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
|
||||
use OCP\IUserSession;
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCA\SideMenu\AppInfo\Application;
|
||||
|
||||
/**
|
||||
* class AppRepository.
|
||||
|
|
@ -13,43 +18,19 @@ use OCP\L10N\IFactory;
|
|||
*/
|
||||
class AppRepository
|
||||
{
|
||||
/**
|
||||
* @var \OC_App
|
||||
*/
|
||||
protected $ocApp;
|
||||
|
||||
/**
|
||||
* @var IFactory
|
||||
*/
|
||||
protected $l10nFactory;
|
||||
|
||||
/**
|
||||
* @var ConfigProxy
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var CategoryRepository
|
||||
*/
|
||||
protected $categoryRepository;
|
||||
|
||||
/**
|
||||
* @var INavigationManager
|
||||
*/
|
||||
protected $navigationManager;
|
||||
|
||||
public function __construct(
|
||||
\OC_App $ocApp,
|
||||
INavigationManager $navigationManager,
|
||||
IFactory $l10nFactory,
|
||||
ConfigProxy $config,
|
||||
CategoryRepository $categoryRepository
|
||||
protected \OC_App $ocApp,
|
||||
protected INavigationManager $navigationManager,
|
||||
protected IFactory $l10nFactory,
|
||||
protected ConfigProxy $config,
|
||||
protected CategoryRepository $categoryRepository,
|
||||
protected IEventDispatcher $dispatcher,
|
||||
protected IUserSession $userSession,
|
||||
) {
|
||||
$this->ocApp = $ocApp;
|
||||
$this->l10nFactory = $l10nFactory;
|
||||
$this->config = $config;
|
||||
$this->navigationManager = $navigationManager;
|
||||
$this->categoryRepository = $categoryRepository;
|
||||
$this->dispatcher->dispatchTyped(new BeforeTemplateRenderedEvent(
|
||||
$this->userSession->isLoggedIn(),
|
||||
new TemplateResponse(Application::APP_NAME, '')
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -90,6 +71,14 @@ class AppRepository
|
|||
'external_links',
|
||||
],
|
||||
];
|
||||
} elseif ('tables_application' === substr($app['id'], 0, 18)) {
|
||||
$visibleApps[$app['id']] = [
|
||||
'id' => $app['id'],
|
||||
'name' => $this->getAppName($app),
|
||||
'href' => $app['href'],
|
||||
'icon' => $app['icon'],
|
||||
'category' => [],
|
||||
];
|
||||
} elseif ('files' === $app['id']) {
|
||||
$visibleApps[$app['id']] = [
|
||||
'id' => $app['id'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue