Commit 97929260 authored by Tobias Zeuch's avatar Tobias Zeuch
Browse files

save the page-orderby per user



Bug 1360535: Save the last chosen order for pages in the user settings. Load
that as a default when nothing is selected by the user

Change-Id: I28a9461fb74c7ffef7753a145b1da0e9100f2e15
Signed-off-by: default avatarTobias Zeuch <tobias.zeuch@kit.edu>
parent b4812741
......@@ -213,6 +213,7 @@ function expected_account_preferences() {
'devicedetection' => 1,
'licensedefault' => '',
'viewsperpage' => 20,
'orderpagesby' => 'atoz',
);
}
......
......@@ -3622,7 +3622,12 @@ class View {
$limit = $userlimit;
}
$offset = param_integer('offset', 0);
$orderby = param_variable('orderby', null);
// load default page order from user settings as default and overwrite, if changed
$usersettingorderby = get_account_preference($USER->get('id'), 'orderpagesby');
$orderby = param_variable('orderby', $usersettingorderby);
if ($usersettingorderby !== $orderby) {
set_account_preference($USER->get('id'), 'orderpagesby', $orderby);
}
$query = param_variable('query', null);
$tag = param_variable('tag', null);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment