Project

General

Profile

« Previous | Next » 

Revision ec922197

Added by Steve Beaver almost 8 years ago

Revise upgrade script to insert support widget at the top of column 2
Add old support widget to obsolete files list

View differences:

src/etc/inc/upgrade_config.inc
5323 5323
	}
5324 5324
}
5325 5325

  
5326
/* Force the Netgate Services and Support widget to be active on upgrade. */
5326
/* Force the Netgate Services and Support widget to be active on upgrade.
5327
   New widget is added at the top of column 2 */
5327 5328
function upgrade_166_to_167() {
5328 5329
	global $config;
5329 5330

  
5330 5331
	if (strpos($config['widgets']['sequence'], 'netgate_services_and_support') === false) {
5331
		$config['widgets']['sequence'] .= ',netgate_services_and_support:col2:open:0';
5332

  
5333
		$widgets = explode(",", $config['widgets']['sequence']);
5334
		$cnt = count($widgets);
5335
		$col2 = $cnt;
5336
		$newsequence = array();
5337

  
5338
		// Locate the firt column 2 widget
5339
		for ($idx=0;$idx<$cnt;$idx++) {
5340
		if (strpos($widgets[$idx], 'col2') !== false) {
5341
			$col2 = $idx;
5342
			break;
5343
			}
5344
		}
5345

  
5346
		// Loop through the widgets inserting the new widget before the first col2 widget
5347
		for ($old=0,$new=0;$old<$cnt;$old++,$new++) {
5348
			$newsequence[$new] = $widgets[$old];
5349

  
5350
			if ($old == ($col2 - 1)) {
5351
				$new++;
5352
				$newsequence[$new] = "netgate_services_and_support:col2:open:0";
5353
			}
5354
		}
5355

  
5356
		$config['widgets']['sequence'] = implode(",", $newsequence);
5332 5357
	}
5333 5358
}
5334 5359

  

Also available in: Unified diff