Commit d3dc7021cbba1eb2e93a9527cf5eee88a201dc55
1 parent
73ea76ce
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
7 additions
and
15 deletions
Show diff stats
classesphp/classe_mapa.php
| @@ -981,23 +981,15 @@ $adicionar - sim|nao força a adição de um tema se ele não existir no mapfile atu | @@ -981,23 +981,15 @@ $adicionar - sim|nao força a adição de um tema se ele não existir no mapfile atu | ||
| 981 | { | 981 | { |
| 982 | $teste = explode(",",$ligar); | 982 | $teste = explode(",",$ligar); |
| 983 | $adicionar = array(); | 983 | $adicionar = array(); |
| 984 | + $verificar = array(); | ||
| 985 | + foreach($this->layers as $layerE) | ||
| 986 | + { | ||
| 987 | + $verificar[] = $layerE->getmetadata("nomeoriginal"); | ||
| 988 | + $verificar[] = $layerE->name; | ||
| 989 | + } | ||
| 984 | foreach($teste as $t) | 990 | foreach($teste as $t) |
| 985 | { | 991 | { |
| 986 | - $incluir = false; | ||
| 987 | - foreach($this->layers as $layerE) | ||
| 988 | - { | ||
| 989 | - $original = $layerE->getmetadata("nomeoriginal"); | ||
| 990 | - if($original != "") | ||
| 991 | - { | ||
| 992 | - if($original != $t) | ||
| 993 | - {$incluir = true;} | ||
| 994 | - else | ||
| 995 | - {$incluir = false;} | ||
| 996 | - } | ||
| 997 | - else | ||
| 998 | - {$incluir = false;} | ||
| 999 | - } | ||
| 1000 | - if($incluir == true){$adicionar[] = $t;} | 992 | + if(!in_array($t,$verificar)){$adicionar[] = $t;} |
| 1001 | } | 993 | } |
| 1002 | if(count($adicionar > 0)) | 994 | if(count($adicionar > 0)) |
| 1003 | { | 995 | { |