summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-04-23 22:10:17 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-04-26 20:07:49 +0200
commit47cd9760350baaf24bdf92c7a77129e59ec2f8f3 (patch)
treec7e81c5440588267a6a275dbd661b07b3363dea8 /settings/Controller
parent646db7f88d911459bdfa038d8a66ded27ae888a4 (diff)
downloadnextcloud-server-47cd9760350baaf24bdf92c7a77129e59ec2f8f3.tar.gz
nextcloud-server-47cd9760350baaf24bdf92c7a77129e59ec2f8f3.zip
Add app bundles
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/AppSettingsController.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php
index 7be6c2bf562..0d204bd47ab 100644
--- a/settings/Controller/AppSettingsController.php
+++ b/settings/Controller/AppSettingsController.php
@@ -27,6 +27,7 @@
namespace OC\Settings\Controller;
+use OC\App\AppStore\Bundles\BundleFetcher;
use OC\App\AppStore\Fetcher\AppFetcher;
use OC\App\AppStore\Fetcher\CategoryFetcher;
use OC\App\AppStore\Version\VersionParser;
@@ -50,6 +51,7 @@ class AppSettingsController extends Controller {
const CAT_ENABLED = 0;
const CAT_DISABLED = 1;
const CAT_ALL_INSTALLED = 2;
+ const CAT_APP_BUNDLES = 3;
/** @var \OCP\IL10N */
private $l10n;
@@ -65,6 +67,8 @@ class AppSettingsController extends Controller {
private $appFetcher;
/** @var IFactory */
private $l10nFactory;
+ /** @var BundleFetcher */
+ private $bundleFetcher;
/**
* @param string $appName
@@ -76,6 +80,7 @@ class AppSettingsController extends Controller {
* @param CategoryFetcher $categoryFetcher
* @param AppFetcher $appFetcher
* @param IFactory $l10nFactory
+ * @param BundleFetcher $bundleFetcher
*/
public function __construct($appName,
IRequest $request,
@@ -85,7 +90,8 @@ class AppSettingsController extends Controller {
IAppManager $appManager,
CategoryFetcher $categoryFetcher,
AppFetcher $appFetcher,
- IFactory $l10nFactory) {
+ IFactory $l10nFactory,
+ BundleFetcher $bundleFetcher) {
parent::__construct($appName, $request);
$this->l10n = $l10n;
$this->config = $config;
@@ -94,6 +100,7 @@ class AppSettingsController extends Controller {
$this->categoryFetcher = $categoryFetcher;
$this->appFetcher = $appFetcher;
$this->l10nFactory = $l10nFactory;
+ $this->bundleFetcher = $bundleFetcher;
}
/**
@@ -131,6 +138,7 @@ class AppSettingsController extends Controller {
$formattedCategories = [
['id' => self::CAT_ALL_INSTALLED, 'ident' => 'installed', 'displayName' => (string)$this->l10n->t('Your apps')],
['id' => self::CAT_ENABLED, 'ident' => 'enabled', 'displayName' => (string)$this->l10n->t('Enabled apps')],
+ ['id' => self::CAT_APP_BUNDLES, 'ident' => 'app-bundles', 'displayName' => (string)$this->l10n->t('App bundles')],
['id' => self::CAT_DISABLED, 'ident' => 'disabled', 'displayName' => (string)$this->l10n->t('Disabled apps')],
];
$categories = $this->categoryFetcher->get();
@@ -334,6 +342,23 @@ class AppSettingsController extends Controller {
return ($a < $b) ? -1 : 1;
});
break;
+ case 'app-bundles':
+ $bundles = $this->bundleFetcher->getBundles();
+ $apps = [];
+ foreach($bundles as $bundle) {
+ $apps[] = [
+ 'id' => $bundle->getIdentifier(),
+ 'author' => 'Nextcloud',
+ 'name' => $bundle->getName() . ' (' . $bundle->getDescription() .')',
+ 'description' => '',
+ 'internal' => true,
+ 'active' => false,
+ 'removable' => false,
+ 'groups' => [],
+ 'apps' => $bundle->getAppIdentifiers(),
+ ];
+ }
+ break;
default:
$apps = $this->getAppsForCategory($category);