forked from deblan/side_menu
add base of the big menu
This commit is contained in:
parent
ddb7cc40ce
commit
8e0be738a6
14 changed files with 324 additions and 7 deletions
48
lib/Service/AppRepository.php
Normal file
48
lib/Service/AppRepository.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\SideMenu\Service;
|
||||
|
||||
use \OC_App;
|
||||
|
||||
/**
|
||||
* class AppRepository.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
class AppRepository
|
||||
{
|
||||
/**
|
||||
* @var OC_App
|
||||
*/
|
||||
protected $ocApp;
|
||||
|
||||
/**
|
||||
* @param OC_App $ocApp
|
||||
*/
|
||||
public function __construct(OC_App $ocApp)
|
||||
{
|
||||
$this->ocApp = $ocApp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves visibles apps.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getVisibleApps()
|
||||
{
|
||||
$navigation = $this->ocApp->getNavigation();
|
||||
$apps = $this->ocApp->listAllApps();
|
||||
$visibleApps = [];
|
||||
|
||||
foreach ($apps as $app) {
|
||||
$id = $app['id'];
|
||||
|
||||
if (isset($navigation[$id])) {
|
||||
$visibleApps[$id] = $app;
|
||||
}
|
||||
}
|
||||
|
||||
return $visibleApps;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue