Commit 107f893db9d8f58a8f8ddda254a61033a406bb5b
1 parent
90bc5685
Exists in
master
and in
7 other branches
Correção no ordenamento dos temas quando o tema for escondido, mantendo-o na mes…
…ma posição quando possível
Showing
1 changed file
with
14 additions
and
6 deletions
Show diff stats
classesphp/classe_temas.php
| ... | ... | @@ -313,17 +313,23 @@ lista - lista com a nova ordem para os temas. A lista contém os nomes dos temas |
| 313 | 313 | $lista = explode(",",$lista); |
| 314 | 314 | $lista = array_reverse($lista); |
| 315 | 315 | $novaordem = array(); |
| 316 | - $escondidos = array(); | |
| 317 | 316 | foreach ($lista as $l) |
| 318 | 317 | { |
| 319 | 318 | for ($i=0;$i<$nlayers;++$i) |
| 320 | 319 | { |
| 321 | 320 | $la = $this->mapa->getlayer($i); |
| 322 | - $g = strtoupper($la->group); | |
| 323 | - $n = strtoupper($la->name); | |
| 324 | - //echo "$l $n $g -"; | |
| 325 | - if ((strtoupper($l) == $n) || (strtoupper($l) == $g)) | |
| 326 | - {$novaordem[] = $i;} | |
| 321 | + if($la->getmetadata("escondido") != "") | |
| 322 | + { | |
| 323 | + if (!in_array($la->index,$novaordem)) | |
| 324 | + $novaordem[] = $i; | |
| 325 | + } | |
| 326 | + else | |
| 327 | + { | |
| 328 | + $g = strtoupper($la->group); | |
| 329 | + $n = strtoupper($la->name); | |
| 330 | + if ((strtoupper($l) == $n) || (strtoupper($l) == $g)) | |
| 331 | + {$novaordem[] = $i;} | |
| 332 | + } | |
| 327 | 333 | } |
| 328 | 334 | } |
| 329 | 335 | for ($i=0;$i<$nlayers;++$i) |
| ... | ... | @@ -331,6 +337,8 @@ lista - lista com a nova ordem para os temas. A lista contém os nomes dos temas |
| 331 | 337 | if (!in_array($i,$novaordem)) |
| 332 | 338 | {$novaordem[] = $i;} |
| 333 | 339 | } |
| 340 | + //echo "<pre>"; | |
| 341 | + //var_dump($novaordem); | |
| 334 | 342 | $this->mapa->setlayersdrawingorder($novaordem); |
| 335 | 343 | return "ok"; |
| 336 | 344 | } | ... | ... |