diff options
-rw-r--r-- | src/usr/local/www/index.php | 4 | ||||
-rw-r--r-- | src/usr/local/www/widgets/widgets/traffic_graphs.widget.php | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php index 061d57e..63682db 100644 --- a/src/usr/local/www/index.php +++ b/src/usr/local/www/index.php @@ -154,7 +154,9 @@ if (!is_array($config['widgets'])) { if ($_POST && $_POST['sequence']) { - $widget_settings = array(); + // Read in the existing widget settings + $widget_settings = $config['widgets']; + $widget_settings['sequence'] = rtrim($_POST['sequence'], ','); foreach ($widgets as $widgetname => $widgetconfig) { diff --git a/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php index 492d0e6..74864e8 100644 --- a/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php +++ b/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php @@ -66,20 +66,24 @@ require_once("ipsec.inc"); require_once("functions.inc"); $first_time = false; + if (!is_array($config["widgets"]["trafficgraphs"])) { $first_time = true; $config["widgets"]["trafficgraphs"] = array(); } + $a_config = &$config["widgets"]["trafficgraphs"]; if (!is_array($a_config["shown"])) { $a_config["shown"] = array(); } + if (!is_array($a_config["shown"]["item"])) { $a_config["shown"]["item"] = array(); } $ifdescrs = get_configured_interface_with_descr(); + if (ipsec_enabled()) { $ifdescrs['enc0'] = "IPsec"; } @@ -107,6 +111,7 @@ if ($_POST) { } $shown = array(); + foreach ($a_config["shown"]["item"] as $if) { $shown[$if] = true; } |