aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-13 11:08:38 +0200
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-04-13 11:08:38 +0200
commit4856d95135409aae924ece49c76e8c08a29ac221 (patch)
tree8d4181eff7fdb70620696f0a89b341124881a372 /settings
parent739542816a052e141a02977b88b54ba0613cc211 (diff)
parent7365bd798a30b8ac584080532bf97970a34bb6c3 (diff)
downloadnextcloud-server-4856d95135409aae924ece49c76e8c08a29ac221.tar.gz
nextcloud-server-4856d95135409aae924ece49c76e8c08a29ac221.zip
Merge pull request #23921 from owncloud/show-app-download-tooltip
Show tooltip if the app is downloaded from a remote server
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/AppSettingsController.php25
-rw-r--r--settings/js/apps.js2
-rw-r--r--settings/templates/apps.php2
3 files changed, 28 insertions, 1 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;
+ }
+
}
diff --git a/settings/js/apps.js b/settings/js/apps.js
index e052a9ee9d3..1b687012815 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -119,6 +119,8 @@ OC.Settings.Apps = OC.Settings.Apps || {
$('#apps-list-empty').removeClass('hidden').find('h2').text(t('settings', 'No apps found for your version'));
}
+ $('.enable.needs-download').tipsy({fallback: t('settings', 'The app will be downloaded from the app store')});
+
$('.app-level .official').tipsy({fallback: t('settings', 'Official apps are developed by and within the ownCloud community. They offer functionality central to ownCloud and are ready for production use.')});
$('.app-level .approved').tipsy({fallback: t('settings', 'Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use.')});
$('.app-level .experimental').tipsy({fallback: t('settings', 'This app is not checked for security issues and is new or known to be unstable. Install at your own risk.')});
diff --git a/settings/templates/apps.php b/settings/templates/apps.php
index 47d1eff463e..ce6dcef842c 100644
--- a/settings/templates/apps.php
+++ b/settings/templates/apps.php
@@ -134,7 +134,7 @@ script(
<br />
<input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
{{else}}
- <input class="enable" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
+ <input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/>
{{/if}}
{{#if canUnInstall}}
<input class="uninstall" type="submit" value="<?php p($l->t('Uninstall App')); ?>" data-appid="{{id}}" />