diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-11-12 11:37:18 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-11-12 11:39:33 -0500 |
commit | 1fd9322bed133abb12eeb3696bf7ab8e170319cc (patch) | |
tree | c8ff26603328d68958a785bbd56693420f9346aa /src/etc/inc/upgrade_config.inc | |
parent | 06fdb1e50f089efacab0d1eeb6cb1806aada102b (diff) | |
download | pfsense-1fd9322bed133abb12eeb3696bf7ab8e170319cc.zip pfsense-1fd9322bed133abb12eeb3696bf7ab8e170319cc.tar.gz |
Fixed #5432
Diffstat (limited to 'src/etc/inc/upgrade_config.inc')
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index c533149..ea38fbf 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -4048,5 +4048,44 @@ function upgrade_125_to_126() { } } +// prior to v2.3 <widgets><sequence> contains a list of widgets with display types: +// none, close, hide, & show +// v2.3 & later uses: +// close & open +// widgets not in use are simply not in the list +function upgrade_126_to_127() { + global $config; + + if (!isset($config['widgets']['sequence'])) { + return; + } + + $cur_widgets = explode(',', trim($config['widgets']['sequence'])); + $new_widgets = array(); + + foreach ($cur_widgets as $widget) { + list($file, $col, $display) = explode(':', $widget); + + switch ($display) { + case 'hide': + $display = 'close'; + break; + case 'show': + $display = 'open'; + break; + default: + /* close, none or something is wrong here, ignore it */ + continue; + } + + /* Remove '-container' from widget name */ + $file = preg_replace('/-container$/', '', $file); + + $new_widgets[] = "{$file}:{$col}:{$display}"; + } + + $config['widgets']['sequence'] = implode(',', $new_widgets); + +} ?> |