summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-24 15:31:23 +0200
committerGitHub <noreply@github.com>2018-10-24 15:31:23 +0200
commit37782b1084275d54474700e4ae7863b18e23dc04 (patch)
tree9481ad7bf07ae049a77dd95a0b09e43a7fb63c59 /apps/files/lib
parent2ec5d2a6ded8096431978638013df4ae5d711cb3 (diff)
parentede6472e52ab019c377640eb37ca3499d51ad8be (diff)
downloadnextcloud-server-37782b1084275d54474700e4ae7863b18e23dc04.tar.gz
nextcloud-server-37782b1084275d54474700e4ae7863b18e23dc04.zip
Merge pull request #11573 from nextcloud/gridview-table
Files grid view
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/Controller/ApiController.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php
index 27cd0b361c5..3085b72ac7a 100644
--- a/apps/files/lib/Controller/ApiController.php
+++ b/apps/files/lib/Controller/ApiController.php
@@ -38,6 +38,7 @@ use OCP\Files\NotFoundException;
use OCP\IConfig;
use OCP\IRequest;
use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\Response;
use OCA\Files\Service\TagService;
@@ -268,6 +269,28 @@ class ApiController extends Controller {
}
/**
+ * Toggle default for files grid view
+ *
+ * @NoAdminRequired
+ *
+ * @param bool $show
+ */
+ public function showGridView($show) {
+ $this->config->setUserValue($this->userSession->getUser()->getUID(), 'files', 'show_grid', (int)$show);
+ return new Response();
+ }
+
+ /**
+ * Get default settings for the grid view
+ *
+ * @NoAdminRequired
+ */
+ public function getGridView() {
+ $status = $this->config->getUserValue($this->userSession->getUser()->getUID(), 'files', 'show_grid', '1') === '1';
+ return new JSONResponse(['gridview' => $status]);
+ }
+
+ /**
* Toggle default for showing/hiding xxx folder
*
* @NoAdminRequired