summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-15 21:59:16 +0200
committerLukas Reschke <lukas@owncloud.com>2014-10-15 22:01:56 +0200
commite4227658d9d80725620ab33b68de5c26c8ed67ad (patch)
tree65461cf9618eb287c79d905671a47dc415f21cae /settings/ajax
parentf48c973876ebe6eab0d95fa2c3daa12355034e3e (diff)
downloadnextcloud-server-e4227658d9d80725620ab33b68de5c26c8ed67ad.tar.gz
nextcloud-server-e4227658d9d80725620ab33b68de5c26c8ed67ad.zip
Migrate new app settings to AppFramework
Let's migrate those two new files.
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/apps/categories.php30
-rw-r--r--settings/ajax/apps/index.php65
2 files changed, 0 insertions, 95 deletions
diff --git a/settings/ajax/apps/categories.php b/settings/ajax/apps/categories.php
deleted file mode 100644
index 3bde28be99b..00000000000
--- a/settings/ajax/apps/categories.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/**
- * Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-OC_JSON::checkAdminUser();
-
-$l = OC_L10N::get('settings');
-
-$categories = array(
- array('id' => 0, 'displayName' => (string)$l->t('Enabled') ),
- array('id' => 1, 'displayName' => (string)$l->t('Not enabled') ),
-);
-
-if(OC_Config::getValue('appstoreenabled', true)) {
- $categories[] = array('id' => 2, 'displayName' => (string)$l->t('Recommended') );
- // apps from external repo via OCS
- $ocs = OC_OCSClient::getCategories();
- foreach($ocs as $k => $v) {
- $categories[] = array(
- 'id' => $k,
- 'displayName' => str_replace('ownCloud ', '', $v)
- );
- }
-}
-
-OCP\JSON::success($categories);
diff --git a/settings/ajax/apps/index.php b/settings/ajax/apps/index.php
deleted file mode 100644
index 24fba8be312..00000000000
--- a/settings/ajax/apps/index.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/**
- * Copyright (c) 2014 Thomas Müller <deepdiver@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-OC_JSON::checkAdminUser();
-
-$l = OC_L10N::get('settings');
-
-$category = intval($_GET['category']);
-$apps = array();
-
-switch($category) {
- // installed apps
- case 0:
- $apps = \OC_App::listAllApps(true);
- $apps = array_filter($apps, function($app) {
- return $app['active'];
- });
- break;
- // not-installed apps
- case 1:
- $apps = \OC_App::listAllApps(true);
- $apps = array_filter($apps, function($app) {
- return !$app['active'];
- });
- break;
- default:
- if ($category === 2) {
- $apps = \OC_App::getAppstoreApps('approved');
- $apps = array_filter($apps, function($app) {
- return isset($app['internalclass']) && $app['internalclass'] === 'recommendedapp';
- });
- } else {
- $apps = \OC_App::getAppstoreApps('approved', $category);
- }
- if (!$apps) {
- $apps = array();
- }
- usort($apps, function ($a, $b) {
- $a = (int)$a['score'];
- $b = (int)$b['score'];
- if ($a === $b) {
- return 0;
- }
- return ($a > $b) ? -1 : 1;
- });
- break;
-}
-
-// fix groups to be an array
-$apps = array_map(function($app){
- $groups = array();
- if (is_string($app['groups'])) {
- $groups = json_decode($app['groups']);
- }
- $app['groups'] = $groups;
- $app['canUnInstall'] = !$app['active'] && $app['removable'];
- return $app;
-}, $apps);
-
-OCP\JSON::success(array("apps" => $apps));