Revision 38c763aa
Added by Renato Botelho almost 8 years ago
src/etc/inc/upgrade_config.inc | ||
---|---|---|
5328 | 5328 |
function upgrade_166_to_167() { |
5329 | 5329 |
global $config; |
5330 | 5330 |
|
5331 |
if (strpos($config['widgets']['sequence'], 'netgate_services_and_support') === false) {
|
|
5332 |
|
|
5331 |
if (strpos($config['widgets']['sequence'], |
|
5332 |
'netgate_services_and_support') === false) { |
|
5333 | 5333 |
$widgets = explode(",", $config['widgets']['sequence']); |
5334 | 5334 |
$cnt = count($widgets); |
5335 | 5335 |
$col2 = $cnt; |
... | ... | |
5337 | 5337 |
|
5338 | 5338 |
// Locate the firt column 2 widget |
5339 | 5339 |
for ($idx=0;$idx<$cnt;$idx++) { |
5340 |
if (strpos($widgets[$idx], 'col2') !== false) { |
|
5341 |
$col2 = $idx; |
|
5342 |
break; |
|
5340 |
if (strpos($widgets[$idx], 'col2') !== false) {
|
|
5341 |
$col2 = $idx;
|
|
5342 |
break;
|
|
5343 | 5343 |
} |
5344 | 5344 |
} |
5345 | 5345 |
|
5346 |
// Loop through the widgets inserting the new widget before the first col2 widget |
|
5346 |
/* |
|
5347 |
* Loop through the widgets inserting the new widget before |
|
5348 |
* the first col2 widget |
|
5349 |
*/ |
|
5347 | 5350 |
for ($old=0,$new=0;$old<$cnt;$old++,$new++) { |
5348 | 5351 |
$newsequence[$new] = $widgets[$old]; |
5349 | 5352 |
|
5350 |
if ($old == ($col2 - 1)) { |
|
5351 |
$new++; |
|
5352 |
$newsequence[$new] = "netgate_services_and_support:col2:open:0"; |
|
5353 |
if ($old != ($col2 - 1)) { |
|
5354 |
continue; |
|
5353 | 5355 |
} |
5356 |
$new++; |
|
5357 |
$newsequence[$new] = |
|
5358 |
"netgate_services_and_support:col2:open:0"; |
|
5354 | 5359 |
} |
5355 | 5360 |
|
5356 | 5361 |
$config['widgets']['sequence'] = implode(",", $newsequence); |
Also available in: Unified diff
Fix indent/space