Reorder the way this list (get_configured_interface_list) is generated to make it more beautiful.

I know you guys said don't bother, but it's just cosmetic, and it took 10 seconds.
This commit is contained in:
gnhb 2010-09-16 10:45:50 +07:00
parent 01f1b60122
commit 144d0e793d

View File

@ -566,21 +566,19 @@ function get_configured_interface_list($only_opt = false, $withdisabled = false)
global $config;
$iflist = array();
if (!$only_opt) {
if (isset($config['interfaces']['wan']))
$iflist['wan'] = "wan";
if (isset($config['interfaces']['lan']))
$iflist['lan'] = "lan";
}
/* if list */
foreach($config['interfaces'] as $if => $ifdetail) {
foreach($config['interfaces'] as $if => $ifdetail) {
if ($if == "wan" || $if == "lan")
continue;
if (isset($ifdetail['enable']) || $withdisabled == true)
$iflist[$if] = $if;
}
if (!$only_opt) {
if (isset($config['interfaces']['lan']))
$iflist['lan'] = "lan";
if (isset($config['interfaces']['wan']))
$iflist['wan'] = "wan";
}
return $iflist;
}