natcasesort($files);
 if (count($files) > 2) {
     /* The 2 accounts for . and .. */
     echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
     // All dirs
     foreach ($files as $file) {
         if ($file != '.' && $file != '..' && file_exists($_POST['dir'] . $file) && is_dir($_POST['dir'] . $file)) {
             if (!is_readable($_POST['dir']) || $_POST['dir'] == dirname(get_sanitized_home_path()) && !strstr($file, basename(get_sanitized_home_path()))) {
                 continue;
             }
             if ($file_list->in_ignore_list($file)) {
                 continue;
             }
             $full_path = htmlentities($_POST['dir'] . $file);
             $file = htmlentities($file);
             $class = $file_list->get_checkbox_class($full_path);
             echo "<li class='directory collapsed'>";
             echo "<a href='#' rel='" . str_replace('\\', '/', $full_path) . '/' . "' class='tree'>{$file}</a>";
             echo "<a href='#' rel='" . str_replace('\\', '/', $full_path) . '/' . "' class='checkbox directory {$class}'></a>";
             echo "</li>";
         }
     }
     // All files
     foreach ($files as $file) {
         if ($file != '.' && $file != '..' && file_exists($_POST['dir'] . $file) && !is_dir($_POST['dir'] . $file)) {
             if ($_POST['dir'] == dirname(get_sanitized_home_path()) && !strstr($file, basename(get_sanitized_home_path()))) {
                 continue;
             }
             if ($file_list->in_ignore_list($file)) {
                 continue;
             }