Skip to content

Commit 664bd58

Browse files
committed
add 'supported'-label to all supported apps, also if they are not downloaded yet
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
1 parent 9a569ff commit 664bd58

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

apps/settings/lib/Controller/AppSettingsController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,18 @@ private function fetchApps() {
204204
}
205205

206206
$apps = $this->getAppsForCategory('');
207+
$supportedApps = $appClass->getSupportedApps();
207208
foreach ($apps as $app) {
208209
$app['appstore'] = true;
209210
if (!array_key_exists($app['id'], $this->allApps)) {
210211
$this->allApps[$app['id']] = $app;
211212
} else {
212213
$this->allApps[$app['id']] = array_merge($app, $this->allApps[$app['id']]);
213214
}
215+
216+
if (in_array($app['id'], $supportedApps)) {
217+
$this->allApps[$app['id']]['level'] = \OC_App::supportedApp;
218+
}
214219
}
215220

216221
// add bundle information

lib/private/legacy/OC_App.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,18 @@ public static function getAllApps(): array {
773773
return $apps;
774774
}
775775

776+
/**
777+
* List all supported apps
778+
*
779+
* @return array
780+
*/
781+
public function getSupportedApps(): array {
782+
/** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
783+
$subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
784+
$supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
785+
return $supportedApps;
786+
}
787+
776788
/**
777789
* List all apps, this is used in apps.php
778790
*
@@ -787,9 +799,7 @@ public function listAllApps(): array {
787799
$appList = [];
788800
$langCode = \OC::$server->getL10N('core')->getLanguageCode();
789801
$urlGenerator = \OC::$server->getURLGenerator();
790-
/** @var \OCP\Support\Subscription\IRegistry $subscriptionRegistry */
791-
$subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class);
792-
$supportedApps = $subscriptionRegistry->delegateGetSupportedApps();
802+
$supportedApps = $this->getSupportedApps();
793803

794804
foreach ($installedApps as $app) {
795805
if (array_search($app, $blacklist) === false) {

0 commit comments

Comments
 (0)