Attached is a patch to add sorting to the directory
listing.
The patch is for ffileman.cgi but to use it properly
you should also add a new configuration variable to
ffileman_config.cgi named $sort_order, set to one of
the following values:
$sort_order = 0; # sort ascending alphabetically
$sort_order = -1; sort by date oldest to newest
$sort_order = 1; sort by date newest to oldest
If you do add the variable to ffileman_config.cgi then
you do not need the line where I set it at the
beginning of ffileman.cgi.
With this patch, the directory listing is always sorted
to place the directories before all non-directory
files. The default sort order is determined by
$sort_order. The column headings for file name and date
modified become hot links. Clicking on the file name
heading causes the directory listing to be sorted by
name. Clicking on the date modified heading causes the
listing to be sorted by date, alternating oldest to
newst and newest to oldest each time it is clicked.
This patch is to implement the suggestion in bug
#1425391 but I did not see how to upload an attachment
other than by creating a new tracker issue.
If Altan Firidin chooses to incorporate this patch or
any modification of it into the ffileman script, I
hereby assign copyright for this patch to Altan
Firidin. Until such time as Altan does that, you can
redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free
Software Foundation; either version 2 of the License,
or (at your option) any later version.
Zip of patch in diff format and a readme for the patch