diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-04-12 10:19:52 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-04-13 11:28:42 +0200 |
commit | 3f492dd82681ca92e9e86acfcf1c15dfcfcf34cf (patch) | |
tree | ff4a4cb9ebd0f0a5f5704e7212d94ed77aaf4bbc /apps/files | |
parent | 838e9e312673c2fb30796b07b6fa2542ee8f554e (diff) | |
download | nextcloud-server-3f492dd82681ca92e9e86acfcf1c15dfcfcf34cf.tar.gz nextcloud-server-3f492dd82681ca92e9e86acfcf1c15dfcfcf34cf.zip |
load file sorting mode from the db
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/controller/viewcontroller.php | 1 | ||||
-rw-r--r-- | apps/files/js/app.js | 3 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 6 | ||||
-rw-r--r-- | apps/files/templates/index.php | 1 |
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; |