Show tooltip if the app is downloaded from a remote server
fixes #14405
This commit is contained in:
parent
8e16e7bf34
commit
7365bd798a
|
@ -259,6 +259,12 @@ class AppSettingsController extends Controller {
|
||||||
$apps = array_filter($apps, function ($app) use ($installedApps) {
|
$apps = array_filter($apps, function ($app) use ($installedApps) {
|
||||||
return !in_array($app['id'], $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
|
// sort by score
|
||||||
|
@ -319,4 +325,23 @@ class AppSettingsController extends Controller {
|
||||||
});
|
});
|
||||||
return $apps;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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'));
|
$('#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 .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 .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.')});
|
$('.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.')});
|
||||||
|
|
|
@ -134,7 +134,7 @@ script(
|
||||||
<br />
|
<br />
|
||||||
<input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
|
<input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px">
|
||||||
{{else}}
|
{{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}}
|
||||||
{{#if canUnInstall}}
|
{{#if canUnInstall}}
|
||||||
<input class="uninstall" type="submit" value="<?php p($l->t('Uninstall App')); ?>" data-appid="{{id}}" />
|
<input class="uninstall" type="submit" value="<?php p($l->t('Uninstall App')); ?>" data-appid="{{id}}" />
|
||||||
|
|
Loading…
Reference in New Issue