Commit b73186b38f0adcce43d8a7345b89c041225eef37
1 parent
8e93548d
Exists in
master
and in
7 other branches
--no commit message
Showing
27 changed files
with
302 additions
and
327 deletions
Show diff stats
admin/js/arvore.js
@@ -57,7 +57,7 @@ function montaArvore(dados) | @@ -57,7 +57,7 @@ function montaArvore(dados) | ||
57 | success: function(oResponse) | 57 | success: function(oResponse) |
58 | { | 58 | { |
59 | var dados = YAHOO.lang.JSON.parse(oResponse.responseText) | 59 | var dados = YAHOO.lang.JSON.parse(oResponse.responseText) |
60 | - montaNosGrupos(node.data.id_menu,node,dados,false) | 60 | + montaNosGrupos(node.data.id_menu,node,dados,true) |
61 | oResponse.argument.fnLoadComplete(); | 61 | oResponse.argument.fnLoadComplete(); |
62 | }, | 62 | }, |
63 | failure: function(oResponse) | 63 | failure: function(oResponse) |
@@ -156,7 +156,6 @@ function montaNosGrupos(idmenu,no,dados,redesenha) | @@ -156,7 +156,6 @@ function montaNosGrupos(idmenu,no,dados,redesenha) | ||
156 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('grupo','"+dados.grupos[i].id_n1+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" /> <span>"+dados.grupos[i].nome_grupo+"</span>" | 156 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('grupo','"+dados.grupos[i].id_n1+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" /> <span>"+dados.grupos[i].nome_grupo+"</span>" |
157 | var d = {html:conteudo,id_n1:dados.grupos[i].id_n1,tipo:"grupo"} | 157 | var d = {html:conteudo,id_n1:dados.grupos[i].id_n1,tipo:"grupo"} |
158 | var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); | 158 | var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); |
159 | - //tempNode.isLeaf = true; | ||
160 | tempNode.setDynamicLoad(loadSubgruposData, temaIconMode); | 159 | tempNode.setDynamicLoad(loadSubgruposData, temaIconMode); |
161 | } | 160 | } |
162 | if(redesenha){tree.draw();} | 161 | if(redesenha){tree.draw();} |
@@ -289,7 +288,7 @@ function novoTemaRaiz(id) | @@ -289,7 +288,7 @@ function novoTemaRaiz(id) | ||
289 | { | 288 | { |
290 | core_carregando("ativa"); | 289 | core_carregando("ativa"); |
291 | var mensagem = " adicionando tema..."; | 290 | var mensagem = " adicionando tema..."; |
292 | - core_carregando("mensagem"); | 291 | + core_carregando(mensagem); |
293 | var no = tree.getNodeByProperty("id_menu",id) | 292 | var no = tree.getNodeByProperty("id_menu",id) |
294 | var noEtiquetaGrupo = tree.getNodeByProperty("etiquetaGrupo","menu_"+id) | 293 | var noEtiquetaGrupo = tree.getNodeByProperty("etiquetaGrupo","menu_"+id) |
295 | var sUrl = "../php/arvore.php?funcao=adicionarTemaRaiz&id_menu="+id; | 294 | var sUrl = "../php/arvore.php?funcao=adicionarTemaRaiz&id_menu="+id; |
@@ -313,7 +312,7 @@ function novoTemaRaizGrupo(idmenu,id) | @@ -313,7 +312,7 @@ function novoTemaRaizGrupo(idmenu,id) | ||
313 | { | 312 | { |
314 | core_carregando("ativa"); | 313 | core_carregando("ativa"); |
315 | var mensagem = " adicionando tema..."; | 314 | var mensagem = " adicionando tema..."; |
316 | - core_carregando("mensagem"); | 315 | + core_carregando(mensagem); |
317 | var no = tree.getNodeByProperty("id_n1",id) | 316 | var no = tree.getNodeByProperty("id_n1",id) |
318 | var noEtiquetaSubGrupo = tree.getNodeByProperty("etiquetaTemasSubGrupo",id) | 317 | var noEtiquetaSubGrupo = tree.getNodeByProperty("etiquetaTemasSubGrupo",id) |
319 | var sUrl = "../php/arvore.php?funcao=adicionarTemaRaizGrupo&id_n1="+id+"&id_menu="+idmenu; | 318 | var sUrl = "../php/arvore.php?funcao=adicionarTemaRaizGrupo&id_n1="+id+"&id_menu="+idmenu; |
@@ -341,7 +340,7 @@ function novoGrupo(id_menu) | @@ -341,7 +340,7 @@ function novoGrupo(id_menu) | ||
341 | { | 340 | { |
342 | core_carregando("ativa"); | 341 | core_carregando("ativa"); |
343 | var mensagem = " adicionando grupo..."; | 342 | var mensagem = " adicionando grupo..."; |
344 | - core_carregando("mensagem"); | 343 | + core_carregando(mensagem); |
345 | var sUrl = "../php/arvore.php?funcao=adicionarGrupo&id_menu="+id_menu; | 344 | var sUrl = "../php/arvore.php?funcao=adicionarGrupo&id_menu="+id_menu; |
346 | var callback = | 345 | var callback = |
347 | { | 346 | { |
@@ -365,7 +364,7 @@ function novoSubGrupo(idmenu,id_n1) | @@ -365,7 +364,7 @@ function novoSubGrupo(idmenu,id_n1) | ||
365 | { | 364 | { |
366 | core_carregando("ativa"); | 365 | core_carregando("ativa"); |
367 | var mensagem = " adicionando Sub-grupo..."; | 366 | var mensagem = " adicionando Sub-grupo..."; |
368 | - core_carregando("mensagem"); | 367 | + core_carregando(mensagem); |
369 | var sUrl = "../php/arvore.php?funcao=adicionarSubGrupo&id_n1="+id_n1; | 368 | var sUrl = "../php/arvore.php?funcao=adicionarSubGrupo&id_n1="+id_n1; |
370 | var callback = | 369 | var callback = |
371 | { | 370 | { |
@@ -389,7 +388,7 @@ function novoTema(idmenu,id_n2) | @@ -389,7 +388,7 @@ function novoTema(idmenu,id_n2) | ||
389 | { | 388 | { |
390 | core_carregando("ativa"); | 389 | core_carregando("ativa"); |
391 | var mensagem = " adicionando tema..."; | 390 | var mensagem = " adicionando tema..."; |
392 | - core_carregando("mensagem"); | 391 | + core_carregando(mensagem); |
393 | var sUrl = "../php/arvore.php?funcao=adicionarTema&id_n2="+id_n2; | 392 | var sUrl = "../php/arvore.php?funcao=adicionarTema&id_n2="+id_n2; |
394 | var callback = | 393 | var callback = |
395 | { | 394 | { |
@@ -502,8 +501,7 @@ function montaDivGrupo(i) | @@ -502,8 +501,7 @@ function montaDivGrupo(i) | ||
502 | ins += "<select id='Epublicado' >" | 501 | ins += "<select id='Epublicado' >" |
503 | ins += core_combosimnao(i.publicado) | 502 | ins += core_combosimnao(i.publicado) |
504 | ins += "</select>" | 503 | ins += "</select>" |
505 | - ins += "<br><br>Para criar um novo grupo clique <a href='grupos.html' >aqui</a>." | ||
506 | - ins += "<br><br>Para criar um novo perfil clique <a href='perfis.html' >aqui</a>." | 504 | + ins += "<br><br><br><br>" |
507 | ins += "<input type=hidden value="+i.ordem+" id='Eordem' />" | 505 | ins += "<input type=hidden value="+i.ordem+" id='Eordem' />" |
508 | return(ins) | 506 | return(ins) |
509 | } | 507 | } |
@@ -518,8 +516,7 @@ function montaDivSubGrupo(i) | @@ -518,8 +516,7 @@ function montaDivSubGrupo(i) | ||
518 | ins += "<select id='Epublicado' >" | 516 | ins += "<select id='Epublicado' >" |
519 | ins += core_combosimnao(i.publicado) | 517 | ins += core_combosimnao(i.publicado) |
520 | ins += "</select>" | 518 | ins += "</select>" |
521 | - ins += "<br><br>Para criar um novo sub-grupo clique <a href='subgrupos.html' >aqui</a>." | ||
522 | - ins += "<br><br>Para criar um novo perfil clique <a href='perfis.html' >aqui</a>." | 519 | + ins += "<br><br><br><br>" |
523 | ins += "<input type=hidden value="+i.ordem+" id='Eordem' />" | 520 | ins += "<input type=hidden value="+i.ordem+" id='Eordem' />" |
524 | return(ins) | 521 | return(ins) |
525 | } | 522 | } |
@@ -612,6 +609,7 @@ function gravaDados(tipo,id) | @@ -612,6 +609,7 @@ function gravaDados(tipo,id) | ||
612 | var texto = obj.options[obj.selectedIndex].text | 609 | var texto = obj.options[obj.selectedIndex].text |
613 | var no = tree.getNodeByProperty("id_n1",id) | 610 | var no = tree.getNodeByProperty("id_n1",id) |
614 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto | 611 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto |
612 | + no.html = no.getContentEl().innerHTML; | ||
615 | } | 613 | } |
616 | if(tipo == "subgrupo") | 614 | if(tipo == "subgrupo") |
617 | { | 615 | { |
@@ -619,6 +617,7 @@ function gravaDados(tipo,id) | @@ -619,6 +617,7 @@ function gravaDados(tipo,id) | ||
619 | var texto = obj.options[obj.selectedIndex].text | 617 | var texto = obj.options[obj.selectedIndex].text |
620 | var no = tree.getNodeByProperty("id_n2",id) | 618 | var no = tree.getNodeByProperty("id_n2",id) |
621 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto | 619 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto |
620 | + no.html = no.getContentEl().innerHTML; | ||
622 | } | 621 | } |
623 | if(tipo == "tema") | 622 | if(tipo == "tema") |
624 | { | 623 | { |
@@ -626,6 +625,7 @@ function gravaDados(tipo,id) | @@ -626,6 +625,7 @@ function gravaDados(tipo,id) | ||
626 | var texto = obj.options[obj.selectedIndex].text | 625 | var texto = obj.options[obj.selectedIndex].text |
627 | var no = tree.getNodeByProperty("id_n3",id) | 626 | var no = tree.getNodeByProperty("id_n3",id) |
628 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto | 627 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto |
628 | + no.html = no.getContentEl().innerHTML; | ||
629 | } | 629 | } |
630 | if(tipo == "raizmenu" || tipo == "raizgrupo") | 630 | if(tipo == "raizmenu" || tipo == "raizgrupo") |
631 | { | 631 | { |
@@ -633,6 +633,7 @@ function gravaDados(tipo,id) | @@ -633,6 +633,7 @@ function gravaDados(tipo,id) | ||
633 | var texto = obj.options[obj.selectedIndex].text | 633 | var texto = obj.options[obj.selectedIndex].text |
634 | var no = tree.getNodeByProperty("id_raiz",id) | 634 | var no = tree.getNodeByProperty("id_raiz",id) |
635 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto | 635 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto |
636 | + no.html = no.getContentEl().innerHTML; | ||
636 | } | 637 | } |
637 | core_carregando("desativa"); | 638 | core_carregando("desativa"); |
638 | } | 639 | } |
admin/js/atlas.js
@@ -419,16 +419,19 @@ function gravaDados(tipo,id) | @@ -419,16 +419,19 @@ function gravaDados(tipo,id) | ||
419 | { | 419 | { |
420 | var no = tree.getNodeByProperty("id_atlas",id) | 420 | var no = tree.getNodeByProperty("id_atlas",id) |
421 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_atlas").value | 421 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_atlas").value |
422 | + no.html = no.getContentEl().innerHTML; | ||
422 | } | 423 | } |
423 | if(tipo == "prancha") | 424 | if(tipo == "prancha") |
424 | { | 425 | { |
425 | var no = tree.getNodeByProperty("id_prancha",id) | 426 | var no = tree.getNodeByProperty("id_prancha",id) |
426 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_prancha").value | 427 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_prancha").value |
428 | + no.html = no.getContentEl().innerHTML; | ||
427 | } | 429 | } |
428 | if(tipo == "tema") | 430 | if(tipo == "tema") |
429 | { | 431 | { |
430 | var no = tree.getNodeByProperty("id_tema",id) | 432 | var no = tree.getNodeByProperty("id_tema",id) |
431 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Ecodigo_tema").value | 433 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Ecodigo_tema").value |
434 | + no.html = no.getContentEl().innerHTML; | ||
432 | } | 435 | } |
433 | core_carregando("desativa"); | 436 | core_carregando("desativa"); |
434 | } | 437 | } |
admin/js/core.js
@@ -146,6 +146,7 @@ o - string retornada pelo ajax | @@ -146,6 +146,7 @@ o - string retornada pelo ajax | ||
146 | function core_handleFailure(o,texto) | 146 | function core_handleFailure(o,texto) |
147 | { | 147 | { |
148 | //div onde será mostrado o log | 148 | //div onde será mostrado o log |
149 | + alert(texto) | ||
149 | if(!$i('logajax')) | 150 | if(!$i('logajax')) |
150 | {return;} | 151 | {return;} |
151 | log = $i('logajax'); | 152 | log = $i('logajax'); |
@@ -315,7 +316,7 @@ function core_pegaPerfis(funcao) | @@ -315,7 +316,7 @@ function core_pegaPerfis(funcao) | ||
315 | if(funcao != "") | 316 | if(funcao != "") |
316 | eval(funcao); | 317 | eval(funcao); |
317 | } | 318 | } |
318 | - catch(e){core_handleFailure(e,o.responseText);} | 319 | + catch(e){core_handleFailure(o,o.responseText);} |
319 | }, | 320 | }, |
320 | failure:core_handleFailure, | 321 | failure:core_handleFailure, |
321 | argument: { foo:"foo", bar:"bar" } | 322 | argument: { foo:"foo", bar:"bar" } |
@@ -347,7 +348,7 @@ function core_pegaMapfiles(funcaoM) | @@ -347,7 +348,7 @@ function core_pegaMapfiles(funcaoM) | ||
347 | if(funcaoM != "") | 348 | if(funcaoM != "") |
348 | eval(funcaoM); | 349 | eval(funcaoM); |
349 | } | 350 | } |
350 | - catch(e){core_handleFailure(e.responseText);} | 351 | + catch(e){core_handleFailure(o,o.responseText);} |
351 | }, | 352 | }, |
352 | failure:core_handleFailure, | 353 | failure:core_handleFailure, |
353 | argument: { foo:"foo", bar:"bar" } | 354 | argument: { foo:"foo", bar:"bar" } |
@@ -871,7 +872,12 @@ function core_pegaDados(mensagem,sUrl,funcaoRetorno) | @@ -871,7 +872,12 @@ function core_pegaDados(mensagem,sUrl,funcaoRetorno) | ||
871 | success:function(o) | 872 | success:function(o) |
872 | { | 873 | { |
873 | try | 874 | try |
874 | - {eval(funcaoRetorno+"(YAHOO.lang.JSON.parse(o.responseText))");} | 875 | + { |
876 | + if(funcaoRetorno != "") | ||
877 | + eval(funcaoRetorno+"(YAHOO.lang.JSON.parse(o.responseText))"); | ||
878 | + else | ||
879 | + core_carregando("desativa"); | ||
880 | + } | ||
875 | catch(e) | 881 | catch(e) |
876 | { | 882 | { |
877 | if("mensagem" != "") | 883 | if("mensagem" != "") |
@@ -910,6 +916,9 @@ function core_gravaLinha(mensagem,row,sUrl) | @@ -910,6 +916,9 @@ function core_gravaLinha(mensagem,row,sUrl) | ||
910 | var rec = myDataTable.getRecordSet().getRecord(row); | 916 | var rec = myDataTable.getRecordSet().getRecord(row); |
911 | myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]) | 917 | myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]) |
912 | core_carregando("desativa"); | 918 | core_carregando("desativa"); |
919 | + var linha = myDataTable.getTrEl(rec) | ||
920 | + linha.style.color = ""; | ||
921 | + | ||
913 | }, | 922 | }, |
914 | failure:core_handleFailure, | 923 | failure:core_handleFailure, |
915 | argument: { foo:"foo", bar:"bar" } | 924 | argument: { foo:"foo", bar:"bar" } |
@@ -1090,6 +1099,11 @@ function core_montaEditor(funcaoOK,w,h) | @@ -1090,6 +1099,11 @@ function core_montaEditor(funcaoOK,w,h) | ||
1090 | YAHOO.example.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:true,close:true,width:w, overflow:"auto",modal: true,visible:false,constraintoviewport:true } ); | 1099 | YAHOO.example.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:true,close:true,width:w, overflow:"auto",modal: true,visible:false,constraintoviewport:true } ); |
1091 | YAHOO.example.container.panelEditor.render(); | 1100 | YAHOO.example.container.panelEditor.render(); |
1092 | } | 1101 | } |
1102 | + else | ||
1103 | + { | ||
1104 | + if($i("editor_bd")) | ||
1105 | + $i("editor_bd").innerHTML == "" | ||
1106 | + } | ||
1093 | YAHOO.example.container.panelEditor.show(); | 1107 | YAHOO.example.container.panelEditor.show(); |
1094 | } | 1108 | } |
1095 | 1109 |
admin/js/editormapfile.js
@@ -180,7 +180,6 @@ function montaNosRaiz(redesenha) | @@ -180,7 +180,6 @@ function montaNosRaiz(redesenha) | ||
180 | conteudo = " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluirMapfile('"+$mapfiles[i]+"')\" title=excluir src=\"../imagens/01.png\" />" | 180 | conteudo = " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluirMapfile('"+$mapfiles[i]+"')\" title=excluir src=\"../imagens/01.png\" />" |
181 | conteudo += " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editorTemaMapfile('"+$mapfiles[i]+"')\" title='editar tema associado' src=\"../imagens/06.png\" />" | 181 | conteudo += " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editorTemaMapfile('"+$mapfiles[i]+"')\" title='editar tema associado' src=\"../imagens/06.png\" />" |
182 | conteudo += " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"testarMapfile('"+$mapfiles[i]+"')\" title='testar!' src=\"../imagens/41.png\" /><b> <span>"+$mapfiles[i]+"</span>" | 182 | conteudo += " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"testarMapfile('"+$mapfiles[i]+"')\" title='testar!' src=\"../imagens/41.png\" /><b> <span>"+$mapfiles[i]+"</span>" |
183 | - | ||
184 | var d = {html:conteudo,id:$mapfiles[i],codigoMap:$mapfiles[i]}; | 183 | var d = {html:conteudo,id:$mapfiles[i],codigoMap:$mapfiles[i]}; |
185 | var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); | 184 | var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); |
186 | nos.push(tempNode) | 185 | nos.push(tempNode) |
admin/js/grupos.js
@@ -99,6 +99,12 @@ function montaTabela_G(dados) | @@ -99,6 +99,12 @@ function montaTabela_G(dados) | ||
99 | { | 99 | { |
100 | this.cancelCellEditor(); | 100 | this.cancelCellEditor(); |
101 | }); | 101 | }); |
102 | + myDataTable.subscribe("editorSaveEvent", function(oArgs) | ||
103 | + { | ||
104 | + if(oArgs.newData != oArgs.oldData) | ||
105 | + var linha = myDataTable.getTrEl(oArgs.editor.record) | ||
106 | + linha.style.color = "blue"; | ||
107 | + }); | ||
102 | }; | 108 | }; |
103 | core_carregando("desativa"); | 109 | core_carregando("desativa"); |
104 | } | 110 | } |
admin/js/listatemas.js
@@ -9,7 +9,7 @@ function montaEditorTema(dados) | @@ -9,7 +9,7 @@ function montaEditorTema(dados) | ||
9 | var ins = ""; | 9 | var ins = ""; |
10 | if(p_oEvent.newValue.get("value") == "OK") | 10 | if(p_oEvent.newValue.get("value") == "OK") |
11 | { | 11 | { |
12 | - gravaDadosTema(dados.id_tema); | 12 | + gravaDadosTema(dados[0].id_tema); |
13 | } | 13 | } |
14 | else | 14 | else |
15 | { | 15 | { |
@@ -57,7 +57,7 @@ function montaDivTemas(i) | @@ -57,7 +57,7 @@ function montaDivTemas(i) | ||
57 | { | 57 | { |
58 | var param = { | 58 | var param = { |
59 | "linhas":[ | 59 | "linhas":[ |
60 | - {titulo:"Nome do tema que será mostrado na árvore de menus:",id:"nome_tema",size:"50",value:i.nome_tema,tipo:"text",div:""} | 60 | + {titulo:"Nome que será mostrado na árvore de menus:",id:"nome_tema",size:"50",value:i.nome_tema,tipo:"text",div:""} |
61 | ] | 61 | ] |
62 | } | 62 | } |
63 | var ins = "" | 63 | var ins = "" |
@@ -100,7 +100,7 @@ function montaDivTemas(i) | @@ -100,7 +100,7 @@ function montaDivTemas(i) | ||
100 | } | 100 | } |
101 | function gravaDadosTema(id) | 101 | function gravaDadosTema(id) |
102 | { | 102 | { |
103 | - var campos = new Array("nome","codigo","desc","link","tags","tipo","ogc","download","kml") | 103 | + var campos = new Array("nome","desc","link","tags","tipo","ogc","download","kml") |
104 | var par = "" | 104 | var par = "" |
105 | for (i=0;i<campos.length;i++) | 105 | for (i=0;i<campos.length;i++) |
106 | {par += "&"+campos[i]+"="+($i(campos[i]+"_tema").value)} | 106 | {par += "&"+campos[i]+"="+($i(campos[i]+"_tema").value)} |
@@ -133,5 +133,5 @@ function gravaDadosTema(id) | @@ -133,5 +133,5 @@ function gravaDadosTema(id) | ||
133 | failure:core_handleFailure, | 133 | failure:core_handleFailure, |
134 | argument: { foo:"foo", bar:"bar" } | 134 | argument: { foo:"foo", bar:"bar" } |
135 | }; | 135 | }; |
136 | - core_makeRequest(sUrl,callback) | 136 | + core_makeRequest(sUrl,callback,"POST") |
137 | } | 137 | } |
138 | \ No newline at end of file | 138 | \ No newline at end of file |
admin/js/mapfiles.js
@@ -80,7 +80,10 @@ Salva o novo valor de uma variável | @@ -80,7 +80,10 @@ Salva o novo valor de uma variável | ||
80 | */ | 80 | */ |
81 | function salva(variavel) | 81 | function salva(variavel) |
82 | { | 82 | { |
83 | - core_pegaDados("gravando...","../php/mapfiles.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value) | 83 | + var original = $i(variavel).value; |
84 | + $i(variavel).value = "gravando..." | ||
85 | + core_pegaDados("gravando...","../php/mapfiles.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value,"") | ||
84 | $i(variavel).style.color = "" | 86 | $i(variavel).style.color = "" |
87 | + $i(variavel).value = original | ||
85 | } | 88 | } |
86 | YAHOO.util.Event.addListener(window, "load", initMenu); | 89 | YAHOO.util.Event.addListener(window, "load", initMenu); |
87 | \ No newline at end of file | 90 | \ No newline at end of file |
admin/js/menu.js
@@ -106,6 +106,13 @@ function montaTabela_M(dados) | @@ -106,6 +106,13 @@ function montaTabela_M(dados) | ||
106 | { | 106 | { |
107 | this.cancelCellEditor(); | 107 | this.cancelCellEditor(); |
108 | }); | 108 | }); |
109 | + myDataTable.subscribe("editorSaveEvent", function(oArgs) | ||
110 | + { | ||
111 | + if(oArgs.newData != oArgs.oldData) | ||
112 | + var linha = myDataTable.getTrEl(oArgs.editor.record) | ||
113 | + linha.style.color = "blue"; | ||
114 | + }); | ||
115 | + | ||
109 | }; | 116 | }; |
110 | core_carregando("desativa"); | 117 | core_carregando("desativa"); |
111 | } | 118 | } |
admin/js/ms_configura.js
@@ -96,8 +96,11 @@ function salva(variavel) | @@ -96,8 +96,11 @@ function salva(variavel) | ||
96 | {alert("erro")} | 96 | {alert("erro")} |
97 | else | 97 | else |
98 | { | 98 | { |
99 | - core_pegaDados("gravando...","../php/ms_configura.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value,function(){core_carregando("desativa");}) | 99 | + var original = $i(variavel).value; |
100 | + $i(variavel).value = "gravando..."; | ||
101 | + core_pegaDados("gravando...","../php/ms_configura.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value,"") | ||
100 | $i(variavel).style.color = "" | 102 | $i(variavel).style.color = "" |
103 | + $i(variavel).value = original; | ||
101 | } | 104 | } |
102 | } | 105 | } |
103 | YAHOO.util.Event.addListener(window, "load", initMenu); | 106 | YAHOO.util.Event.addListener(window, "load", initMenu); |
104 | \ No newline at end of file | 107 | \ No newline at end of file |
admin/js/perfis.js
@@ -80,17 +80,25 @@ function montaTabela(dados) | @@ -80,17 +80,25 @@ function montaTabela(dados) | ||
80 | excluiLinha(record.getData('id_perfil'),target); | 80 | excluiLinha(record.getData('id_perfil'),target); |
81 | } | 81 | } |
82 | else | 82 | else |
83 | - {this.onEventShowCellEditor(ev);} | 83 | + { |
84 | + this.onEventShowCellEditor(ev); | ||
85 | + } | ||
84 | }); | 86 | }); |
85 | // Hook into custom event to customize save-flow of "radio" editor | 87 | // Hook into custom event to customize save-flow of "radio" editor |
86 | myDataTable.subscribe("editorUpdateEvent", function(oArgs) | 88 | myDataTable.subscribe("editorUpdateEvent", function(oArgs) |
87 | { | 89 | { |
88 | if(oArgs.editor.column.key === "active") | 90 | if(oArgs.editor.column.key === "active") |
89 | { | 91 | { |
90 | - this.saveCellEditor(); | ||
91 | - | 92 | + this.saveCellEditor(); |
92 | } | 93 | } |
93 | }); | 94 | }); |
95 | + myDataTable.subscribe("editorSaveEvent", function(oArgs) | ||
96 | + { | ||
97 | + if(oArgs.newData != oArgs.oldData) | ||
98 | + var linha = myDataTable.getTrEl(oArgs.editor.record) | ||
99 | + linha.style.color = "blue"; | ||
100 | + }); | ||
101 | + | ||
94 | myDataTable.subscribe("editorBlurEvent", function(oArgs) | 102 | myDataTable.subscribe("editorBlurEvent", function(oArgs) |
95 | { | 103 | { |
96 | this.cancelCellEditor(); | 104 | this.cancelCellEditor(); |
admin/js/sistemas.js
@@ -270,6 +270,7 @@ function gravaDadosFuncao(id) | @@ -270,6 +270,7 @@ function gravaDadosFuncao(id) | ||
270 | { | 270 | { |
271 | var no = tree.getNodeByProperty("id_funcao",id) | 271 | var no = tree.getNodeByProperty("id_funcao",id) |
272 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Enome_funcao").value | 272 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Enome_funcao").value |
273 | + no.html = no.getContentEl().innerHTML; | ||
273 | core_carregando("desativa"); | 274 | core_carregando("desativa"); |
274 | } | 275 | } |
275 | YAHOO.example.container.panelEditor.destroy(); | 276 | YAHOO.example.container.panelEditor.destroy(); |
@@ -307,6 +308,7 @@ function gravaDadosSistema(id) | @@ -307,6 +308,7 @@ function gravaDadosSistema(id) | ||
307 | { | 308 | { |
308 | var no = tree.getNodeByProperty("id_sistema",id) | 309 | var no = tree.getNodeByProperty("id_sistema",id) |
309 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Enome_sistema").value | 310 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Enome_sistema").value |
311 | + no.html = no.getContentEl().innerHTML; | ||
310 | core_carregando("desativa"); | 312 | core_carregando("desativa"); |
311 | } | 313 | } |
312 | YAHOO.example.container.panelEditor.destroy(); | 314 | YAHOO.example.container.panelEditor.destroy(); |
admin/js/subgrupos.js
@@ -98,6 +98,13 @@ function montaTabela_S(dados) | @@ -98,6 +98,13 @@ function montaTabela_S(dados) | ||
98 | { | 98 | { |
99 | this.cancelCellEditor(); | 99 | this.cancelCellEditor(); |
100 | }); | 100 | }); |
101 | + myDataTable.subscribe("editorSaveEvent", function(oArgs) | ||
102 | + { | ||
103 | + if(oArgs.newData != oArgs.oldData) | ||
104 | + var linha = myDataTable.getTrEl(oArgs.editor.record) | ||
105 | + linha.style.color = "blue"; | ||
106 | + }); | ||
107 | + | ||
101 | }; | 108 | }; |
102 | core_carregando("desativa"); | 109 | core_carregando("desativa"); |
103 | } | 110 | } |
admin/js/tags.js
@@ -95,6 +95,13 @@ function montaTabela(dados) | @@ -95,6 +95,13 @@ function montaTabela(dados) | ||
95 | { | 95 | { |
96 | this.cancelCellEditor(); | 96 | this.cancelCellEditor(); |
97 | }); | 97 | }); |
98 | + myDataTable.subscribe("editorSaveEvent", function(oArgs) | ||
99 | + { | ||
100 | + if(oArgs.newData != oArgs.oldData) | ||
101 | + var linha = myDataTable.getTrEl(oArgs.editor.record) | ||
102 | + linha.style.color = "blue"; | ||
103 | + }); | ||
104 | + | ||
98 | }; | 105 | }; |
99 | core_carregando("desativa"); | 106 | core_carregando("desativa"); |
100 | } | 107 | } |
admin/js/temasold.js
@@ -1,244 +0,0 @@ | @@ -1,244 +0,0 @@ | ||
1 | -/* | ||
2 | -Title: Arvore | ||
3 | - | ||
4 | -Funções javascript utilizadas no sistema de administração do menu de mapas | ||
5 | - | ||
6 | -File: i3geo/admin/mapas.js | ||
7 | - | ||
8 | -About: Licença | ||
9 | - | ||
10 | -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
11 | - | ||
12 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
13 | -Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
14 | - | ||
15 | -Este programa é software livre; você pode redistribuí-lo | ||
16 | -e/ou modificá-lo sob os termos da Licença Pública Geral | ||
17 | -GNU conforme publicada pela Free Software Foundation; | ||
18 | -tanto a versão 2 da Licença. | ||
19 | -Este programa é distribuído na expectativa de que seja útil, | ||
20 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
21 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
22 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
23 | -Você deve ter recebido uma cópia da Licença Pública Geral do | ||
24 | -GNU junto com este programa; se não, escreva para a | ||
25 | -Free Software Foundation, Inc., no endereço | ||
26 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
27 | -*/ | ||
28 | - | ||
29 | -$i = function(i) | ||
30 | -{return document.getElementById(i);}; | ||
31 | - | ||
32 | -YAHOO.namespace("example.container"); | ||
33 | - | ||
34 | -function pegaClasses(codigoMap,codigoLayer) | ||
35 | -{ | ||
36 | - var ins = "<br><fieldset style='background-color:beige'><legend>+- Classes</legend><div style=display:none >" | ||
37 | - ins += "<p><input onclick=adicionarClasse('"+codigoLayer+"',this) type=button value='Adicionar classe' /></p>" | ||
38 | - ins += "<br><fieldset><legend>+- Legenda (amostra)</legend><div style=display:none >" | ||
39 | - ins += "<img id='legenda_"+codigoLayer+"' src='../ogc.php?tema=bioma&service=wms&request=getlegendgraphic&layer="+codigoLayer+"&format=image/png' />" | ||
40 | - ins += "</div></fieldset>" | ||
41 | - var retorna = function(retorna) | ||
42 | - { | ||
43 | - var nc = retorna.data.length | ||
44 | - for(c=0;c<nc;c++) | ||
45 | - { | ||
46 | - d = retorna.data[c] | ||
47 | - | ||
48 | - ins += (geraLinhas2(d.dados,param,"salvarClasse")); | ||
49 | - | ||
50 | - var param = { | ||
51 | - "linhas":[ | ||
52 | - ] | ||
53 | - } | ||
54 | - | ||
55 | - ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | ||
56 | - ins += (geraLinhas2(d.dados,param,"salvarClasse")); | ||
57 | - ins += "</fieldset>" | ||
58 | - //labels | ||
59 | - ins += "<br><fieldset><legend style=color:brown >+- Label (para ativar, defina LABELITEM em caract. gerais)</legend><div style=display:none >" | ||
60 | - var param = { | ||
61 | - "linhas":[ | ||
62 | - ] | ||
63 | - } | ||
64 | - | ||
65 | - | ||
66 | - ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | ||
67 | - var param = { | ||
68 | - "linhas":[ | ||
69 | - ] | ||
70 | - } | ||
71 | - ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | ||
72 | - ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | ||
73 | - ins += "</fieldset>" | ||
74 | - | ||
75 | - ins += "</div></fieldset>" | ||
76 | - | ||
77 | - ins += "<br><fieldset><legend style=color:brown >+- Estilos</legend><div style=display:none >" | ||
78 | - ins += "<p><input onclick=adicionarEstilo('"+codigoLayer+"','"+d.id+"',this) type=button value='Adicionar estilo' /></p>" | ||
79 | - ins += "<div id='estilos_"+codigoLayer+"_"+d.id+"' ></div>" | ||
80 | - ins += "</div></fieldset>" | ||
81 | - ins += "</div></fieldset>" | ||
82 | - } | ||
83 | - ins += "</div></fieldset>" | ||
84 | - $i("classes_"+codigoLayer+"_"+codigoMap).innerHTML = ins | ||
85 | - pegaEstilos(codigoMap,codigoLayer) | ||
86 | - } | ||
87 | - var p = "../php/temas.php?funcao=pegaClasses&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
88 | - cPaint.call(p,"",retorna); | ||
89 | - | ||
90 | -} | ||
91 | -function pegaEstilos(codigoMap,codigoLayer) | ||
92 | -{ | ||
93 | - | ||
94 | - } | ||
95 | - var p = "../php/temas.php?funcao=pegaEstilos&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
96 | - cPaint.call(p,"",retorna); | ||
97 | -} | ||
98 | - | ||
99 | -function testarMap() | ||
100 | -{ | ||
101 | - var codigo = $i("temaAtivo").value | ||
102 | - window.open("../testamapfile.php?map="+codigo+".map") | ||
103 | -} | ||
104 | -function salvarLayer(layer,parametro,icone) | ||
105 | -{ | ||
106 | - icone.src="../imagens/aguarde.gif" | ||
107 | - var retorna = function(retorno) | ||
108 | - {icone.src="../imagens/02.png";} | ||
109 | - var valor = $i(parametro+"_"+layer).value | ||
110 | - $i(parametro+"_"+layer).style.color="black" | ||
111 | - var p = "../php/temas.php?funcao=alteraLayer&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | ||
112 | - cPaint.call(p,"",retorna); | ||
113 | -} | ||
114 | -function salvarMetadados(layer,parametro,icone) | ||
115 | -{ | ||
116 | - icone.src="../imagens/aguarde.gif" | ||
117 | - var retorna = function(retorno) | ||
118 | - {icone.src="../imagens/02.png";} | ||
119 | - var valor = $i(parametro+"_"+layer).value | ||
120 | - $i(parametro+"_"+layer).style.color="black" | ||
121 | - var p = "../php/temas.php?funcao=alteraMetadados&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | ||
122 | - cPaint.call(p,"",retorna); | ||
123 | -} | ||
124 | -function salvarClasse(layer,parametro,icone) | ||
125 | -{ | ||
126 | - icone.src="../imagens/aguarde.gif" | ||
127 | - var temp = layer.split("_") | ||
128 | - var layer = temp[0] | ||
129 | - var classe = temp[1] | ||
130 | - var retorna = function(retorno) | ||
131 | - { | ||
132 | - icone.src="../imagens/02.png"; | ||
133 | - contaN++ | ||
134 | - $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | ||
135 | - } | ||
136 | - var valor = $i(parametro+"_"+layer+"_"+classe).value | ||
137 | - $i(parametro+"_"+layer+"_"+classe).style.color="black" | ||
138 | - var p = "../php/temas.php?funcao=alteraClasse&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | ||
139 | - cPaint.call(p,"",retorna); | ||
140 | -} | ||
141 | -function salvarClasseLabel(layer,parametro,icone) | ||
142 | -{ | ||
143 | - icone.src="../imagens/aguarde.gif" | ||
144 | - var temp = layer.split("_") | ||
145 | - var layer = temp[0] | ||
146 | - var classe = temp[1] | ||
147 | - var parametro = parametro.split("."); | ||
148 | - var parametro = parametro[1] | ||
149 | - var retorna = function(retorno) | ||
150 | - {icone.src="../imagens/02.png";} | ||
151 | - var valor = $i("label_"+parametro+"_"+layer+"_"+classe).value | ||
152 | - $i("label_"+parametro+"_"+layer+"_"+classe).style.color="black" | ||
153 | - var p = "../php/temas.php?funcao=alteraClasseLabel&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | ||
154 | - cPaint.call(p,"",retorna); | ||
155 | -} | ||
156 | -function salvarEstilo(estilo,parametro,icone) | ||
157 | -{ | ||
158 | - icone.src="../imagens/aguarde.gif" | ||
159 | - var temp = estilo.split("_") | ||
160 | - var layer = temp[1] | ||
161 | - var classe = temp[2] | ||
162 | - var estilo = temp[3] | ||
163 | - var retorna = function(retorno) | ||
164 | - { | ||
165 | - icone.src="../imagens/02.png"; | ||
166 | - contaN++ | ||
167 | - $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | ||
168 | - } | ||
169 | - var valor = $i(parametro+"_"+layer+"_"+classe+"_"+estilo).value | ||
170 | - $i(parametro+"_"+layer+"_"+classe+"_"+estilo).style.color="black" | ||
171 | - var p = "../php/temas.php?funcao=alteraEstilo&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"&estilo="+estilo+"¶metro="+parametro+"&valor="+valor; | ||
172 | - cPaint.call(p,"",retorna); | ||
173 | -} | ||
174 | -function adicionarClasse(codigoLayer,botao) | ||
175 | -{ | ||
176 | - botao.style.color="red" | ||
177 | - var o = botao.value | ||
178 | - botao.value = "Aguarde..." | ||
179 | - var codigoMap = $i("temaAtivo").value | ||
180 | - if(codigoMap != "") | ||
181 | - { | ||
182 | - var retorna = function(retorno) | ||
183 | - { | ||
184 | - pegaClasses(codigoMap,codigoLayer) | ||
185 | - } | ||
186 | - var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
187 | - cPaint.call(p,"",retorna); | ||
188 | - } | ||
189 | -} | ||
190 | -function adicionarEstilo(codigoLayer,codigoClasse,botao) | ||
191 | -{ | ||
192 | - botao.style.color="red" | ||
193 | - var o = botao.value | ||
194 | - botao.value = "Aguarde..." | ||
195 | - var codigoMap = $i("temaAtivo").value | ||
196 | - if(codigoMap != "") | ||
197 | - { | ||
198 | - var retorna = function(retorno) | ||
199 | - { | ||
200 | - pegaEstilos(codigoMap,codigoLayer) | ||
201 | - } | ||
202 | - var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | ||
203 | - cPaint.call(p,"",retorna); | ||
204 | - } | ||
205 | -} | ||
206 | -function excluirClasse(codigoLayer,codigoClasse,botao) | ||
207 | -{ | ||
208 | - if(confirm("Você realmente quer fazer isso?")) | ||
209 | - { | ||
210 | - botao.style.color="red" | ||
211 | - var o = botao.value | ||
212 | - botao.value = "Aguarde..." | ||
213 | - var codigoMap = $i("temaAtivo").value | ||
214 | - if(codigoMap != "") | ||
215 | - { | ||
216 | - var retorna = function(retorno) | ||
217 | - { | ||
218 | - pegaClasses(codigoMap,codigoLayer) | ||
219 | - } | ||
220 | - var p = "../php/temas.php?funcao=excluirClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | ||
221 | - cPaint.call(p,"",retorna); | ||
222 | - } | ||
223 | - } | ||
224 | -} | ||
225 | -function excluirLayer(codigoLayer,botao) | ||
226 | -{ | ||
227 | - if(confirm("Você realmente quer fazer isso?")) | ||
228 | - { | ||
229 | - botao.style.color="red" | ||
230 | - var o = botao.value | ||
231 | - botao.value = "Aguarde..." | ||
232 | - var codigoMap = $i("temaAtivo").value | ||
233 | - if(codigoMap != "") | ||
234 | - { | ||
235 | - var retorna = function(retorno) | ||
236 | - { | ||
237 | - ativaTema(codigoMap) | ||
238 | - } | ||
239 | - var p = "../php/temas.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
240 | - cPaint.call(p,"",retorna); | ||
241 | - } | ||
242 | - } | ||
243 | -} | ||
244 | -YAHOO.util.Event.addListener(window, "load", initMenu); | ||
245 | \ No newline at end of file | 0 | \ No newline at end of file |
admin/js/webservices.js
@@ -150,16 +150,16 @@ function montaDiv(i) | @@ -150,16 +150,16 @@ function montaDiv(i) | ||
150 | ins += ">---</option>" | 150 | ins += ">---</option>" |
151 | ins += "<option value='WMS' " | 151 | ins += "<option value='WMS' " |
152 | if (i.tipo_ws == "WMS"){ins += "selected";} | 152 | if (i.tipo_ws == "WMS"){ins += "selected";} |
153 | - ins += " >WMS<option>" | 153 | + ins += " >WMS</option>" |
154 | ins += "<option value='GEORSS' " | 154 | ins += "<option value='GEORSS' " |
155 | if (i.tipo_ws == "GEORSS"){ins += "selected";} | 155 | if (i.tipo_ws == "GEORSS"){ins += "selected";} |
156 | - ins += " >GEORSS<option>" | 156 | + ins += " >GEORSS</option>" |
157 | ins += "<option value='WS' " | 157 | ins += "<option value='WS' " |
158 | if (i.tipo_ws == "WS"){ins += "selected";} | 158 | if (i.tipo_ws == "WS"){ins += "selected";} |
159 | - ins += " >WS<option>" | 159 | + ins += " >WS</option>" |
160 | ins += "<option value='DOWNLOAD' " | 160 | ins += "<option value='DOWNLOAD' " |
161 | if (i.tipo_ws == "DOWNLOAD"){ins += "selected";} | 161 | if (i.tipo_ws == "DOWNLOAD"){ins += "selected";} |
162 | - ins += " >DOWNLOAD<option>" | 162 | + ins += " >DOWNLOAD</option>" |
163 | ins += "</select></p>" | 163 | ins += "</select></p>" |
164 | return(ins) | 164 | return(ins) |
165 | } | 165 | } |
admin/php/admin.php
@@ -88,12 +88,18 @@ function retornaJSON($obj) | @@ -88,12 +88,18 @@ function retornaJSON($obj) | ||
88 | { | 88 | { |
89 | include_once($locaplic."/pacotes/cpaint/JSON/json2.php"); | 89 | include_once($locaplic."/pacotes/cpaint/JSON/json2.php"); |
90 | $j = new Services_JSON(); | 90 | $j = new Services_JSON(); |
91 | - echo $j->encode($obj); | 91 | + $texto = $j->encode($obj); |
92 | + if (!mb_detect_encoding($texto,"UTF-8",true)) | ||
93 | + $texto = utf8_encode($texto); | ||
94 | + echo $texto; | ||
92 | } | 95 | } |
93 | else | 96 | else |
94 | { | 97 | { |
95 | if(extension_loaded('zlib')){ob_start('ob_gzhandler');} | 98 | if(extension_loaded('zlib')){ob_start('ob_gzhandler');} |
96 | - echo json_encode($obj); | 99 | + $texto = json_encode($obj); |
100 | + if (!mb_detect_encoding($texto,"UTF-8",true)) | ||
101 | + $texto = utf8_encode($texto); | ||
102 | + echo $texto; | ||
97 | if(extension_loaded('zlib')){ob_end_flush();} | 103 | if(extension_loaded('zlib')){ob_end_flush();} |
98 | } | 104 | } |
99 | exit; | 105 | exit; |
@@ -122,6 +128,7 @@ string - sim|nao | @@ -122,6 +128,7 @@ string - sim|nao | ||
122 | function verificaEditores($editores) | 128 | function verificaEditores($editores) |
123 | { | 129 | { |
124 | $editor = "nao"; | 130 | $editor = "nao"; |
131 | + if($editores == ""){return $editor;} | ||
125 | foreach ($editores as $e) | 132 | foreach ($editores as $e) |
126 | { | 133 | { |
127 | $e = gethostbyname($e); | 134 | $e = gethostbyname($e); |
@@ -271,5 +278,20 @@ function verificaFilhos() | @@ -271,5 +278,20 @@ function verificaFilhos() | ||
271 | return "Error!: " . $e->getMessage(); | 278 | return "Error!: " . $e->getMessage(); |
272 | } | 279 | } |
273 | } | 280 | } |
274 | - | 281 | +function resolveAcentos($palavra,$tipo) |
282 | +{ | ||
283 | + if($tipo == "ISO") | ||
284 | + { | ||
285 | + $palavra = mb_convert_encoding($palavra,"AUTO","ISO-8859-1"); | ||
286 | + } | ||
287 | + if($tipo == "UTF") | ||
288 | + { | ||
289 | + $palavra = mb_convert_encoding($palavra,"AUTO","UTF-8"); | ||
290 | + } | ||
291 | + if($tipo == "html") | ||
292 | + $palavra = htmlentities($palavra); | ||
293 | + if($tipo == "palno") | ||
294 | + $palavra = urldecode($palavra); | ||
295 | + return $palavra; | ||
296 | +} | ||
275 | ?> | 297 | ?> |
276 | \ No newline at end of file | 298 | \ No newline at end of file |
admin/php/arvore.php
@@ -28,6 +28,7 @@ File: i3geo/admin/arvore.php | @@ -28,6 +28,7 @@ File: i3geo/admin/arvore.php | ||
28 | 28 | ||
29 | */ | 29 | */ |
30 | require_once("admin.php"); | 30 | require_once("admin.php"); |
31 | +error_reporting(0); | ||
31 | //faz a busca da função que deve ser executada | 32 | //faz a busca da função que deve ser executada |
32 | switch ($funcao) | 33 | switch ($funcao) |
33 | { | 34 | { |
@@ -160,13 +161,13 @@ Altera o registro de um nível 3 (temas) | @@ -160,13 +161,13 @@ Altera o registro de um nível 3 (temas) | ||
160 | */ | 161 | */ |
161 | function alteraN3() | 162 | function alteraN3() |
162 | { | 163 | { |
163 | - global $publicado,$n3_perfil,$id,$id_n2,$id_tema,$ordem; | 164 | + global $publicado,$n3_perfil,$id,$id_n2,$id_tema; |
164 | try | 165 | try |
165 | { | 166 | { |
166 | require_once("conexao.php"); | 167 | require_once("conexao.php"); |
167 | if($id != "") | 168 | if($id != "") |
168 | { | 169 | { |
169 | - $dbhw->query("UPDATE i3geoadmin_n3 SET publicado = '$publicado',ordem = '$ordem',id_tema = '$id_tema', n3_perfil = '$perfil' WHERE id_n3 = $id"); | 170 | + $dbhw->query("UPDATE i3geoadmin_n3 SET publicado = '$publicado',id_tema = '$id_tema', n3_perfil = '$n3_perfil' WHERE id_n3 = $id"); |
170 | $retorna = $id; | 171 | $retorna = $id; |
171 | } | 172 | } |
172 | else | 173 | else |
@@ -194,18 +195,18 @@ Altera o registro de um nível 2 | @@ -194,18 +195,18 @@ Altera o registro de um nível 2 | ||
194 | */ | 195 | */ |
195 | function alteraN2() | 196 | function alteraN2() |
196 | { | 197 | { |
197 | - global $publicado,$n2_perfil,$id,$id_subgrupo,$id_n1,$ordem; | 198 | + global $publicado,$n2_perfil,$id,$id_subgrupo,$id_n1; |
198 | try | 199 | try |
199 | { | 200 | { |
200 | require_once("conexao.php"); | 201 | require_once("conexao.php"); |
201 | if($id != "") | 202 | if($id != "") |
202 | { | 203 | { |
203 | - $dbhw->query("UPDATE i3geoadmin_n2 SET publicado='$publicado', ordem = '$ordem',id_subgrupo = '$id_subgrupo', n2_perfil = '$n2_perfil' WHERE id_n2 = $id"); | 204 | + $dbhw->query("UPDATE i3geoadmin_n2 SET publicado='$publicado', id_subgrupo = '$id_subgrupo', n2_perfil = '$n2_perfil' WHERE id_n2 = $id"); |
204 | $retorna = $id; | 205 | $retorna = $id; |
205 | } | 206 | } |
206 | else | 207 | else |
207 | { | 208 | { |
208 | - $o = $dbhw->query("SELECT MAX(ordem) as o FROM i3geoadmin_n2 where id_n1 = '$id_1'"); | 209 | + $o = $dbhw->query("SELECT MAX(ordem) as o FROM i3geoadmin_n2 where id_n1 = '$id_n1'"); |
209 | $o = $o->fetchAll(); | 210 | $o = $o->fetchAll(); |
210 | $o = $o[0]['o'] + 1; | 211 | $o = $o[0]['o'] + 1; |
211 | $dbhw->query("INSERT INTO i3geoadmin_n2 (id_n1,id_subgrupo,n2_perfil,ordem) VALUES ($id_n1,'', '',$o)"); | 212 | $dbhw->query("INSERT INTO i3geoadmin_n2 (id_n1,id_subgrupo,n2_perfil,ordem) VALUES ($id_n1,'', '',$o)"); |
@@ -230,13 +231,13 @@ Altera o registro de um nível 1 (grupos) | @@ -230,13 +231,13 @@ Altera o registro de um nível 1 (grupos) | ||
230 | */ | 231 | */ |
231 | function alteraN1() | 232 | function alteraN1() |
232 | { | 233 | { |
233 | - global $publicado,$n1_perfil,$id_grupo,$id,$id_menu,$ordem; | 234 | + global $publicado,$n1_perfil,$id_grupo,$id,$id_menu; |
234 | try | 235 | try |
235 | { | 236 | { |
236 | require_once("conexao.php"); | 237 | require_once("conexao.php"); |
237 | if($id != "") | 238 | if($id != "") |
238 | { | 239 | { |
239 | - $dbhw->query("UPDATE i3geoadmin_n1 SET publicado = '$publicado', ordem = '$ordem', id_grupo = '$id_grupo', n1_perfil = '$n1_perfil' WHERE id_n1 = $id"); | 240 | + $dbhw->query("UPDATE i3geoadmin_n1 SET publicado = '$publicado', id_grupo = '$id_grupo', n1_perfil = '$n1_perfil' WHERE id_n1 = $id"); |
240 | $retorna = $id; | 241 | $retorna = $id; |
241 | } | 242 | } |
242 | else | 243 | else |
@@ -266,13 +267,13 @@ Altera o registro na raiz de um nível | @@ -266,13 +267,13 @@ Altera o registro na raiz de um nível | ||
266 | */ | 267 | */ |
267 | function alterarRaiz() | 268 | function alterarRaiz() |
268 | { | 269 | { |
269 | - global $id_nivel,$nivel,$id,$id_menu,$perfil,$id_tema,$ordem; | 270 | + global $id_nivel,$nivel,$id,$id_menu,$perfil,$id_tema; |
270 | try | 271 | try |
271 | { | 272 | { |
272 | include("conexao.php"); | 273 | include("conexao.php"); |
273 | if($id != "") | 274 | if($id != "") |
274 | { | 275 | { |
275 | - $dbhw->query("UPDATE i3geoadmin_raiz SET ordem = '$ordem', perfil = '$perfil', id_tema = '$id_tema' WHERE id_raiz = $id"); | 276 | + $dbhw->query("UPDATE i3geoadmin_raiz SET perfil = '$perfil', id_tema = '$id_tema' WHERE id_raiz = $id"); |
276 | $retorna = $id; | 277 | $retorna = $id; |
277 | } | 278 | } |
278 | else | 279 | else |
admin/php/atlas.php
@@ -185,9 +185,12 @@ function alterarAtlas() | @@ -185,9 +185,12 @@ function alterarAtlas() | ||
185 | global $publicado_atlas,$id_atlas,$basemapfile_atlas,$desc_atlas,$h_atlas,$w_atlas,$icone_atlas,$link_atlas,$pranchadefault_atlas,$template_atlas,$tipoguias_atlas,$titulo_atlas,$ordem_atlas; | 185 | global $publicado_atlas,$id_atlas,$basemapfile_atlas,$desc_atlas,$h_atlas,$w_atlas,$icone_atlas,$link_atlas,$pranchadefault_atlas,$template_atlas,$tipoguias_atlas,$titulo_atlas,$ordem_atlas; |
186 | try | 186 | try |
187 | { | 187 | { |
188 | - //$desc_atlas = mb_convert_encoding($desc_atlas,"UTF-8","ISO-8859-1"); | ||
189 | - //$titulo_atlas = mb_convert_encoding($titulo_atlas,"UTF-8","ISO-8859-1"); | ||
190 | include("conexao.php"); | 188 | include("conexao.php"); |
189 | + if($convUTF) | ||
190 | + { | ||
191 | + $desc_atlas = utf8_encode($desc_atlas); | ||
192 | + $titulo_atlas = utf8_encode($titulo_atlas); | ||
193 | + } | ||
191 | if($id_atlas != "") | 194 | if($id_atlas != "") |
192 | { | 195 | { |
193 | $dbhw->query("UPDATE i3geoadmin_atlas SET publicado_atlas='$publicado_atlas',ordem_atlas='$ordem_atlas',basemapfile_atlas='$basemapfile_atlas',desc_atlas='$desc_atlas',h_atlas='$h_atlas',w_atlas='$w_atlas',icone_atlas='$icone_atlas',link_atlas='$link_atlas',pranchadefault_atlas='$pranchadefault_atlas',template_atlas='$template_atlas',tipoguias_atlas='$tipoguias_atlas',titulo_atlas='$titulo_atlas' WHERE id_atlas = $id_atlas"); | 196 | $dbhw->query("UPDATE i3geoadmin_atlas SET publicado_atlas='$publicado_atlas',ordem_atlas='$ordem_atlas',basemapfile_atlas='$basemapfile_atlas',desc_atlas='$desc_atlas',h_atlas='$h_atlas',w_atlas='$w_atlas',icone_atlas='$icone_atlas',link_atlas='$link_atlas',pranchadefault_atlas='$pranchadefault_atlas',template_atlas='$template_atlas',tipoguias_atlas='$tipoguias_atlas',titulo_atlas='$titulo_atlas' WHERE id_atlas = $id_atlas"); |
@@ -218,9 +221,12 @@ function alterarPrancha() | @@ -218,9 +221,12 @@ function alterarPrancha() | ||
218 | global $mapext_prancha,$id_atlas,$id_prancha,$desc_prancha,$h_prancha,$w_prancha,$icone_prancha,$link_prancha,$titulo_prancha,$ordem_prancha; | 221 | global $mapext_prancha,$id_atlas,$id_prancha,$desc_prancha,$h_prancha,$w_prancha,$icone_prancha,$link_prancha,$titulo_prancha,$ordem_prancha; |
219 | try | 222 | try |
220 | { | 223 | { |
221 | - //$desc_prancha = mb_convert_encoding($desc_prancha,"UTF-8","ISO-8859-1"); | ||
222 | - //$titulo_prancha = mb_convert_encoding($titulo_prancha,"UTF-8","ISO-8859-1"); | ||
223 | include("conexao.php"); | 224 | include("conexao.php"); |
225 | + if($convUTF) | ||
226 | + { | ||
227 | + $desc_prancha = utf8_encode($desc_prancha); | ||
228 | + $titulo_prancha = utf8_encode($titulo_prancha); | ||
229 | + } | ||
224 | if($id_prancha != "") | 230 | if($id_prancha != "") |
225 | { | 231 | { |
226 | $dbhw->query("UPDATE i3geoadmin_atlasp SET ordem_prancha='$ordem_prancha', mapext_prancha='$mapext_prancha',desc_prancha='$desc_prancha',h_prancha='$h_prancha',w_prancha='$w_prancha',icone_prancha='$icone_prancha',link_prancha='$link_prancha',titulo_prancha='$titulo_prancha' WHERE id_prancha = '$id_prancha'"); | 232 | $dbhw->query("UPDATE i3geoadmin_atlasp SET ordem_prancha='$ordem_prancha', mapext_prancha='$mapext_prancha',desc_prancha='$desc_prancha',h_prancha='$h_prancha',w_prancha='$w_prancha',icone_prancha='$icone_prancha',link_prancha='$link_prancha',titulo_prancha='$titulo_prancha' WHERE id_prancha = '$id_prancha'"); |
@@ -330,6 +336,7 @@ function excluirAtlas() | @@ -330,6 +336,7 @@ function excluirAtlas() | ||
330 | function importarXmlAtlas() | 336 | function importarXmlAtlas() |
331 | { | 337 | { |
332 | global $xml,$tipo; | 338 | global $xml,$tipo; |
339 | + set_time_limit(180); | ||
333 | if(!file_exists($xml)) | 340 | if(!file_exists($xml)) |
334 | {return "<br><b>Arquivo $xml não encontrado";} | 341 | {return "<br><b>Arquivo $xml não encontrado";} |
335 | include_once("../../classesphp/funcoes_gerais.php"); | 342 | include_once("../../classesphp/funcoes_gerais.php"); |
@@ -348,6 +355,11 @@ function importarXmlAtlas() | @@ -348,6 +355,11 @@ function importarXmlAtlas() | ||
348 | { | 355 | { |
349 | $titulo = html_entity_decode(ixml($atlas,"TITULO")); | 356 | $titulo = html_entity_decode(ixml($atlas,"TITULO")); |
350 | $desc = html_entity_decode(ixml($atlas,"DESCRICAO")); | 357 | $desc = html_entity_decode(ixml($atlas,"DESCRICAO")); |
358 | + if($convUTF) | ||
359 | + { | ||
360 | + $titulo = utf8_encode($titulo); | ||
361 | + $desc = utf8_encode($desc); | ||
362 | + } | ||
351 | $icone = ixml($atlas,"ICONE"); | 363 | $icone = ixml($atlas,"ICONE"); |
352 | $link = ixml($atlas,"LINKMAISINFO"); | 364 | $link = ixml($atlas,"LINKMAISINFO"); |
353 | $template = ixml($atlas,"TEMPLATEHTML"); | 365 | $template = ixml($atlas,"TEMPLATEHTML"); |
@@ -369,6 +381,11 @@ function importarXmlAtlas() | @@ -369,6 +381,11 @@ function importarXmlAtlas() | ||
369 | { | 381 | { |
370 | $titulo = html_entity_decode(ixml($prancha,"TITULO")); | 382 | $titulo = html_entity_decode(ixml($prancha,"TITULO")); |
371 | $desc = html_entity_decode(ixml($prancha,"DESCRICAO")); | 383 | $desc = html_entity_decode(ixml($prancha,"DESCRICAO")); |
384 | + if($convUTF) | ||
385 | + { | ||
386 | + $titulo = utf8_encode($titulo); | ||
387 | + $desc = utf8_encode($desc); | ||
388 | + } | ||
372 | $icone = ixml($prancha,"ICONE"); | 389 | $icone = ixml($prancha,"ICONE"); |
373 | $link = ixml($prancha,"LINKMAISINFO"); | 390 | $link = ixml($prancha,"LINKMAISINFO"); |
374 | $w = ixml($prancha,"WABERUTRA"); | 391 | $w = ixml($prancha,"WABERUTRA"); |
admin/php/conexao.php
@@ -56,6 +56,11 @@ else | @@ -56,6 +56,11 @@ else | ||
56 | if(!isset($conexaoadmin)) | 56 | if(!isset($conexaoadmin)) |
57 | {$conexaoadmin = "";} | 57 | {$conexaoadmin = "";} |
58 | 58 | ||
59 | +// | ||
60 | +//indica se deve ser feita a conversão para UTF8 ao gravar os dados | ||
61 | +// | ||
62 | +$convUTF = true; | ||
63 | + | ||
59 | if($conexaoadmin == "") | 64 | if($conexaoadmin == "") |
60 | { | 65 | { |
61 | $arquivosqlite = $locaplic."/menutemas/admin.db"; | 66 | $arquivosqlite = $locaplic."/menutemas/admin.db"; |
admin/php/conexaomma.php
1 | <?php | 1 | <?php |
2 | $dbh = new PDO('pgsql:dbname=geodados;user=geodados;password=geodados;host=dsvmapas.mma.gov.br'); | 2 | $dbh = new PDO('pgsql:dbname=geodados;user=geodados;password=geodados;host=dsvmapas.mma.gov.br'); |
3 | $dbhw = new PDO('pgsql:dbname=geodados;user=pgsql;password=pgsql;host=dsvmapas.mma.gov.br'); | 3 | $dbhw = new PDO('pgsql:dbname=geodados;user=pgsql;password=pgsql;host=dsvmapas.mma.gov.br'); |
4 | +$convUTF = false; | ||
4 | ?> | 5 | ?> |
5 | \ No newline at end of file | 6 | \ No newline at end of file |
admin/php/editormapfile.php
@@ -362,7 +362,10 @@ function pegaConexao() | @@ -362,7 +362,10 @@ function pegaConexao() | ||
362 | $dados["tileindex"] = $layer->tileindex; | 362 | $dados["tileindex"] = $layer->tileindex; |
363 | $dados["tileitem"] = $layer->tileitem; | 363 | $dados["tileitem"] = $layer->tileitem; |
364 | if($dados["tileindex"] == ""){$dados["tileitem"] = "";} | 364 | if($dados["tileindex"] == ""){$dados["tileitem"] = "";} |
365 | + if(is_array($postgis_mapa)) | ||
365 | $dados["postgis_mapa"] = array_keys($postgis_mapa); | 366 | $dados["postgis_mapa"] = array_keys($postgis_mapa); |
367 | + else | ||
368 | + $dados["postgis_mapa"] = $postgis_mapa; | ||
366 | $dados["codigoMap"] = $codigoMap; | 369 | $dados["codigoMap"] = $codigoMap; |
367 | $dados["codigoLayer"] = $codigoLayer; | 370 | $dados["codigoLayer"] = $codigoLayer; |
368 | return $dados; | 371 | return $dados; |
admin/php/identifica.php
@@ -28,6 +28,7 @@ File: i3geo/admin/identifica.php | @@ -28,6 +28,7 @@ File: i3geo/admin/identifica.php | ||
28 | 28 | ||
29 | */ | 29 | */ |
30 | include_once("admin.php"); | 30 | include_once("admin.php"); |
31 | +error_reporting(0); | ||
31 | //faz a busca da função que deve ser executada | 32 | //faz a busca da função que deve ser executada |
32 | switch ($funcao) | 33 | switch ($funcao) |
33 | { | 34 | { |
@@ -72,6 +73,10 @@ function alterarFuncoes() | @@ -72,6 +73,10 @@ function alterarFuncoes() | ||
72 | { | 73 | { |
73 | //$nome_i = mb_convert_encoding($nome_i,"UTF-8","ISO-8859-1"); | 74 | //$nome_i = mb_convert_encoding($nome_i,"UTF-8","ISO-8859-1"); |
74 | require_once("conexao.php"); | 75 | require_once("conexao.php"); |
76 | + if($convUTF) | ||
77 | + { | ||
78 | + $nome_i = utf8_encode($nome_i); | ||
79 | + } | ||
75 | if($id_i != "") | 80 | if($id_i != "") |
76 | { | 81 | { |
77 | $dbhw->query("UPDATE i3geoadmin_identifica SET publicado_i = '$publicado_i',nome_i = '$nome_i',abrir_i = '$abrir_i', target_i = '$target_i' WHERE id_i = $id_i"); | 82 | $dbhw->query("UPDATE i3geoadmin_identifica SET publicado_i = '$publicado_i',nome_i = '$nome_i',abrir_i = '$abrir_i', target_i = '$target_i' WHERE id_i = $id_i"); |
@@ -129,6 +134,10 @@ function importarXmlI() | @@ -129,6 +134,10 @@ function importarXmlI() | ||
129 | foreach($xml->FUNCAO as $item) | 134 | foreach($xml->FUNCAO as $item) |
130 | { | 135 | { |
131 | $nome_i = html_entity_decode(ixml($item,"NOMESIS")); | 136 | $nome_i = html_entity_decode(ixml($item,"NOMESIS")); |
137 | + if($convUTF) | ||
138 | + { | ||
139 | + $nome_i = utf8_encode($nome_i); | ||
140 | + } | ||
132 | $target_i = ixml($item,"TARGET"); | 141 | $target_i = ixml($item,"TARGET"); |
133 | $abrir_i = ixml($item,"ABRIR"); | 142 | $abrir_i = ixml($item,"ABRIR"); |
134 | if(!isset($iExistentes[$nome_i])) | 143 | if(!isset($iExistentes[$nome_i])) |
admin/php/mapas.php
@@ -28,6 +28,7 @@ File: i3geo/admin/mapas.php | @@ -28,6 +28,7 @@ File: i3geo/admin/mapas.php | ||
28 | 28 | ||
29 | */ | 29 | */ |
30 | include_once("admin.php"); | 30 | include_once("admin.php"); |
31 | +error_reporting(0); | ||
31 | //faz a busca da função que deve ser executada | 32 | //faz a busca da função que deve ser executada |
32 | switch ($funcao) | 33 | switch ($funcao) |
33 | { | 34 | { |
@@ -69,9 +70,12 @@ function alterarMapa() | @@ -69,9 +70,12 @@ function alterarMapa() | ||
69 | global $publicado_mapa,$ordem_mapa,$id_mapa,$desc_mapa,$ext_mapa,$imagem_mapa,$outros_mapa,$nome_mapa,$linkdireto_mapa,$temas_mapa,$ligados_mapa,$perfil_mapa; | 70 | global $publicado_mapa,$ordem_mapa,$id_mapa,$desc_mapa,$ext_mapa,$imagem_mapa,$outros_mapa,$nome_mapa,$linkdireto_mapa,$temas_mapa,$ligados_mapa,$perfil_mapa; |
70 | try | 71 | try |
71 | { | 72 | { |
72 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | ||
73 | - //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | ||
74 | require_once("conexao.php"); | 73 | require_once("conexao.php"); |
74 | + if($convUTF) | ||
75 | + { | ||
76 | + $nome_mapa = utf8_encode($nome_mapa); | ||
77 | + $desc_mapa = utf8_encode($desc_mapa); | ||
78 | + } | ||
75 | $retorna = ""; | 79 | $retorna = ""; |
76 | if($id_mapa != "") | 80 | if($id_mapa != "") |
77 | { | 81 | { |
@@ -131,9 +135,12 @@ function importarXmlMapas() | @@ -131,9 +135,12 @@ function importarXmlMapas() | ||
131 | { | 135 | { |
132 | $perfil = ixml($mapa,"PERFIL"); | 136 | $perfil = ixml($mapa,"PERFIL"); |
133 | $descricao = html_entity_decode(ixml($mapa,"DESCRICAO")); | 137 | $descricao = html_entity_decode(ixml($mapa,"DESCRICAO")); |
134 | - //$descricao = mb_convert_encoding($descricao,"UTF-8","ISO-8859-1"); | ||
135 | $nome = html_entity_decode(ixml($mapa,"NOME")); | 138 | $nome = html_entity_decode(ixml($mapa,"NOME")); |
136 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | 139 | + if($convUTF) |
140 | + { | ||
141 | + $nome = utf8_encode($nome); | ||
142 | + $descricao = utf8_encode($descricao); | ||
143 | + } | ||
137 | $imagem = ixml($mapa,"IMAGEM"); | 144 | $imagem = ixml($mapa,"IMAGEM"); |
138 | $temas = ixml($mapa,"TEMAS"); | 145 | $temas = ixml($mapa,"TEMAS"); |
139 | $ligados = ixml($mapa,"LIGADOS"); | 146 | $ligados = ixml($mapa,"LIGADOS"); |
admin/php/menutemas.php
@@ -433,10 +433,13 @@ function alteraMenus() | @@ -433,10 +433,13 @@ function alteraMenus() | ||
433 | global $nome,$desc,$id,$aberto,$perfil,$publicado_menu; | 433 | global $nome,$desc,$id,$aberto,$perfil,$publicado_menu; |
434 | try | 434 | try |
435 | { | 435 | { |
436 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | ||
437 | - //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | ||
438 | $retorna = ""; | 436 | $retorna = ""; |
439 | include("conexao.php"); | 437 | include("conexao.php"); |
438 | + if($convUTF) | ||
439 | + { | ||
440 | + $nome = utf8_encode($nome); | ||
441 | + $desc = utf8_encode($desc); | ||
442 | + } | ||
440 | if($id != "") | 443 | if($id != "") |
441 | { | 444 | { |
442 | $dbhw->query("UPDATE i3geoadmin_menus SET publicado_menu = '$publicado_menu',aberto = '$aberto', nome_menu = '$nome', desc_menu = '$desc', perfil_menu = '$perfil' WHERE id_menu = $id"); | 445 | $dbhw->query("UPDATE i3geoadmin_menus SET publicado_menu = '$publicado_menu',aberto = '$aberto', nome_menu = '$nome', desc_menu = '$desc', perfil_menu = '$perfil' WHERE id_menu = $id"); |
@@ -462,10 +465,13 @@ function alteraMenus() | @@ -462,10 +465,13 @@ function alteraMenus() | ||
462 | function alteraPerfis() | 465 | function alteraPerfis() |
463 | { | 466 | { |
464 | global $perfil,$id; | 467 | global $perfil,$id; |
468 | + //$perfil = resolveAcentos($perfil,"html"); | ||
469 | + | ||
465 | try | 470 | try |
466 | { | 471 | { |
467 | $dbh = ""; | 472 | $dbh = ""; |
468 | include("conexao.php"); | 473 | include("conexao.php"); |
474 | + if($convUTF) $perfil = utf8_encode($perfil); | ||
469 | $retorna = ""; | 475 | $retorna = ""; |
470 | if($id != "") | 476 | if($id != "") |
471 | { | 477 | { |
@@ -496,29 +502,29 @@ function alteraPerfis() | @@ -496,29 +502,29 @@ function alteraPerfis() | ||
496 | $q = $dbh->query("select * from i3geoadmin_n1"); | 502 | $q = $dbh->query("select * from i3geoadmin_n1"); |
497 | foreach($q as $row) | 503 | foreach($q as $row) |
498 | { | 504 | { |
499 | - $t = $row['perfil_n1']; | 505 | + $t = $row['n1_perfil']; |
500 | $i = $row['id_n1']; | 506 | $i = $row['id_n1']; |
501 | $ts = str_replace($original,$perfil,$t); | 507 | $ts = str_replace($original,$perfil,$t); |
502 | if($t != $ts) | 508 | if($t != $ts) |
503 | - $dbhw->query("UPDATE i3geoadmin_n1 SET perfil_n1 = '$ts' WHERE id_n1 = $i"); | 509 | + $dbhw->query("UPDATE i3geoadmin_n1 SET n1_perfil = '$ts' WHERE id_n1 = $i"); |
504 | } | 510 | } |
505 | $q = $dbh->query("select * from i3geoadmin_n2"); | 511 | $q = $dbh->query("select * from i3geoadmin_n2"); |
506 | foreach($q as $row) | 512 | foreach($q as $row) |
507 | { | 513 | { |
508 | - $t = $row['perfil_n2']; | 514 | + $t = $row['n2_perfil']; |
509 | $i = $row['id_n2']; | 515 | $i = $row['id_n2']; |
510 | $ts = str_replace($original,$perfil,$t); | 516 | $ts = str_replace($original,$perfil,$t); |
511 | if($t != $ts) | 517 | if($t != $ts) |
512 | - $dbhw->query("UPDATE i3geoadmin_n2 SET perfil_n2 = '$ts' WHERE id_n2 = $i"); | 518 | + $dbhw->query("UPDATE i3geoadmin_n2 SET n2_perfil = '$ts' WHERE id_n2 = $i"); |
513 | } | 519 | } |
514 | $q = $dbh->query("select * from i3geoadmin_n3"); | 520 | $q = $dbh->query("select * from i3geoadmin_n3"); |
515 | foreach($q as $row) | 521 | foreach($q as $row) |
516 | { | 522 | { |
517 | - $t = $row['perfil_n3']; | 523 | + $t = $row['n3_perfil']; |
518 | $i = $row['id_n3']; | 524 | $i = $row['id_n3']; |
519 | $ts = str_replace($original,$perfil,$t); | 525 | $ts = str_replace($original,$perfil,$t); |
520 | if($t != $ts) | 526 | if($t != $ts) |
521 | - $dbhw->query("UPDATE i3geoadmin_n3 SET perfil_n3 = '$ts' WHERE id_n3 = $i"); | 527 | + $dbhw->query("UPDATE i3geoadmin_n3 SET n3_perfil = '$ts' WHERE id_n3 = $i"); |
522 | } | 528 | } |
523 | $q = $dbh->query("select * from i3geoadmin_raiz"); | 529 | $q = $dbh->query("select * from i3geoadmin_raiz"); |
524 | foreach($q as $row) | 530 | foreach($q as $row) |
@@ -572,9 +578,11 @@ function alteraTags() | @@ -572,9 +578,11 @@ function alteraTags() | ||
572 | global $nome,$id; | 578 | global $nome,$id; |
573 | try | 579 | try |
574 | { | 580 | { |
581 | + | ||
575 | $dbh = ""; | 582 | $dbh = ""; |
576 | //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | 583 | //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); |
577 | include("conexao.php"); | 584 | include("conexao.php"); |
585 | + if($convUTF) $nome = utf8_encode($nome); | ||
578 | $retorna = ""; | 586 | $retorna = ""; |
579 | if($id != "") | 587 | if($id != "") |
580 | { | 588 | { |
@@ -586,6 +594,7 @@ function alteraTags() | @@ -586,6 +594,7 @@ function alteraTags() | ||
586 | {$original = $row["nome"];} | 594 | {$original = $row["nome"];} |
587 | $dbhw->query("UPDATE i3geoadmin_tags SET nome = '$nome' WHERE id_tag = $id"); | 595 | $dbhw->query("UPDATE i3geoadmin_tags SET nome = '$nome' WHERE id_tag = $id"); |
588 | //exclui os registros do tag alterado nos temas | 596 | //exclui os registros do tag alterado nos temas |
597 | + /* | ||
589 | if($original != "") | 598 | if($original != "") |
590 | { | 599 | { |
591 | $q = $dbh->query("select tags_tema,id_tema from i3geoadmin_temas"); | 600 | $q = $dbh->query("select tags_tema,id_tema from i3geoadmin_temas"); |
@@ -596,7 +605,8 @@ function alteraTags() | @@ -596,7 +605,8 @@ function alteraTags() | ||
596 | $ts = str_replace($original,$nome,$ts); | 605 | $ts = str_replace($original,$nome,$ts); |
597 | $dbhw->query("UPDATE i3geoadmin_temas SET tags_tema = '$ts' WHERE id_tema = $i"); | 606 | $dbhw->query("UPDATE i3geoadmin_temas SET tags_tema = '$ts' WHERE id_tema = $i"); |
598 | } | 607 | } |
599 | - } | 608 | + } |
609 | + */ | ||
600 | } | 610 | } |
601 | $retorna = $id; | 611 | $retorna = $id; |
602 | } | 612 | } |
@@ -627,9 +637,12 @@ function alteraGrupos() | @@ -627,9 +637,12 @@ function alteraGrupos() | ||
627 | global $nome,$desc,$id; | 637 | global $nome,$desc,$id; |
628 | try | 638 | try |
629 | { | 639 | { |
630 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | ||
631 | - //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | ||
632 | include("conexao.php"); | 640 | include("conexao.php"); |
641 | + if($convUTF) | ||
642 | + { | ||
643 | + $nome = utf8_encode($nome); | ||
644 | + $desc = utf8_encode($desc); | ||
645 | + } | ||
633 | $retorna = ""; | 646 | $retorna = ""; |
634 | if($id != "") | 647 | if($id != "") |
635 | { | 648 | { |
@@ -663,9 +676,12 @@ function alteraSubGrupos() | @@ -663,9 +676,12 @@ function alteraSubGrupos() | ||
663 | global $nome,$desc,$id; | 676 | global $nome,$desc,$id; |
664 | try | 677 | try |
665 | { | 678 | { |
666 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | ||
667 | - //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | ||
668 | require_once("conexao.php"); | 679 | require_once("conexao.php"); |
680 | + if($convUTF) | ||
681 | + { | ||
682 | + $nome = utf8_encode($nome); | ||
683 | + $desc = utf8_encode($desc); | ||
684 | + } | ||
669 | $retorna = ""; | 685 | $retorna = ""; |
670 | if($id != "") | 686 | if($id != "") |
671 | { | 687 | { |
@@ -700,10 +716,13 @@ function alteraTemas() | @@ -700,10 +716,13 @@ function alteraTemas() | ||
700 | try | 716 | try |
701 | { | 717 | { |
702 | $retorna = "ok"; | 718 | $retorna = "ok"; |
703 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | ||
704 | - //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | ||
705 | - //$tags = mb_convert_encoding($tags,"UTF-8","ISO-8859-1"); | ||
706 | include("conexao.php"); | 719 | include("conexao.php"); |
720 | + if($convUTF) | ||
721 | + { | ||
722 | + $nome = utf8_encode($nome); | ||
723 | + $desc = utf8_encode($desc); | ||
724 | + $tags = utf8_encode($tags); | ||
725 | + } | ||
707 | if($id != "") | 726 | if($id != "") |
708 | { | 727 | { |
709 | $dbhw->query("UPDATE i3geoadmin_temas SET tags_tema='$tags', link_tema='$link', nome_tema ='$nome',desc_tema='$desc',codigo_tema='$codigo',tipoa_tema='$tipoa',download_tema='$download',ogc_tema='$ogc',kml_tema='$kml' WHERE id_tema = $id"); | 728 | $dbhw->query("UPDATE i3geoadmin_temas SET tags_tema='$tags', link_tema='$link', nome_tema ='$nome',desc_tema='$desc',codigo_tema='$codigo',tipoa_tema='$tipoa',download_tema='$download',ogc_tema='$ogc',kml_tema='$kml' WHERE id_tema = $id"); |
@@ -778,16 +797,17 @@ Importa um arquivo xml do tipo "menutemas" para o banco de dados | @@ -778,16 +797,17 @@ Importa um arquivo xml do tipo "menutemas" para o banco de dados | ||
778 | function importarXmlMenu() | 797 | function importarXmlMenu() |
779 | { | 798 | { |
780 | global $nomemenu,$xml; | 799 | global $nomemenu,$xml; |
800 | + set_time_limit(180); | ||
781 | $listaDeTags = array(); | 801 | $listaDeTags = array(); |
782 | if(!file_exists($xml)) | 802 | if(!file_exists($xml)) |
783 | {return "<br><b>Arquivo $xml não encontrado";} | 803 | {return "<br><b>Arquivo $xml não encontrado";} |
784 | include_once("../../classesphp/funcoes_gerais.php"); | 804 | include_once("../../classesphp/funcoes_gerais.php"); |
785 | include("conexao.php"); | 805 | include("conexao.php"); |
806 | + if($convUTF) $nomemenu = utf8_encode($nomemenu); | ||
786 | $dbhw->query("INSERT INTO i3geoadmin_menus (desc_menu,nome_menu) VALUES ('','$nomemenu')"); | 807 | $dbhw->query("INSERT INTO i3geoadmin_menus (desc_menu,nome_menu) VALUES ('','$nomemenu')"); |
787 | $id_menu = $dbhw->query("SELECT id_menu FROM i3geoadmin_menus"); | 808 | $id_menu = $dbhw->query("SELECT id_menu FROM i3geoadmin_menus"); |
788 | $id_menu = $id_menu->fetchAll(); | 809 | $id_menu = $id_menu->fetchAll(); |
789 | $id_menu = intval($id_menu[count($id_menu)-1]['id_menu']); | 810 | $id_menu = intval($id_menu[count($id_menu)-1]['id_menu']); |
790 | - | ||
791 | $xml = simplexml_load_file($xml); | 811 | $xml = simplexml_load_file($xml); |
792 | // | 812 | // |
793 | //importa os grupos | 813 | //importa os grupos |
@@ -801,8 +821,17 @@ function importarXmlMenu() | @@ -801,8 +821,17 @@ function importarXmlMenu() | ||
801 | { | 821 | { |
802 | $nome = html_entity_decode(ixml($grupo,"GTIPO")); | 822 | $nome = html_entity_decode(ixml($grupo,"GTIPO")); |
803 | $descricao = html_entity_decode(ixml($grupo,"DTIPO")); | 823 | $descricao = html_entity_decode(ixml($grupo,"DTIPO")); |
824 | + if($convUTF) | ||
825 | + { | ||
826 | + $nome = utf8_encode($nome); | ||
827 | + $descricao = utf8_encode($descricao); | ||
828 | + } | ||
804 | if(!isset($gruposExistentes[$nome])) | 829 | if(!isset($gruposExistentes[$nome])) |
805 | - $dbhw->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')"); | 830 | + { |
831 | + $nome = str_replace("'","",$nome); | ||
832 | + $descricao = str_replace("'","",$descricao); | ||
833 | + $dbhw->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')"); | ||
834 | + } | ||
806 | $gruposExistentes[$nome] = 0; | 835 | $gruposExistentes[$nome] = 0; |
807 | } | 836 | } |
808 | // | 837 | // |
@@ -818,10 +847,18 @@ function importarXmlMenu() | @@ -818,10 +847,18 @@ function importarXmlMenu() | ||
818 | foreach($grupo->SGRUPO as $sgrupo) | 847 | foreach($grupo->SGRUPO as $sgrupo) |
819 | { | 848 | { |
820 | $nome = html_entity_decode(ixml($sgrupo,"SDTIPO")); | 849 | $nome = html_entity_decode(ixml($sgrupo,"SDTIPO")); |
850 | + if($convUTF) | ||
851 | + { | ||
852 | + $nome = utf8_encode($nome); | ||
853 | + } | ||
821 | $descricao = ""; | 854 | $descricao = ""; |
822 | if(!isset($subgruposExistentes[$nome])) | 855 | if(!isset($subgruposExistentes[$nome])) |
823 | - $dbhw->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')"); | ||
824 | - $subgruposExistentes[$nome] = 0; | 856 | + { |
857 | + $nome = str_replace("'","",$nome); | ||
858 | + $descricao = str_replace("'","",$descricao); | ||
859 | + $dbhw->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')"); | ||
860 | + $subgruposExistentes[$nome] = 0; | ||
861 | + } | ||
825 | } | 862 | } |
826 | } | 863 | } |
827 | // | 864 | // |
@@ -839,16 +876,26 @@ function importarXmlMenu() | @@ -839,16 +876,26 @@ function importarXmlMenu() | ||
839 | { | 876 | { |
840 | $nome = html_entity_decode(ixml($tema,"TNOME")); | 877 | $nome = html_entity_decode(ixml($tema,"TNOME")); |
841 | $descricao = html_entity_decode(ixml($tema,"TDESC")); | 878 | $descricao = html_entity_decode(ixml($tema,"TDESC")); |
879 | + if($convUTF) | ||
880 | + { | ||
881 | + $nome = utf8_encode($nome); | ||
882 | + $descricao = utf8_encode($descricao); | ||
883 | + } | ||
842 | $codigo = ixml($tema,"TID"); | 884 | $codigo = ixml($tema,"TID"); |
843 | $link = ixml($tema,"TLINK"); | 885 | $link = ixml($tema,"TLINK"); |
844 | $tipo = ixml($tema,"TIPOA"); | 886 | $tipo = ixml($tema,"TIPOA"); |
845 | $tags = ixml($tema,"TAGS"); | 887 | $tags = ixml($tema,"TAGS"); |
888 | + if($convUTF) $tags = utf8_encode($tags); | ||
846 | $down = ixml($tema,"DOWNLOAD"); | 889 | $down = ixml($tema,"DOWNLOAD"); |
847 | $kml = ixml($tema,"KML"); | 890 | $kml = ixml($tema,"KML"); |
848 | $ogc = ixml($tema,"OGC"); | 891 | $ogc = ixml($tema,"OGC"); |
849 | $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); | 892 | $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); |
850 | if(!isset($temasExistentes[$codigo])) | 893 | if(!isset($temasExistentes[$codigo])) |
851 | - $dbhw->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | 894 | + { |
895 | + $nome = str_replace("'","",$nome); | ||
896 | + $descricao = str_replace("'","",$descricao); | ||
897 | + $dbhw->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | ||
898 | + } | ||
852 | $temasExistentes[$codigo] = 0; | 899 | $temasExistentes[$codigo] = 0; |
853 | } | 900 | } |
854 | foreach($xml->GRUPO as $grupo) | 901 | foreach($xml->GRUPO as $grupo) |
@@ -857,16 +904,26 @@ function importarXmlMenu() | @@ -857,16 +904,26 @@ function importarXmlMenu() | ||
857 | { | 904 | { |
858 | $nome = html_entity_decode(ixml($tema,"TNOME")); | 905 | $nome = html_entity_decode(ixml($tema,"TNOME")); |
859 | $descricao = html_entity_decode(ixml($tema,"TDESC")); | 906 | $descricao = html_entity_decode(ixml($tema,"TDESC")); |
907 | + if($convUTF) | ||
908 | + { | ||
909 | + $nome = utf8_encode($nome); | ||
910 | + $descricao = utf8_encode($descricao); | ||
911 | + } | ||
860 | $codigo = ixml($tema,"TID"); | 912 | $codigo = ixml($tema,"TID"); |
861 | $link = ixml($tema,"TLINK"); | 913 | $link = ixml($tema,"TLINK"); |
862 | $tipo = ixml($tema,"TIPOA"); | 914 | $tipo = ixml($tema,"TIPOA"); |
863 | $tags = ixml($tema,"TAGS"); | 915 | $tags = ixml($tema,"TAGS"); |
916 | + if($convUTF) $tags = utf8_encode($tags); | ||
864 | $down = ixml($tema,"DOWNLOAD"); | 917 | $down = ixml($tema,"DOWNLOAD"); |
865 | $kml = ixml($tema,"KML"); | 918 | $kml = ixml($tema,"KML"); |
866 | $ogc = ixml($tema,"OGC"); | 919 | $ogc = ixml($tema,"OGC"); |
867 | $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); | 920 | $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); |
868 | if(!isset($temasExistentes[$codigo])) | 921 | if(!isset($temasExistentes[$codigo])) |
869 | - $dbhw->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | 922 | + { |
923 | + $nome = str_replace("'","",$nome); | ||
924 | + $descricao = str_replace("'","",$descricao); | ||
925 | + $dbhw->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | ||
926 | + } | ||
870 | $temasExistentes[$codigo] = 0; | 927 | $temasExistentes[$codigo] = 0; |
871 | } | 928 | } |
872 | foreach($grupo->SGRUPO as $sgrupo) | 929 | foreach($grupo->SGRUPO as $sgrupo) |
@@ -875,16 +932,26 @@ function importarXmlMenu() | @@ -875,16 +932,26 @@ function importarXmlMenu() | ||
875 | { | 932 | { |
876 | $nome = html_entity_decode(ixml($tema,"TNOME")); | 933 | $nome = html_entity_decode(ixml($tema,"TNOME")); |
877 | $descricao = html_entity_decode(ixml($tema,"TDESC")); | 934 | $descricao = html_entity_decode(ixml($tema,"TDESC")); |
935 | + if($convUTF) | ||
936 | + { | ||
937 | + $nome = utf8_encode($nome); | ||
938 | + $descricao = utf8_encode($descricao); | ||
939 | + } | ||
878 | $codigo = ixml($tema,"TID"); | 940 | $codigo = ixml($tema,"TID"); |
879 | $link = ixml($tema,"TLINK"); | 941 | $link = ixml($tema,"TLINK"); |
880 | $tipo = ixml($tema,"TIPOA"); | 942 | $tipo = ixml($tema,"TIPOA"); |
881 | - $tags = ixml($tema,"TAGS"); | 943 | + $tags = html_entity_decode(ixml($tema,"TAGS")); |
944 | + if($convUTF) $tags = utf8_encode($tags); | ||
882 | $down = ixml($tema,"DOWNLOAD"); | 945 | $down = ixml($tema,"DOWNLOAD"); |
883 | $kml = ixml($tema,"KML"); | 946 | $kml = ixml($tema,"KML"); |
884 | $ogc = ixml($tema,"OGC"); | 947 | $ogc = ixml($tema,"OGC"); |
885 | $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); | 948 | $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); |
886 | if(!isset($temasExistentes[$codigo])) | 949 | if(!isset($temasExistentes[$codigo])) |
887 | - $dbhw->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | 950 | + { |
951 | + $nome = str_replace("'","",$nome); | ||
952 | + $descricao = str_replace("'","",$descricao); | ||
953 | + $dbhw->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | ||
954 | + } | ||
888 | $temasExistentes[$codigo] = 0; | 955 | $temasExistentes[$codigo] = 0; |
889 | } | 956 | } |
890 | } | 957 | } |
@@ -908,7 +975,8 @@ function importarXmlMenu() | @@ -908,7 +975,8 @@ function importarXmlMenu() | ||
908 | // | 975 | // |
909 | foreach($xml->GRUPO as $grupo) | 976 | foreach($xml->GRUPO as $grupo) |
910 | { | 977 | { |
911 | - $gtipo = ixml($grupo,"GTIPO"); | 978 | + $gtipo = html_entity_decode(ixml($grupo,"GTIPO")); |
979 | + if($convUTF) $gtipo = utf8_encode($gtipo); | ||
912 | $n1_perfil = ixml($grupo,"PERFIL"); | 980 | $n1_perfil = ixml($grupo,"PERFIL"); |
913 | $r = $dbhw->query("select id_grupo from i3geoadmin_grupos where nome_grupo = '$gtipo'"); | 981 | $r = $dbhw->query("select id_grupo from i3geoadmin_grupos where nome_grupo = '$gtipo'"); |
914 | $id_grupo = $r->fetchColumn(); | 982 | $id_grupo = $r->fetchColumn(); |
@@ -916,7 +984,6 @@ function importarXmlMenu() | @@ -916,7 +984,6 @@ function importarXmlMenu() | ||
916 | $id_n1 = $dbhw->query("SELECT id_n1 FROM i3geoadmin_n1"); | 984 | $id_n1 = $dbhw->query("SELECT id_n1 FROM i3geoadmin_n1"); |
917 | $id_n1 = $id_n1->fetchAll(); | 985 | $id_n1 = $id_n1->fetchAll(); |
918 | $id_n1 = intval($id_n1[count($id_n1)-1]['id_n1']); | 986 | $id_n1 = intval($id_n1[count($id_n1)-1]['id_n1']); |
919 | - | ||
920 | foreach($grupo->TEMA as $tema) | 987 | foreach($grupo->TEMA as $tema) |
921 | { | 988 | { |
922 | $codigo = ixml($tema,"TID"); | 989 | $codigo = ixml($tema,"TID"); |
@@ -927,7 +994,8 @@ function importarXmlMenu() | @@ -927,7 +994,8 @@ function importarXmlMenu() | ||
927 | } | 994 | } |
928 | foreach($grupo->SGRUPO as $subgrupo) | 995 | foreach($grupo->SGRUPO as $subgrupo) |
929 | { | 996 | { |
930 | - $sdtipo = ixml($subgrupo,"SDTIPO"); | 997 | + $sdtipo = html_entity_decode(ixml($subgrupo,"SDTIPO")); |
998 | + if($convUTF) $sdtipo = utf8_encode($sdtipo); | ||
931 | $n2_perfil = ixml($subgrupo,"PERFIL"); | 999 | $n2_perfil = ixml($subgrupo,"PERFIL"); |
932 | $r = $dbhw->query("select id_subgrupo from i3geoadmin_subgrupos where nome_subgrupo = '$sdtipo'"); | 1000 | $r = $dbhw->query("select id_subgrupo from i3geoadmin_subgrupos where nome_subgrupo = '$sdtipo'"); |
933 | $id_subgrupo = $r->fetchColumn(); | 1001 | $id_subgrupo = $r->fetchColumn(); |
admin/php/ms_configura.php
@@ -65,7 +65,7 @@ switch ($funcao) | @@ -65,7 +65,7 @@ switch ($funcao) | ||
65 | $par[$v] = $s; | 65 | $par[$v] = $s; |
66 | } | 66 | } |
67 | else | 67 | else |
68 | - $par[$v] = $s; | 68 | + $par[$v] = utf8_encode($s); |
69 | } | 69 | } |
70 | retornaJSON($par); | 70 | retornaJSON($par); |
71 | exit; | 71 | exit; |
@@ -90,6 +90,7 @@ valor - novo valor | @@ -90,6 +90,7 @@ valor - novo valor | ||
90 | */ | 90 | */ |
91 | function salvaConfigura($variavel,$valor) | 91 | function salvaConfigura($variavel,$valor) |
92 | { | 92 | { |
93 | + //$valor = resolveAcentos($valor,"html"); | ||
93 | $handle = fopen ("../../ms_configura.php", "r"); | 94 | $handle = fopen ("../../ms_configura.php", "r"); |
94 | $linhas = array(); | 95 | $linhas = array(); |
95 | while (!feof ($handle)) { | 96 | while (!feof ($handle)) { |
admin/php/sistemas.php
@@ -28,6 +28,7 @@ File: i3geo/admin/sistemas.php | @@ -28,6 +28,7 @@ File: i3geo/admin/sistemas.php | ||
28 | 28 | ||
29 | */ | 29 | */ |
30 | include_once("admin.php"); | 30 | include_once("admin.php"); |
31 | +error_reporting(0); | ||
31 | //faz a busca da função que deve ser executada | 32 | //faz a busca da função que deve ser executada |
32 | switch ($funcao) | 33 | switch ($funcao) |
33 | { | 34 | { |
@@ -102,7 +103,10 @@ function alterarSistemas() | @@ -102,7 +103,10 @@ function alterarSistemas() | ||
102 | try | 103 | try |
103 | { | 104 | { |
104 | require_once("conexao.php"); | 105 | require_once("conexao.php"); |
105 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | 106 | + if($convUTF) |
107 | + { | ||
108 | + $nome_sistema = utf8_encode($nome_sistema); | ||
109 | + } | ||
106 | if($id_sistema != "") | 110 | if($id_sistema != "") |
107 | { | 111 | { |
108 | $dbhw->query("UPDATE i3geoadmin_sistemas SET publicado_sistema='$publicado_sistema',nome_sistema = '$nome_sistema',perfil_sistema = '$perfil_sistema' WHERE id_sistema = $id_sistema"); | 112 | $dbhw->query("UPDATE i3geoadmin_sistemas SET publicado_sistema='$publicado_sistema',nome_sistema = '$nome_sistema',perfil_sistema = '$perfil_sistema' WHERE id_sistema = $id_sistema"); |
@@ -131,7 +135,10 @@ function alterarFuncoes() | @@ -131,7 +135,10 @@ function alterarFuncoes() | ||
131 | try | 135 | try |
132 | { | 136 | { |
133 | require_once("conexao.php"); | 137 | require_once("conexao.php"); |
134 | - //$nomefuncao = mb_convert_encoding($nomefuncao,"UTF-8","ISO-8859-1"); | 138 | + if($convUTF) |
139 | + { | ||
140 | + $nome_funcao = utf8_encode($nome_funcao); | ||
141 | + } | ||
135 | if($id_funcao != "") | 142 | if($id_funcao != "") |
136 | { | 143 | { |
137 | $dbhw->query("UPDATE i3geoadmin_sistemasf SET nome_funcao = '$nome_funcao',perfil_funcao = '$perfil_funcao', w_funcao = '$w_funcao',h_funcao = '$h_funcao', abrir_funcao = '$abrir_funcao' WHERE id_funcao = $id_funcao"); | 144 | $dbhw->query("UPDATE i3geoadmin_sistemasf SET nome_funcao = '$nome_funcao',perfil_funcao = '$perfil_funcao', w_funcao = '$w_funcao',h_funcao = '$h_funcao', abrir_funcao = '$abrir_funcao' WHERE id_funcao = $id_funcao"); |
@@ -205,6 +212,10 @@ function importarXmlSistemas() | @@ -205,6 +212,10 @@ function importarXmlSistemas() | ||
205 | foreach($xml->SISTEMA as $item) | 212 | foreach($xml->SISTEMA as $item) |
206 | { | 213 | { |
207 | $nome = html_entity_decode(ixml($item,"NOMESIS")); | 214 | $nome = html_entity_decode(ixml($item,"NOMESIS")); |
215 | + if($convUTF) | ||
216 | + { | ||
217 | + $nome = utf8_encode($nome); | ||
218 | + } | ||
208 | $perfil = ixml($item,"PERFIL"); | 219 | $perfil = ixml($item,"PERFIL"); |
209 | if(!isset($sistemasExistentes[$nome])) | 220 | if(!isset($sistemasExistentes[$nome])) |
210 | $dbhw->query("INSERT INTO i3geoadmin_sistemas (publicado_sistema,nome_sistema,perfil_sistema) VALUES ('','$nome','$perfil')"); | 221 | $dbhw->query("INSERT INTO i3geoadmin_sistemas (publicado_sistema,nome_sistema,perfil_sistema) VALUES ('','$nome','$perfil')"); |
@@ -216,6 +227,10 @@ function importarXmlSistemas() | @@ -216,6 +227,10 @@ function importarXmlSistemas() | ||
216 | { | 227 | { |
217 | $abrir_funcao = ixml($funcao,"ABRIR"); | 228 | $abrir_funcao = ixml($funcao,"ABRIR"); |
218 | $nome_funcao = html_entity_decode(ixml($funcao,"NOMEFUNCAO")); | 229 | $nome_funcao = html_entity_decode(ixml($funcao,"NOMEFUNCAO")); |
230 | + if($convUTF) | ||
231 | + { | ||
232 | + $nome_funcao = utf8_encode($nome_funcao); | ||
233 | + } | ||
219 | $w_funcao = ixml($funcao,"JANELAW"); | 234 | $w_funcao = ixml($funcao,"JANELAW"); |
220 | $h_funcao = ixml($funcao,"JANELAH"); | 235 | $h_funcao = ixml($funcao,"JANELAH"); |
221 | $perfil_funcao = ixml($funcao,"PERFIL"); | 236 | $perfil_funcao = ixml($funcao,"PERFIL"); |
admin/php/webservices.php
@@ -70,9 +70,12 @@ function alterarWS() | @@ -70,9 +70,12 @@ function alterarWS() | ||
70 | try | 70 | try |
71 | { | 71 | { |
72 | require_once("conexao.php"); | 72 | require_once("conexao.php"); |
73 | - //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | ||
74 | - //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | ||
75 | - //$autor = mb_convert_encoding($autor,"UTF-8","ISO-8859-1"); | 73 | + if($convUTF) |
74 | + { | ||
75 | + $nome_ws = utf8_encode($nome_ws); | ||
76 | + $desc_ws = utf8_encode($desc_ws); | ||
77 | + $autor_ws = utf8_encode($autor_ws); | ||
78 | + } | ||
76 | if($id_ws != "") | 79 | if($id_ws != "") |
77 | { | 80 | { |
78 | $dbhw->query("UPDATE i3geoadmin_ws SET desc_ws = '$desc_ws',nome_ws = '$nome_ws', link_ws = '$link_ws', autor_ws = '$autor_ws', tipo_ws = '$tipo_ws' WHERE id_ws = $id_ws"); | 81 | $dbhw->query("UPDATE i3geoadmin_ws SET desc_ws = '$desc_ws',nome_ws = '$nome_ws', link_ws = '$link_ws', autor_ws = '$autor_ws', tipo_ws = '$tipo_ws' WHERE id_ws = $id_ws"); |
@@ -114,6 +117,7 @@ function excluirWS() | @@ -114,6 +117,7 @@ function excluirWS() | ||
114 | function importarXmlWS() | 117 | function importarXmlWS() |
115 | { | 118 | { |
116 | global $xml,$tipo; | 119 | global $xml,$tipo; |
120 | + set_time_limit(180); | ||
117 | if(!file_exists($xml)) | 121 | if(!file_exists($xml)) |
118 | {return "<br><b>Arquivo $xml não encontrado";} | 122 | {return "<br><b>Arquivo $xml não encontrado";} |
119 | include_once("../../classesphp/funcoes_gerais.php"); | 123 | include_once("../../classesphp/funcoes_gerais.php"); |
@@ -131,10 +135,16 @@ function importarXmlWS() | @@ -131,10 +135,16 @@ function importarXmlWS() | ||
131 | { | 135 | { |
132 | foreach($c->item as $item) | 136 | foreach($c->item as $item) |
133 | { | 137 | { |
134 | - $descricao = html_entity_decode(ixml($item,"description")); | 138 | + $desc = html_entity_decode(ixml($item,"description")); |
135 | $nome = html_entity_decode(ixml($item,"title")); | 139 | $nome = html_entity_decode(ixml($item,"title")); |
136 | - $autor = ixml($item,"author"); | 140 | + $autor = html_entity_decode(ixml($item,"author")); |
137 | $link = ixml($item,"link"); | 141 | $link = ixml($item,"link"); |
142 | + if($convUTF) | ||
143 | + { | ||
144 | + $nome = utf8_encode($nome); | ||
145 | + $desc = utf8_encode($desc); | ||
146 | + $autor = utf8_encode($autor); | ||
147 | + } | ||
138 | if(!isset($wsExistentes[$nome])) | 148 | if(!isset($wsExistentes[$nome])) |
139 | $dbhw->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,link_ws,tipo_ws) VALUES ('$nome','$desc','$autor','$link','$tipo')"); | 149 | $dbhw->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,link_ws,tipo_ws) VALUES ('$nome','$desc','$autor','$link','$tipo')"); |
140 | $wsExistentes[$nome] = 0; | 150 | $wsExistentes[$nome] = 0; |