Commit a04728883351e25079c943fe6da9e0653e1a473b
1 parent
590bbc12
Exists in
master
and in
6 other branches
Inclusão de rotina em ms_criamapa.php para evitar que LAYERS com status DEFAULT …
…sejam ativados quando o parâmetro &layers e &desligar não tenham sido especificados
Showing
1 changed file
with
10 additions
and
6 deletions
Show diff stats
ms_criamapa.php
| ... | ... | @@ -566,9 +566,8 @@ incluiTemasIniciais(); |
| 566 | 566 | if (isset($layers)) { |
| 567 | 567 | ligaTemas(); |
| 568 | 568 | } |
| 569 | -if (isset($desligar)) { | |
| 570 | - desligaTemasIniciais(); | |
| 571 | -} | |
| 569 | +desligaTemasIniciais(); | |
| 570 | + | |
| 572 | 571 | if (isset($map_reference_image)) { |
| 573 | 572 | $mapn->reference->set("image", $map_reference_image); |
| 574 | 573 | } |
| ... | ... | @@ -755,9 +754,14 @@ function abreInterface($interface, $caminho) |
| 755 | 754 | */ |
| 756 | 755 | function desligaTemasIniciais() |
| 757 | 756 | { |
| 758 | - global $desligar, $mapn; | |
| 759 | - $layers = str_replace(',', " ", $desligar); | |
| 760 | - $lista = explode(" ", $layers); | |
| 757 | + global $desligar, $temasa, $layers, $mapn; | |
| 758 | + //para evitar LAYERS com status MS_DEFAULT | |
| 759 | + if(!isset($desligar)){ | |
| 760 | + $lista = array_diff(explode(" ", $temasa),explode(" ", $layers)); | |
| 761 | + } else { | |
| 762 | + $layersdesligar = str_replace(',', " ", $desligar); | |
| 763 | + $lista = explode(" ", $layersdesligar); | |
| 764 | + } | |
| 761 | 765 | foreach ($lista as $l) { |
| 762 | 766 | if ($l == "") { |
| 763 | 767 | continue; | ... | ... |