]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Sorting directories and files in restore files browser
authorMarcin Haba <marcin.haba@bacula.pl>
Thu, 26 Mar 2015 20:13:50 +0000 (21:13 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Thu, 26 Mar 2015 20:13:50 +0000 (21:13 +0100)
gui/baculum/protected/Class/Miscellaneous.php

index ad0b61021ec4a77c08a460a984b51617b6879334..f44e0b79307cc50b4df2639eec4136292a4f935c 100644 (file)
@@ -1,5 +1,10 @@
 <?php
+
+// small sorting callback function to sort by name
+function sortListByName($a, $b) {
+       return strcasecmp($a['name'], $b['name']);
+}
+
 class Miscellaneous extends TModule {
 
        const LICENCE_FILE = 'LICENSE';
@@ -205,6 +210,7 @@ class Miscellaneous extends TModule {
                                $elements[] = array('pathid' => $match['pathid'], 'filenameid' => $match['filenameid'], 'fileid' => $match['fileid'], 'jobid' => $match['jobid'], 'lstat' => $match['lstat'], 'name' => $match['name'], 'type' => 'file'); 
                        }
                }
+               usort($elements, 'sortListByName');
                return $elements;
        }