Commit a0f84256a0ba42242f4931670f1e3465767444bf
1 parent
aa8bedd8
Exists in
master
Novos filtros no editor de mapfiles
Showing
4 changed files
with
46 additions
and
14 deletions
Show diff stats
admin/html/editormapfile.html
... | ... | @@ -92,6 +92,8 @@ body { |
92 | 92 | as características de cada LAYER nas opções |
93 | 93 | abaixo. <br> Para incluir o tema nos menus, <a |
94 | 94 | href='arvore.html'>edite a árvore de temas </a> </p> |
95 | + <p class=paragrafo >O texto marcado em cinza corresponde ao nome do tema registrados na árvore de temas (registro no banco de dados). | |
96 | + Nem todos os temas são utilizados na árvore, por isso não necessitam ser associados a um 'tema' e registrados no banco de dados.</p> | |
95 | 97 | <div id="letras"></div> |
96 | 98 | <p>Mapfiles (arquivos existentes no diretório i3geo/temas):</p> |
97 | 99 | <div id="tabela" style="left: -5px;"></div> |
... | ... | @@ -163,7 +165,8 @@ body { |
163 | 165 | } |
164 | 166 | i3GEO.util.insereCookie("I3GEOletraAdmin", letra); |
165 | 167 | core_pegaMapfiles("montaArvore()", letra, document |
166 | - .getElementById("selFiltro").value); | |
168 | + .getElementById("selFiltro").value,document | |
169 | + .getElementById("checaNomes").checked); | |
167 | 170 | } |
168 | 171 | //necessario para a ferramenta login e outras |
169 | 172 | i3GEO.configura = { |
... | ... | @@ -178,6 +181,8 @@ body { |
178 | 181 | + "\")' >" |
179 | 182 | + "<option value='' >----</option>" |
180 | 183 | + "<option value='link_tema,=,' >Sem fonte</option>" |
184 | + + "<option value='nome_tema,=,' >Nome não definido no banco de dados</option>" | |
185 | + + "<option value='nome_tema,!=,' >Nome definido no banco de dados</option>" | |
181 | 186 | + "<option value='download_tema,=,sim' >Permite download</option>" |
182 | 187 | + "<option value='download_tema,=,nao' >Não permite download</option>" |
183 | 188 | + "<option value='ogc_tema,=,sim' >Permite WMS</option>" |
... | ... | @@ -187,10 +192,15 @@ body { |
187 | 192 | + "<option value='kmz_tema,=,sim' >Permite KMZ</option>" |
188 | 193 | + "<option value='kmz_tema,=,nao' >Não permite KMZ</option>" |
189 | 194 | + "</select>"; |
190 | - ins += " <input onclick='filtraLetra(\"" | |
195 | + ins += "<br><input onclick='filtraLetra(\"" | |
191 | 196 | + letraAtual |
192 | - + "\")' type=checkbox id=mostraMini style=position:relative;top:2px; />Mostra a miniatura se houver"; | |
197 | + + "\")' type=checkbox id=mostraMini style=position:relative;top:2px; /><span class=paragrafo >Mostra a miniatura armazenada em temas/miniaturas</span>"; | |
193 | 198 | |
199 | + ins += "<br><input onclick='filtraLetra(\"" | |
200 | + + letraAtual | |
201 | + + "\")' type=checkbox id=checaNomes style=position:relative;top:2px; /><span class=paragrafo >Verifica nome registrado no banco e no mapfile. Marca em vermelho o nome registrado no mapfile quando houver divergência</span>"; | |
202 | + | |
203 | + | |
194 | 204 | ins += "<p><div id=filtroDeLetras ></div>"; |
195 | 205 | document.getElementById("letras").innerHTML = ins; |
196 | 206 | core_listaDeLetras("filtroDeLetras","filtraLetra"); | ... | ... |
admin/js/core.js
... | ... | @@ -608,22 +608,24 @@ funcaoM - (opcional) nome da funcao que ser&aacute; executada ao terminar a busc |
608 | 608 | letra - (opcional) letra inicial utilizada para filtrar a lista |
609 | 609 | |
610 | 610 | filtro - (opcional) string com o filtro, por exemplo, "'download_tema' = 'SIM'" |
611 | + | |
612 | +checaNomes - (0pcional) bate o nome do mapfile (tema) com o registro no banco | |
611 | 613 | */ |
612 | -function core_pegaMapfiles(funcaoM,letra,filtro) | |
614 | +function core_pegaMapfiles(funcaoM,letra,filtro,checaNomes) | |
613 | 615 | { |
614 | - if(arguments.length == 0){ | |
616 | + if(!letra){ | |
615 | 617 | letra = ""; |
616 | - filtro = ""; | |
617 | - funcaoM = ""; | |
618 | 618 | } |
619 | - if(arguments.length == 1){ | |
620 | - letra = ""; | |
619 | + if(!filtro){ | |
621 | 620 | filtro = ""; |
622 | 621 | } |
623 | - if(arguments.length == 2){ | |
624 | - filtro = ""; | |
622 | + if(!funcaoM){ | |
623 | + funcaoM = ""; | |
624 | + } | |
625 | + if(!checaNomes){ | |
626 | + checaNomes = "false"; | |
625 | 627 | } |
626 | - var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra+"&filtro="+filtro; | |
628 | + var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra+"&filtro="+filtro+"&checaNomes="+checaNomes; | |
627 | 629 | var callbackM = |
628 | 630 | { |
629 | 631 | success:function(o) | ... | ... |
admin/php/editormapfile.php
... | ... | @@ -83,6 +83,7 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ |
83 | 83 | if(verificaOperacaoSessao("admin/html/editormapfile") == false){ |
84 | 84 | retornaJSON("Vc nao pode realizar essa operacao.");exit; |
85 | 85 | } |
86 | + unlink("$locaplic/temas/teste.txt"); | |
86 | 87 | } |
87 | 88 | error_reporting(0); |
88 | 89 | //define o parametro de output do resultado da funcao | ... | ... |
admin/php/menutemas.php
... | ... | @@ -1221,7 +1221,7 @@ Retorna a lista de mapfiles do diretorio i3geo/temas |
1221 | 1221 | */ |
1222 | 1222 | function listaMapsTemas() |
1223 | 1223 | { |
1224 | - global $cp,$locaplic,$letra,$filtro,$esquemaadmin; | |
1224 | + global $cp,$locaplic,$letra,$filtro,$esquemaadmin,$checaNomes; | |
1225 | 1225 | $arquivos = array(); |
1226 | 1226 | if (is_dir($locaplic."/temas")) |
1227 | 1227 | { |
... | ... | @@ -1287,7 +1287,6 @@ function listaMapsTemas() |
1287 | 1287 | foreach($regs as $reg){ |
1288 | 1288 | $nomes[$reg["codigo_tema"]] = $reg["nome_tema"]; |
1289 | 1289 | $ids[$reg["codigo_tema"]] = $reg["id_tema"]; |
1290 | - //$outros[$reg["codigo_tema"]] = array("kmz"=>$reg["kmz_tema"],"kml"=>$reg["kml_tema"],"ogc"=>$reg["ogc_tema"],"download"=>$reg["download_tema"],"link"=>$reg["link_tema"]); | |
1291 | 1290 | } |
1292 | 1291 | $lista = array(); |
1293 | 1292 | foreach($arquivos as $arq){ |
... | ... | @@ -1311,6 +1310,25 @@ function listaMapsTemas() |
1311 | 1310 | if(file_exists($locaplic."/temas/miniaturas/".$arq.".map.mini.png")){ |
1312 | 1311 | $imagem = $arq.".map.mini.png"; |
1313 | 1312 | } |
1313 | + if($checaNomes == "true"){ | |
1314 | + if($extensao == "map"){ | |
1315 | + if(file_exists($locaplic."/temas/".$arq.".map")){ | |
1316 | + $handle = fopen($locaplic."/temas/".$arq.".map", "r"); | |
1317 | + while (!feof($handle)){ | |
1318 | + $linha = fgets($handle); | |
1319 | + if(strpos(strtoupper($linha),"'TEMA'") !== false || strpos(strtoupper($linha),'"TEMA"') !== false){ | |
1320 | + $ntema = str_replace(array("'TEMA'",'"TEMA"',"'tema'",'"tema"'),"",$linha); | |
1321 | + $ntema = trim(str_replace(array("'",'"'),"",$ntema)); | |
1322 | + if($n != $ntema && $n != utf8_encode($ntema) && $n != ""){ | |
1323 | + $n .= "<span style=color:red;margin-left:5px >".utf8_encode($ntema)."</span>"; | |
1324 | + } | |
1325 | + break; | |
1326 | + } | |
1327 | + } | |
1328 | + fclose($handle); | |
1329 | + } | |
1330 | + } | |
1331 | + } | |
1314 | 1332 | if(isset($filtro) && $filtro != "" && $n != ""){ |
1315 | 1333 | $lista[] = array("grupousr"=>$grupousr,"id_tema"=>$id,"nome"=>$n,"codigo"=>$arq,"imagem"=>$imagem,"extensao"=>$extensao); |
1316 | 1334 | } |
... | ... | @@ -1318,6 +1336,7 @@ function listaMapsTemas() |
1318 | 1336 | $lista[] = array("grupousr"=>$grupousr,"id_tema"=>$id,"nome"=>$n,"codigo"=>$arq,"imagem"=>$imagem,"extensao"=>$extensao); |
1319 | 1337 | } |
1320 | 1338 | } |
1339 | + | |
1321 | 1340 | return $lista; |
1322 | 1341 | } |
1323 | 1342 | /* | ... | ... |