This commit is contained in:
Stephen Beaver 2015-12-30 09:44:34 -05:00
parent 62d61a2f9a
commit 29c0d920f4
3 changed files with 27 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<pfsense>
<version>13.2</version>
<version>13.4</version>
<lastchange/>
<system>
<optimization>normal</optimization>

View File

@ -99,7 +99,7 @@ $g = array(
"disablecrashreporter" => false,
"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
"debug" => false,
"latest_config" => "13.3",
"latest_config" => "13.4",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "101",
"minimum_ram_warning_text" => "128 MB",

View File

@ -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;
}
?>