diff options
Diffstat (limited to 'apps/files/lib/Controller/ApiController.php')
-rw-r--r-- | apps/files/lib/Controller/ApiController.php | 23 |
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 |