summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/upgrade_config.inc
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-12-30 09:44:34 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-12-30 09:44:34 -0500
commit29c0d920f41299d8a29ca3cb1dec5e44dcad55e2 (patch)
tree3ab3fc02c55f40aabed12208cf167fab54e2e052 /src/etc/inc/upgrade_config.inc
parent62d61a2f9a394d41506fc41f9c801e4f5fb49920 (diff)
downloadpfsense-29c0d920f41299d8a29ca3cb1dec5e44dcad55e2.zip
pfsense-29c0d920f41299d8a29ca3cb1dec5e44dcad55e2.tar.gz
Fixed #5714
Diffstat (limited to 'src/etc/inc/upgrade_config.inc')
-rw-r--r--src/etc/inc/upgrade_config.inc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc
index e3c3be1..14db11e 100644
--- a/src/etc/inc/upgrade_config.inc
+++ b/src/etc/inc/upgrade_config.inc
@@ -4235,4 +4235,29 @@ function upgrade_132_to_133() {
}
}
}
+
+// Determine the highest column number in use and set dashboardcolumns accordingly
+function upgrade_133_to_134() {
+ global $config;
+
+ if (!isset($config['widgets']['sequence']) || isset($config['system']['webgui']['dashboardcolumns'])) {
+ return;
+ }
+
+ $cur_widgets = explode(',', trim($config['widgets']['sequence']));
+ $maxcols = 2;
+
+ foreach ($cur_widgets as $widget) {
+ list($file, $col, $display) = explode(':', $widget);
+
+ if (($display != 'none') && ($display != 'hide')) {
+ preg_match('#[0-9]+$#', $col, $column);
+ if ($column[0] > $maxcols) {
+ $maxcols = $column[0];
+ }
+ }
+ }
+
+ $config['system']['webgui']['dashboardcolumns'] = $maxcols % 10;
+}
?>
OpenPOWER on IntegriCloud