summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-06 09:06:24 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-06 11:42:18 +0100
commit5682d302c72ae42dfa16b068ad70fe312ed1ff9d (patch)
tree6ec25f56e0a085117a2fd685a55c3ed46d637cf6 /apps/files_external
parent54a30a4b81700570303eaae03810f6ef553d66a2 (diff)
downloadnextcloud-server-5682d302c72ae42dfa16b068ad70fe312ed1ff9d.tar.gz
nextcloud-server-5682d302c72ae42dfa16b068ad70fe312ed1ff9d.zip
Add grid toggle for every files view
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/list.php8
-rw-r--r--apps/files_external/templates/list.php2
2 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_external/list.php b/apps/files_external/list.php
index 35ad6e60447..a63475e78e6 100644
--- a/apps/files_external/list.php
+++ b/apps/files_external/list.php
@@ -22,9 +22,17 @@
*/
// Check if we are a user
OCP\User::checkLoggedIn();
+$config = \OC::$server->getConfig();
+$userSession = \OC::$server->getUserSession();
+
+$showgridview = $config->getUserValue($userSession->getUser()->getUID(), 'files', 'show_grid', true);
+$isIE = \OCP\Util::isIE();
$tmpl = new OCP\Template('files_external', 'list', '');
+// gridview not available for ie
+$tmpl->assign('showgridview', $showgridview && !$isIE);
+
/* Load Status Manager */
\OCP\Util::addStyle('files_external', 'external');
\OCP\Util::addScript('files_external', 'statusmanager');
diff --git a/apps/files_external/templates/list.php b/apps/files_external/templates/list.php
index 20f97dd4c08..04b7159cfe1 100644
--- a/apps/files_external/templates/list.php
+++ b/apps/files_external/templates/list.php
@@ -11,7 +11,7 @@
<input type="hidden" name="dir" value="" id="dir">
-<table id="filestable" class="list-container view-grid">
+<table id="filestable" class="list-container <?php p($_['showgridview'] ? 'view-grid' : '') ?>">
<thead>
<tr>
<th id='headerName' class="hidden column-name">