summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-03-06 04:41:26 +0545
committerPhil Davis <phil.davis@inf.org>2016-03-06 04:41:26 +0545
commitad51eb90ca6f5bb34bbd80bf35a001ed388e43f3 (patch)
tree8b9b77b4ed75e8e2d971342d7120dd6b0bde7973 /src
parent65ebf415f0991dc650ac53a9376b74a5efc4bf33 (diff)
downloadpfsense-ad51eb90ca6f5bb34bbd80bf35a001ed388e43f3.zip
pfsense-ad51eb90ca6f5bb34bbd80bf35a001ed388e43f3.tar.gz
Limit widget column to dashboardcolumns
Stops widgets from "going missing" when the user reduces the dashboard columns in System, General Setup. If the user just lowers dashboard columns to see what happens, then increases it again, the actual column settings are preserved in the config, so the widgets go back where they were. That seems a good thing. If the user lowers dashboard columns and then also saves the dashboard, the newly-limited column settings will be saved. Forum: https://forum.pfsense.org/index.php?topic=107865.0
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/index.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php
index 77a35e6..e534ac2 100644
--- a/src/usr/local/www/index.php
+++ b/src/usr/local/www/index.php
@@ -252,6 +252,7 @@ if ($fd) {
##build widget saved list information
if ($config['widgets'] && $config['widgets']['sequence'] != "") {
+ $dashboardcolumns = isset($config['system']['webgui']['dashboardcolumns']) ? $config['system']['webgui']['dashboardcolumns'] : 2;
$pconfig['sequence'] = $config['widgets']['sequence'];
$widgetsfromconfig = array();
@@ -269,6 +270,11 @@ if ($config['widgets'] && $config['widgets']['sequence'] != "") {
}
}
+ // Limit the column to the current dashboard columns.
+ if (substr($col, 3) > $dashboardcolumns) {
+ $col = "col" . $dashboardcolumns;
+ }
+
$offset = strpos($file, '-container');
if (false !== $offset) {
$file = substr($file, 0, $offset);
OpenPOWER on IntegriCloud