diff options
author | Steve Beaver <sbeaver@netgate.com> | 2017-08-09 09:23:24 -0400 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2017-08-09 09:24:21 -0400 |
commit | ec922197ed92e3dc0e15ab4d6ba340015f46bf43 (patch) | |
tree | 7a8e457e0994d911bd7ae6d87ce2f792590bd014 /src/etc/inc | |
parent | ad950c6e025d2640e45e1d76afc03e8de8986ccc (diff) | |
download | pfsense-ec922197ed92e3dc0e15ab4d6ba340015f46bf43.zip pfsense-ec922197ed92e3dc0e15ab4d6ba340015f46bf43.tar.gz |
Revise upgrade script to insert support widget at the top of column 2
Add old support widget to obsolete files list
Diffstat (limited to 'src/etc/inc')
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index b567249..a8d5370 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -5323,12 +5323,37 @@ function upgrade_165_to_166() { } } -/* Force the Netgate Services and Support widget to be active on upgrade. */ +/* Force the Netgate Services and Support widget to be active on upgrade. + New widget is added at the top of column 2 */ function upgrade_166_to_167() { global $config; if (strpos($config['widgets']['sequence'], 'netgate_services_and_support') === false) { - $config['widgets']['sequence'] .= ',netgate_services_and_support:col2:open:0'; + + $widgets = explode(",", $config['widgets']['sequence']); + $cnt = count($widgets); + $col2 = $cnt; + $newsequence = array(); + + // Locate the firt column 2 widget + for ($idx=0;$idx<$cnt;$idx++) { + if (strpos($widgets[$idx], 'col2') !== false) { + $col2 = $idx; + break; + } + } + + // Loop through the widgets inserting the new widget before the first col2 widget + for ($old=0,$new=0;$old<$cnt;$old++,$new++) { + $newsequence[$new] = $widgets[$old]; + + if ($old == ($col2 - 1)) { + $new++; + $newsequence[$new] = "netgate_services_and_support:col2:open:0"; + } + } + + $config['widgets']['sequence'] = implode(",", $newsequence); } } |