diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-05-25 14:56:54 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-06-06 11:40:09 +0200 |
commit | cd60e5b63406d4f23a8c04491cbdc57b47b972cb (patch) | |
tree | e5f5f74b3825e0421ed5d70d280a804f6a9294b4 /settings/Controller | |
parent | 923e8598b033ff1d9fc78b357e4d6390897630c4 (diff) | |
download | nextcloud-server-cd60e5b63406d4f23a8c04491cbdc57b47b972cb.tar.gz nextcloud-server-cd60e5b63406d4f23a8c04491cbdc57b47b972cb.zip |
Move logic to app management mixin
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/Controller')
-rw-r--r-- | settings/Controller/AppSettingsController.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php index ac6e5d1850d..a44a252a747 100644 --- a/settings/Controller/AppSettingsController.php +++ b/settings/Controller/AppSettingsController.php @@ -334,12 +334,12 @@ class AppSettingsController extends Controller { */ public function listApps($category = '') { $appClass = new \OC_App(); + $manager = \OC::$server->query(\OC\App\AppStore\Manager::class); switch ($category) { // installed apps case 'installed': $apps = $appClass->listAllApps(); - foreach($apps as $key => $app) { $newVersion = $this->installer->isUpdateAvailable($app['id']); $apps[$key]['update'] = $newVersion; @@ -481,6 +481,14 @@ class AppSettingsController extends Controller { return $app; }, $apps); + // Add app store dump for app to data + $apps = array_map(function($appData) use ($manager) { + $appStoreData = $manager->getApp($appData['id']); + $appData['appstoreData'] = $appStoreData; + $appData['preview'] = isset($appStoreData['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($appStoreData['screenshots'][0]['url']) : ''; + return $appData; + }, $apps); + return new JSONResponse(['apps' => $apps, 'status' => 'success']); } |