Skip to content

Commit 1a2d7b9

Browse files
author
Kristan Kenney
committed
Merge remote-tracking branch 'jaapmarcus/fix/auto-sort' into feature/user-roles
2 parents babcae4 + fa9858c commit 1a2d7b9

File tree

12 files changed

+64
-15
lines changed

12 files changed

+64
-15
lines changed

web/js/init.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ $(document).ready(function(){
129129
return $(a).attr(VE.tmp.sort_par) <= $(b).attr(VE.tmp.sort_par) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
130130
}).appendTo(".l-center.units");
131131
});
132-
if(document.getElementById('default-sort')){
133-
document.getElementById('default-sort').click();
134-
$('.context-menu.sort-order').toggle();
135-
};
136132

137133
$('#objects').submit( function (e){
138134
if(!e.originalEvent){

web/list/backup/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
if (empty($_GET['backup'])){
1010
exec (HESTIA_CMD."v-list-user-backups $user json", $output, $return_var);
1111
$data = json_decode(implode('', $output), true);
12-
$data = array_reverse($data,true);
12+
if($_SESSION['userSortOrder'] == 'name'){
13+
ksort($data);
14+
}else{
15+
$data = array_reverse($data,true);
16+
}
1317
unset($output);
1418

1519
render_page($user, $TAB, 'list_backup');

web/list/cron/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
// Data
99
exec (HESTIA_CMD."v-list-cron-jobs $user json", $output, $return_var);
1010
$data = json_decode(implode('', $output), true);
11-
$data = array_reverse($data,true);
11+
if($_SESSION['userSortOrder'] == 'name'){
12+
ksort($data);
13+
}else{
14+
$data = array_reverse($data,true);
15+
};
1216
unset($output);
1317

1418
// Render page

web/list/db/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
// Data
99
exec (HESTIA_CMD."v-list-databases $user json", $output, $return_var);
1010
$data = json_decode(implode('', $output), true);
11-
$data = array_reverse($data, true);
11+
if($_SESSION['userSortOrder'] == 'name'){
12+
ksort($data);
13+
}else{
14+
$data = array_reverse($data,true);
15+
}
1216
unset($output);
1317

1418
// Render page

web/list/dns/index.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@
99
if (empty($_GET['domain'])){
1010
exec (HESTIA_CMD."v-list-dns-domains ".escapeshellarg($user)." 'json'", $output, $return_var);
1111
$data = json_decode(implode('', $output), true);
12-
$data = array_reverse($data, true);
12+
if($_SESSION['userSortOrder'] == 'name'){
13+
ksort($data);
14+
}else{
15+
$data = array_reverse($data,true);
16+
}
1317
unset($output);
1418

1519
render_page($user, $TAB, 'list_dns');
1620
} else {
1721
exec (HESTIA_CMD."v-list-dns-records ".escapeshellarg($user)." ".escapeshellarg($_GET['domain'])." 'json'", $output, $return_var);
1822
$data = json_decode(implode('', $output), true);
19-
$data = array_reverse($data, true);
23+
if($_SESSION['userSortOrder'] == 'name'){
24+
ksort($data);
25+
}else{
26+
$data = array_reverse($data,true);
27+
}
2028
unset($output);
2129

2230
render_page($user, $TAB, 'list_dns_rec');

web/list/firewall/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
// Data
1515
exec (HESTIA_CMD."v-list-firewall json", $output, $return_var);
1616
$data = json_decode(implode('', $output), true);
17-
$data = array_reverse($data, true);
17+
if($_SESSION['userSortOrder'] == 'name'){
18+
ksort($data);
19+
}else{
20+
$data = array_reverse($data,true);
21+
}
1822
unset($output);
1923

2024
// Render page

web/list/ip/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
// Data
1616
exec (HESTIA_CMD."v-list-sys-ips json", $output, $return_var);
1717
$data = json_decode(implode('', $output), true);
18-
$data = array_reverse($data, true);
18+
if($_SESSION['userSortOrder'] == 'name'){
19+
ksort($data);
20+
}else{
21+
$data = array_reverse($data,true);
22+
}
1923
unset($output);
2024

2125
// Render page

web/list/mail/index.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
if (empty($_GET['domain'])){
1010
exec (HESTIA_CMD."v-list-mail-domains $user json", $output, $return_var);
1111
$data = json_decode(implode('', $output), true);
12-
$data = array_reverse($data, true);
12+
if($_SESSION['userSortOrder'] == 'name'){
13+
ksort($data);
14+
}else{
15+
$data = array_reverse($data,true);
16+
}
1317
unset($output);
1418

1519
render_page($user, $TAB, 'list_mail');
@@ -31,7 +35,11 @@
3135
} else {
3236
exec (HESTIA_CMD."v-list-mail-accounts ".escapeshellarg($user)." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
3337
$data = json_decode(implode('', $output), true);
34-
$data = array_reverse($data, true);
38+
if($_SESSION['userSortOrder'] == 'name'){
39+
ksort($data);
40+
}else{
41+
$data = array_reverse($data,true);
42+
}
3543
unset($output);
3644

3745
render_page($user, $TAB, 'list_mail_acc');

web/list/package/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
// Data
1616
exec (HESTIA_CMD."v-list-user-packages json", $output, $return_var);
1717
$data = json_decode(implode('', $output), true);
18+
if($_SESSION['userSortOrder'] == 'name'){
19+
ksort($data);
20+
}else{
21+
$data = array_reverse($data,true);
22+
}
1823
unset($output);
1924

2025
// Render page

web/list/server/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@
122122
unset($output);
123123
exec (HESTIA_CMD."v-list-sys-services json", $output, $return_var);
124124
$data = json_decode(implode('', $output), true);
125+
if($_SESSION['userSortOrder'] == 'name'){
126+
ksort($data);
127+
}
128+
125129
unset($output);
126130

127131
// Render page

0 commit comments

Comments
 (0)