]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Class/Miscellaneous.php
baculum: Sorting directories and files in restore files browser
[bacula/bacula] / 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;
        }