add 'supported'-label to all supported apps, also if they are not downloaded yet

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2021-09-08 23:43:17 +02:00 committed by backportbot[bot]
parent 96abf31c3b
commit ff48e1953d
2 changed files with 18 additions and 3 deletions

View file

@ -204,6 +204,7 @@ class AppSettingsController extends Controller {
}
$apps = $this->getAppsForCategory('');
$supportedApps = $appClass->getSupportedApps();
foreach ($apps as $app) {
$app['appstore'] = true;
if (!array_key_exists($app['id'], $this->allApps)) {
@ -211,6 +212,10 @@ class AppSettingsController extends Controller {
} 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

View file

@ -772,6 +772,18 @@ class OC_App {
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
*
@ -786,9 +798,7 @@ class OC_App {
$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) {