diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-06-10 12:01:54 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-06-10 12:11:05 +0200 |
commit | 580155abe716dd9fb385823819c473313c4e3dd1 (patch) | |
tree | 9fd49a97b5c0b64e0b37b5dbc6a95715fbf0d8d6 /settings/controller | |
parent | 4d88302b3adba16e99899d31e4e04ae48aa067d8 (diff) | |
download | nextcloud-server-580155abe716dd9fb385823819c473313c4e3dd1.tar.gz nextcloud-server-580155abe716dd9fb385823819c473313c4e3dd1.zip |
Load the update information asyncroniously to fix the page load speed
Diffstat (limited to 'settings/controller')
-rw-r--r-- | settings/controller/appsettingscontroller.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/settings/controller/appsettingscontroller.php b/settings/controller/appsettingscontroller.php index f1b62bb1d38..a98d297a122 100644 --- a/settings/controller/appsettingscontroller.php +++ b/settings/controller/appsettingscontroller.php @@ -147,16 +147,18 @@ class AppSettingsController extends Controller { * Get all available apps in a category * * @param int $category + * @param bool $includeUpdateInfo Should we check whether there is an update + * in the app store? * @return array */ - public function listApps($category = 0) { + public function listApps($category = 0, $includeUpdateInfo = true) { if(!is_null($this->cache->get('listApps-'.$category))) { $apps = $this->cache->get('listApps-'.$category); } else { switch ($category) { // installed apps case 0: - $apps = $this->getInstalledApps(); + $apps = $this->getInstalledApps($includeUpdateInfo); usort($apps, function ($a, $b) { $a = (string)$a['name']; $b = (string)$b['name']; @@ -168,7 +170,7 @@ class AppSettingsController extends Controller { break; // not-installed apps case 1: - $apps = \OC_App::listAllApps(true); + $apps = \OC_App::listAllApps(true, $includeUpdateInfo); $apps = array_filter($apps, function ($app) { return !$app['active']; }); @@ -189,7 +191,7 @@ class AppSettingsController extends Controller { $apps = array(); } else { // don't list installed apps - $installedApps = $this->getInstalledApps(); + $installedApps = $this->getInstalledApps(false); $installedApps = array_map(function ($app) { if (isset($app['ocsid'])) { return $app['ocsid']; @@ -245,10 +247,12 @@ class AppSettingsController extends Controller { } /** + * @param bool $includeUpdateInfo Should we check whether there is an update + * in the app store? * @return array */ - private function getInstalledApps() { - $apps = \OC_App::listAllApps(true); + private function getInstalledApps($includeUpdateInfo = true) { + $apps = \OC_App::listAllApps(true, $includeUpdateInfo); $apps = array_filter($apps, function ($app) { return $app['active']; }); |