diff options
author | Phil Davis <phil.davis@inf.org> | 2017-03-30 10:01:23 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2017-03-30 10:01:23 +0545 |
commit | 1d3510cf6cc471b179d52e03f4cfe77e23b4b20b (patch) | |
tree | 51deff4531bf7b02da13f93e4b865cef6116515b /src/usr/local/www | |
parent | fe255e99389cb6f75a06c55797890c52bd934f0f (diff) | |
download | pfsense-1d3510cf6cc471b179d52e03f4cfe77e23b4b20b.zip pfsense-1d3510cf6cc471b179d52e03f4cfe77e23b4b20b.tar.gz |
Add user option to sort interface names
Diffstat (limited to 'src/usr/local/www')
-rw-r--r-- | src/usr/local/www/head.inc | 8 | ||||
-rw-r--r-- | src/usr/local/www/system.php | 5 | ||||
-rw-r--r-- | src/usr/local/www/system_user_settings.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/system_usermanager.php | 8 |
4 files changed, 28 insertions, 1 deletions
diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc index 27fb8f7..5943a55 100644 --- a/src/usr/local/www/head.inc +++ b/src/usr/local/www/head.inc @@ -275,8 +275,14 @@ foreach ($opts as $oif => $odescr) { } } +$interfaces_bottom = array_merge($interfaces_bottom, return_ext_menu("Interfaces")); + +if ($user_settings['webgui']['interfacessort']) { + $interfaces_bottom = msort($interfaces_bottom, 0); +} + // Combine the top section, the divider and the bottom section of this menu -$interfaces_menu = array_merge($interfaces_top, [array(0 => "-DIVIDER-")], msort(array_merge($interfaces_bottom, return_ext_menu("Interfaces")), 0)); +$interfaces_menu = array_merge($interfaces_top, [array(0 => "-DIVIDER-")], $interfaces_bottom); // Firewall $firewall_menu = array(); diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php index 5766499..53fbf80 100644 --- a/src/usr/local/www/system.php +++ b/src/usr/local/www/system.php @@ -62,6 +62,7 @@ $pconfig['language'] = $config['system']['language']; $pconfig['webguicss'] = $config['system']['webgui']['webguicss']; $pconfig['webguifixedmenu'] = $config['system']['webgui']['webguifixedmenu']; $pconfig['dashboardcolumns'] = $config['system']['webgui']['dashboardcolumns']; +$pconfig['interfacessort'] = isset($config['system']['webgui']['interfacessort']); $pconfig['webguileftcolumnhyper'] = isset($config['system']['webgui']['webguileftcolumnhyper']); $pconfig['disablealiaspopupdetail'] = isset($config['system']['webgui']['disablealiaspopupdetail']); $pconfig['dashboardavailablewidgetspanel'] = isset($config['system']['webgui']['dashboardavailablewidgetspanel']); @@ -272,6 +273,9 @@ if ($_POST) { set_language(); } + unset($config['system']['webgui']['interfacessort']); + $config['system']['webgui']['interfacessort'] = $_POST['interfacessort'] ? true : false; + unset($config['system']['webgui']['webguileftcolumnhyper']); $config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false; @@ -576,6 +580,7 @@ gen_webguicss_field($section, $pconfig['webguicss']); gen_webguifixedmenu_field($section, $pconfig['webguifixedmenu']); gen_webguihostnamemenu_field($section, $pconfig['webguihostnamemenu']); gen_dashboardcolumns_field($section, $pconfig['dashboardcolumns']); +gen_interfacessort_field($section, $pconfig['interfacessort']); gen_associatedpanels_fields( $section, $pconfig['dashboardavailablewidgetspanel'], diff --git a/src/usr/local/www/system_user_settings.php b/src/usr/local/www/system_user_settings.php index 03d8355..ebcdc78 100644 --- a/src/usr/local/www/system_user_settings.php +++ b/src/usr/local/www/system_user_settings.php @@ -42,6 +42,7 @@ if (isset($id) && $a_user[$id]) { $pconfig['webguifixedmenu'] = $a_user[$id]['webguifixedmenu']; $pconfig['webguihostnamemenu'] = $a_user[$id]['webguihostnamemenu']; $pconfig['dashboardcolumns'] = $a_user[$id]['dashboardcolumns']; + $pconfig['interfacessort'] = isset($a_user[$id]['interfacessort']); $pconfig['dashboardavailablewidgetspanel'] = isset($a_user[$id]['dashboardavailablewidgetspanel']); $pconfig['systemlogsfilterpanel'] = isset($a_user[$id]['systemlogsfilterpanel']); $pconfig['systemlogsmanagelogpanel'] = isset($a_user[$id]['systemlogsmanagelogpanel']); @@ -84,6 +85,13 @@ if (isset($_POST['save'])) { $pconfig['dashboardcolumns'] = $userent['dashboardcolumns'] = $_POST['dashboardcolumns']; + if ($_POST['interfacessort']) { + $pconfig['interfacessort'] = $userent['interfacessort'] = true; + } else { + $pconfig['interfacessort'] = false; + unset($userent['interfacessort']); + } + if ($_POST['dashboardavailablewidgetspanel']) { $pconfig['dashboardavailablewidgetspanel'] = $userent['dashboardavailablewidgetspanel'] = true; } else { diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index abf9d82..6770297 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -63,6 +63,7 @@ if (isset($id) && $a_user[$id]) { $pconfig['webguifixedmenu'] = $a_user[$id]['webguifixedmenu']; $pconfig['webguihostnamemenu'] = $a_user[$id]['webguihostnamemenu']; $pconfig['dashboardcolumns'] = $a_user[$id]['dashboardcolumns']; + $pconfig['interfacessort'] = isset($a_user[$id]['interfacessort']); $pconfig['dashboardavailablewidgetspanel'] = isset($a_user[$id]['dashboardavailablewidgetspanel']); $pconfig['systemlogsfilterpanel'] = isset($a_user[$id]['systemlogsfilterpanel']); $pconfig['systemlogsmanagelogpanel'] = isset($a_user[$id]['systemlogsmanagelogpanel']); @@ -330,6 +331,12 @@ if ($_POST['save']) { unset($userent['webguihostnamemenu']); } + if ($_POST['interfacessort']) { + $userent['interfacessort'] = true; + } else { + unset($userent['interfacessort']); + } + if ($_POST['dashboardavailablewidgetspanel']) { $userent['dashboardavailablewidgetspanel'] = true; } else { @@ -976,6 +983,7 @@ events.push(function() { hideInput('webguifixedmenu', !adv); hideInput('webguihostnamemenu', !adv); hideInput('dashboardcolumns', !adv); + hideCheckbox('interfacessort', !adv); hideCheckbox('dashboardavailablewidgetspanel', !adv); hideCheckbox('systemlogsfilterpanel', !adv); hideCheckbox('systemlogsmanagelogpanel', !adv); |