diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2021-09-08 23:43:17 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-10-12 11:47:33 +0000 |
commit | 1237d64bdba24efdc219a4198c5bf82289d4d668 (patch) | |
tree | a98fb65b33ba9d4b8f75e4b4ba40eb02e43e20d6 | |
parent | bb56e9df556873277fd271cd0ac876a2790054f7 (diff) | |
download | nextcloud-server-1237d64bdba24efdc219a4198c5bf82289d4d668.tar.gz nextcloud-server-1237d64bdba24efdc219a4198c5bf82289d4d668.zip |
add 'supported'-label to all supported apps, also if they are not downloaded yet
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
-rw-r--r-- | apps/settings/lib/Controller/AppSettingsController.php | 5 | ||||
-rw-r--r-- | lib/private/legacy/OC_App.php | 16 |
2 files changed, 18 insertions, 3 deletions
diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php index 4d22e90f645..059d2d99079 100644 --- a/apps/settings/lib/Controller/AppSettingsController.php +++ b/apps/settings/lib/Controller/AppSettingsController.php @@ -205,6 +205,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)) { @@ -212,6 +213,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 diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 6fecddba540..aba99ca17cc 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -777,6 +777,18 @@ class OC_App { } /** + * 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 * * @return array @@ -790,9 +802,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) { |