aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/controller/viewcontroller.php1
-rw-r--r--apps/files/js/app.js3
-rw-r--r--apps/files/js/filelist.js6
-rw-r--r--apps/files/templates/index.php1
4 files changed, 9 insertions, 2 deletions
diff --git a/apps/files/controller/viewcontroller.php b/apps/files/controller/viewcontroller.php
index 800cf008fa7..b71c8e38a79 100644
--- a/apps/files/controller/viewcontroller.php
+++ b/apps/files/controller/viewcontroller.php
@@ -213,6 +213,7 @@ class ViewController extends Controller {
$params['mailNotificationEnabled'] = $this->config->getAppValue('core', 'shareapi_allow_mail_notification', 'no');
$params['mailPublicNotificationEnabled'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no');
$params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
+ $params['defaultFileSorting'] = $this->config->getAppValue('files', 'file_sorting', 'name');
$params['appNavigation'] = $nav;
$params['appContents'] = $contentItems;
$this->navigationManager->setActiveEntry('files_index');
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index ff505d417f1..8662cd7c852 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -72,7 +72,8 @@
fileActions: fileActions,
allowLegacyActions: true,
scrollTo: urlParams.scrollto,
- filesClient: OC.Files.getClient()
+ filesClient: OC.Files.getClient(),
+ sorting: $('#defaultFileSorting').val()
}
);
this.files.initialize();
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 71af4a21b9b..322dfcaa66e 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -239,7 +239,11 @@
this.fileSummary = this._createSummary();
- this.setSort('name', 'asc');
+ if (options.sorting) {
+ this.setSort(options.sorting, 'asc');
+ } else {
+ this.setSort('name', 'asc');
+ }
var breadcrumbOptions = {
onClick: _.bind(this._onClickBreadCrumb, this),
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index e825c300d31..c108c6f0613 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -18,4 +18,5 @@
<input type="hidden" name="mailNotificationEnabled" id="mailNotificationEnabled" value="<?php p($_['mailNotificationEnabled']) ?>" />
<input type="hidden" name="mailPublicNotificationEnabled" id="mailPublicNotificationEnabled" value="<?php p($_['mailPublicNotificationEnabled']) ?>" />
<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
+<input type="hidden" name="defaultFileSorting" id="defaultFileSorting" value="<?php p($_['defaultFileSorting']) ?>" />
<?php endif;