Skip to content

Commit

Permalink
Merge pull request #29028 from nextcloud/add-supported-label-to-all-apps
Browse files Browse the repository at this point in the history
add 'supported'-label to all supported apps
  • Loading branch information
schiessle authored Oct 12, 2021
2 parents 0d2972c + 664bd58 commit da1b97d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions apps/settings/lib/Controller/AppSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,18 @@ private function fetchApps() {
}

$apps = $this->getAppsForCategory('');
$supportedApps = $appClass->getSupportedApps();
foreach ($apps as $app) {
$app['appstore'] = true;
if (!array_key_exists($app['id'], $this->allApps)) {
$this->allApps[$app['id']] = $app;
} else {
$this->allApps[$app['id']] = array_merge($app, $this->allApps[$app['id']]);
}

if (in_array($app['id'], $supportedApps)) {
$this->allApps[$app['id']]['level'] = \OC_App::supportedApp;
}
}

// add bundle information
Expand Down
16 changes: 13 additions & 3 deletions lib/private/legacy/OC_App.php
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,18 @@ public static function getAllApps(): array {
return $apps;
}

/**
* List all supported apps
*
* @return array
*/
public function getSupportedApps(): array {
/** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
$subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
$supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
return $supportedApps;
}

/**
* List all apps, this is used in apps.php
*
Expand All @@ -787,9 +799,7 @@ public function listAllApps(): array {
$appList = [];
$langCode = \OC::$server->getL10N('core')->getLanguageCode();
$urlGenerator = \OC::$server->getURLGenerator();
/** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
$subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
$supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
$supportedApps = $this->getSupportedApps();

foreach ($installedApps as $app) {
if (array_search($app, $blacklist) === false) {
Expand Down

0 comments on commit da1b97d

Please sign in to comment.