summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-04-11 16:48:07 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2016-04-12 09:39:53 +0200
commit7365bd798a30b8ac584080532bf97970a34bb6c3 (patch)
tree1c8211f07c5a76c8fbd0e266a2f89650426aedd2 /settings/Controller
parent8e16e7bf34efb1bd7d97ee500ffe860d94fa55eb (diff)
downloadnextcloud-server-7365bd798a30b8ac584080532bf97970a34bb6c3.tar.gz
nextcloud-server-7365bd798a30b8ac584080532bf97970a34bb6c3.zip
Show tooltip if the app is downloaded from a remote server
fixes #14405
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/AppSettingsController.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php
index cc69d3130d9..6c86cbf2cd3 100644
--- a/settings/Controller/AppSettingsController.php
+++ b/settings/Controller/AppSettingsController.php
@@ -259,6 +259,12 @@ class AppSettingsController extends Controller {
$apps = array_filter($apps, function ($app) use ($installedApps) {
return !in_array($app['id'], $installedApps);
});
+
+ // show tooltip if app is downloaded from remote server
+ $inactiveApps = $this->getInactiveApps();
+ foreach ($apps as &$app) {
+ $app['needsDownload'] = !in_array($app['id'], $inactiveApps);
+ }
}
// sort by score
@@ -319,4 +325,23 @@ class AppSettingsController extends Controller {
});
return $apps;
}
+
+ /**
+ * @return array
+ */
+ private function getInactiveApps() {
+ $inactiveApps = \OC_App::listAllApps(true, false, $this->ocsClient);
+ $inactiveApps = array_filter($inactiveApps,
+ function ($app) {
+ return !$app['active'];
+ });
+ $inactiveApps = array_map(function($app) {
+ if (isset($app['ocsid'])) {
+ return $app['ocsid'];
+ }
+ return $app['id'];
+ }, $inactiveApps);
+ return $inactiveApps;
+ }
+
}