summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-08-09 09:23:24 -0400
committerSteve Beaver <sbeaver@netgate.com>2017-08-09 09:24:21 -0400
commitec922197ed92e3dc0e15ab4d6ba340015f46bf43 (patch)
tree7a8e457e0994d911bd7ae6d87ce2f792590bd014 /src/etc
parentad950c6e025d2640e45e1d76afc03e8de8986ccc (diff)
downloadpfsense-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')
-rw-r--r--src/etc/inc/upgrade_config.inc29
-rw-r--r--src/etc/pfSense.obsoletedfiles1
2 files changed, 28 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);
}
}
diff --git a/src/etc/pfSense.obsoletedfiles b/src/etc/pfSense.obsoletedfiles
index 2241256..802c8ca 100644
--- a/src/etc/pfSense.obsoletedfiles
+++ b/src/etc/pfSense.obsoletedfiles
@@ -1016,6 +1016,7 @@
/usr/local/www/vpn_pppoe_users.php
/usr/local/www/vpn_pppoe_users_edit.php
/usr/local/www/widgets/widgets/deactivated
+/usr/local/www/widgets/widgets/support.widget.php
/usr/local/www/wizards/traffic_shaper_wizard.inc
/usr/local/www/wizards/traffic_shaper_wizard.xml
/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
OpenPOWER on IntegriCloud