Commit 20a3f13804557bceea2cc491c5cffb50fa159865

Authored by Edmar Moretti
1 parent 36047ebe

correção na acentuação nas funções de importação de xml

admin/php/admin.php
... ... @@ -167,7 +167,7 @@ function pegaDados($sql,$locaplic="")
167 167 if($locaplic == "")
168 168 include("conexao.php");
169 169 else
170   - include("$locaplic./admin/php/conexao.php");
  170 + include("$locaplic/admin/php/conexao.php");
171 171 $q = $dbh->query($sql,PDO::FETCH_ASSOC);
172 172 $resultado = $q->fetchAll();
173 173 $dbh = null;
... ...
admin/php/atlas.php
... ... @@ -346,8 +346,8 @@ function importarXmlAtlas()
346 346 $contaAtlas = 0;
347 347 foreach($xml->ATLAS as $atlas)
348 348 {
349   - $titulo = ixml($atlas,"TITULO");
350   - $desc = ixml($atlas,"DESCRICAO");
  349 + $titulo = html_entity_decode(ixml($atlas,"TITULO"));
  350 + $desc = html_entity_decode(ixml($atlas,"DESCRICAO"));
351 351 $icone = ixml($atlas,"ICONE");
352 352 $link = ixml($atlas,"LINKMAISINFO");
353 353 $template = ixml($atlas,"TEMPLATEHTML");
... ... @@ -367,8 +367,8 @@ function importarXmlAtlas()
367 367 $contaPrancha = 0;
368 368 foreach ($atlas->PRANCHAS->PRANCHA as $prancha)
369 369 {
370   - $titulo = ixml($prancha,"TITULO");
371   - $desc = ixml($prancha,"DESCRICAO");
  370 + $titulo = html_entity_decode(ixml($prancha,"TITULO"));
  371 + $desc = html_entity_decode(ixml($prancha,"DESCRICAO"));
372 372 $icone = ixml($prancha,"ICONE");
373 373 $link = ixml($prancha,"LINKMAISINFO");
374 374 $w = ixml($prancha,"WABERUTRA");
... ...
admin/php/conexao.php
... ... @@ -53,6 +53,9 @@ else
53 53 }
54 54 }
55 55 }
  56 +if(!isset($conexaoadmin))
  57 +{$conexaoadmin = "";}
  58 +
56 59 if($conexaoadmin == "")
57 60 {
58 61 $arquivosqlite = $locaplic."/menutemas/admin.db";
... ...
admin/php/identifica.php
... ... @@ -128,7 +128,7 @@ function importarXmlI()
128 128 {$iExistentes[$r["nome_i"]] = 0;}
129 129 foreach($xml->FUNCAO as $item)
130 130 {
131   - $nome_i = ixml($item,"NOMESIS");
  131 + $nome_i = html_entity_decode(ixml($item,"NOMESIS"));
132 132 $target_i = ixml($item,"TARGET");
133 133 $abrir_i = ixml($item,"ABRIR");
134 134 if(!isset($iExistentes[$nome_i]))
... ...
admin/php/mapas.php
... ... @@ -130,9 +130,9 @@ function importarXmlMapas()
130 130 foreach($xml->MAPA as $mapa)
131 131 {
132 132 $perfil = ixml($mapa,"PERFIL");
133   - $descricao = ixml($mapa,"DESCRICAO");
  133 + $descricao = html_entity_decode(ixml($mapa,"DESCRICAO"));
134 134 //$descricao = mb_convert_encoding($descricao,"UTF-8","ISO-8859-1");
135   - $nome = ixml($mapa,"NOME");
  135 + $nome = html_entity_decode(ixml($mapa,"NOME"));
136 136 //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1");
137 137 $imagem = ixml($mapa,"IMAGEM");
138 138 $temas = ixml($mapa,"TEMAS");
... ...
admin/php/mapfiles.php
... ... @@ -28,7 +28,6 @@ File: i3geo/admin/mapfiles.php
28 28  
29 29 */
30 30 require_once("admin.php");
31   -$cp = new cpaint();
32 31 //faz a busca da função que deve ser executada
33 32 switch ($funcao)
34 33 {
... ...
admin/php/menutemas.php
... ... @@ -100,6 +100,28 @@ switch ($funcao)
100 100 exit;
101 101 break;
102 102  
  103 + case "pegaTemaPorMapfile":
  104 + $sql = "SELECT * from i3geoadmin_temas where codigo_tema = '$codigo_tema'";
  105 + $dados = pegaDados($sql);
  106 + if(count($dados) == 0)
  107 + {
  108 + $id = alteraTemas();
  109 + $nome = "";
  110 + $desc = "";
  111 + $codigo = $codigo_tema;
  112 + $tipoa = "";
  113 + $download = "SIM";
  114 + $ogc = "SIM";
  115 + $kml = "SIM";
  116 + $link = "";
  117 + $tags = "";
  118 + alteraTemas();
  119 + $dados = pegaDados($sql);
  120 + }
  121 + retornaJSON($dados);
  122 + exit;
  123 + break;
  124 +
103 125 case "pegaTemas2":
104 126 retornaJSON(pegaTemas2());
105 127 exit;
... ... @@ -654,7 +676,7 @@ function alteraTemas()
654 676 //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1");
655 677 //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1");
656 678 //$tags = mb_convert_encoding($tags,"UTF-8","ISO-8859-1");
657   - require_once("conexao.php");
  679 + include("conexao.php");
658 680 if($id != "")
659 681 {
660 682 $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");
... ... @@ -662,7 +684,7 @@ function alteraTemas()
662 684 }
663 685 else
664 686 {
665   - $dbhw->query("INSERT INTO i3geoadmin_temas (link_tema,kml_tema,ogc_tema,download_tema,nome_tema,desc_tema,codigo_tema,tipoa_tema,tags_tema) VALUES ('','', '','','','','','','')");
  687 + $dbhw->query("INSERT INTO i3geoadmin_temas");// (link_tema,kml_tema,ogc_tema,download_tema,nome_tema,desc_tema,codigo_tema,tipoa_tema,tags_tema) VALUES ('','', '','','','','','','')");
666 688 $id = $dbh->query("SELECT * FROM i3geoadmin_temas");
667 689 $id = $id->fetchAll();
668 690 $id = intval($id[count($id)-1]['id_tema']);
... ... @@ -750,8 +772,8 @@ function importarXmlMenu()
750 772 {$gruposExistentes[$r["nome_grupo"]] = 0;}
751 773 foreach($xml->GRUPO as $grupo)
752 774 {
753   - $nome = ixml($grupo,"GTIPO");
754   - $descricao = ixml($grupo,"DTIPO");
  775 + $nome = html_entity_decode(ixml($grupo,"GTIPO"));
  776 + $descricao = html_entity_decode(ixml($grupo,"DTIPO"));
755 777 if(!isset($gruposExistentes[$nome]))
756 778 $dbhw->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')");
757 779 $gruposExistentes[$nome] = 0;
... ... @@ -768,7 +790,7 @@ function importarXmlMenu()
768 790 {
769 791 foreach($grupo->SGRUPO as $sgrupo)
770 792 {
771   - $nome = ixml($sgrupo,"SDTIPO");
  793 + $nome = html_entity_decode(ixml($sgrupo,"SDTIPO"));
772 794 $descricao = "";
773 795 if(!isset($subgruposExistentes[$nome]))
774 796 $dbhw->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')");
... ... @@ -788,8 +810,8 @@ function importarXmlMenu()
788 810 }
789 811 foreach($xml->TEMA as $tema)
790 812 {
791   - $nome = ixml($tema,"TNOME");
792   - $descricao = ixml($tema,"TDESC");
  813 + $nome = html_entity_decode(ixml($tema,"TNOME"));
  814 + $descricao = html_entity_decode(ixml($tema,"TDESC"));
793 815 $codigo = ixml($tema,"TID");
794 816 $link = ixml($tema,"TLINK");
795 817 $tipo = ixml($tema,"TIPOA");
... ... @@ -806,8 +828,8 @@ function importarXmlMenu()
806 828 {
807 829 foreach($grupo->TEMA as $tema)
808 830 {
809   - $nome = ixml($tema,"TNOME");
810   - $descricao = ixml($tema,"TDESC");
  831 + $nome = html_entity_decode(ixml($tema,"TNOME"));
  832 + $descricao = html_entity_decode(ixml($tema,"TDESC"));
811 833 $codigo = ixml($tema,"TID");
812 834 $link = ixml($tema,"TLINK");
813 835 $tipo = ixml($tema,"TIPOA");
... ... @@ -824,8 +846,8 @@ function importarXmlMenu()
824 846 {
825 847 foreach($sgrupo->TEMA as $tema)
826 848 {
827   - $nome = ixml($tema,"TNOME");
828   - $descricao = ixml($tema,"TDESC");
  849 + $nome = html_entity_decode(ixml($tema,"TNOME"));
  850 + $descricao = html_entity_decode(ixml($tema,"TDESC"));
829 851 $codigo = ixml($tema,"TID");
830 852 $link = ixml($tema,"TLINK");
831 853 $tipo = ixml($tema,"TIPOA");
... ...
admin/php/sistemas.php
... ... @@ -204,7 +204,7 @@ function importarXmlSistemas()
204 204 {$sistemasExistentes[$r["nome_sistema"]] = 0;}
205 205 foreach($xml->SISTEMA as $item)
206 206 {
207   - $nome = ixml($item,"NOMESIS");
  207 + $nome = html_entity_decode(ixml($item,"NOMESIS"));
208 208 $perfil = ixml($item,"PERFIL");
209 209 if(!isset($sistemasExistentes[$nome]))
210 210 $dbhw->query("INSERT INTO i3geoadmin_sistemas (publicado_sistema,nome_sistema,perfil_sistema) VALUES ('','$nome','$perfil')");
... ... @@ -215,7 +215,7 @@ function importarXmlSistemas()
215 215 foreach ($item->FUNCAO as $funcao)
216 216 {
217 217 $abrir_funcao = ixml($funcao,"ABRIR");
218   - $nome_funcao = ixml($funcao,"NOMEFUNCAO");
  218 + $nome_funcao = html_entity_decode(ixml($funcao,"NOMEFUNCAO"));
219 219 $w_funcao = ixml($funcao,"JANELAW");
220 220 $h_funcao = ixml($funcao,"JANELAH");
221 221 $perfil_funcao = ixml($funcao,"PERFIL");
... ...
admin/php/webservices.php
... ... @@ -131,8 +131,8 @@ function importarXmlWS()
131 131 {
132 132 foreach($c->item as $item)
133 133 {
134   - $descricao = ixml($item,"description");
135   - $nome = ixml($item,"title");
  134 + $descricao = html_entity_decode(ixml($item,"description"));
  135 + $nome = html_entity_decode(ixml($item,"title"));
136 136 $autor = ixml($item,"author");
137 137 $link = ixml($item,"link");
138 138 if(!isset($wsExistentes[$nome]))
... ...