Natural sorting of user share names

This commit is contained in:
bergware
2016-12-26 09:04:38 +01:00
parent bfc6485bd4
commit 604e1ba9cb
3 changed files with 6 additions and 0 deletions

View File

@@ -84,6 +84,7 @@ Closing the window before completion will terminate the background process - so
<span style="display:block;margin-bottom:4px;font-weight:bold">User Shares</span>
<select id="s2" name="includeShare" size="1" multiple="multiple" style="display:none">
<option value=''>All</option>
<?uksort($shares,'strnatcasecmp');?>
<?foreach ($shares as $share):?>
<?=mk_option(1,"/mnt/user/{$share['name']}",$share['name'])?>
<?endforeach;?>

View File

@@ -16,6 +16,9 @@ Type="xmenu"
<?
$refs = []; $n = 0;
// Natural sorting of share names
uksort($shares,'strnatcasecmp');
foreach ($shares as $ref) {
$sname = $ref['name'];
$refs[] = $sname;

View File

@@ -32,6 +32,8 @@ if (!$shares) {
echo "<tr><td colspan='8' style='text-align:center;padding-top:12px'><i class='fa fa-folder-open-o icon'></i>There are no exportable user shares</td></tr>";
exit;
}
// Natural sorting of share names
uksort($shares,'strnatcasecmp');
// Display export settings
function user_share_settings($protocol,$share) {