load file sorting mode from the db

This commit is contained in:
Christoph Wurst 2016-04-12 10:19:52 +02:00
parent 838e9e3126
commit 3f492dd826
4 changed files with 9 additions and 2 deletions

View File

@ -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');

View File

@ -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();

View File

@ -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),

View File

@ -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;