From 20a3f13804557bceea2cc491c5cffb50fa159865 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 3 Nov 2008 16:37:30 +0000 Subject: [PATCH] correção na acentuação nas funções de importação de xml --- admin/php/admin.php | 2 +- admin/php/atlas.php | 8 ++++---- admin/php/conexao.php | 3 +++ admin/php/identifica.php | 2 +- admin/php/mapas.php | 4 ++-- admin/php/mapfiles.php | 1 - admin/php/menutemas.php | 44 +++++++++++++++++++++++++++++++++----------- admin/php/sistemas.php | 4 ++-- admin/php/webservices.php | 4 ++-- 9 files changed, 48 insertions(+), 24 deletions(-) diff --git a/admin/php/admin.php b/admin/php/admin.php index 116952f..e288db0 100644 --- a/admin/php/admin.php +++ b/admin/php/admin.php @@ -167,7 +167,7 @@ function pegaDados($sql,$locaplic="") if($locaplic == "") include("conexao.php"); else - include("$locaplic./admin/php/conexao.php"); + include("$locaplic/admin/php/conexao.php"); $q = $dbh->query($sql,PDO::FETCH_ASSOC); $resultado = $q->fetchAll(); $dbh = null; diff --git a/admin/php/atlas.php b/admin/php/atlas.php index 04fcd76..b941cd4 100644 --- a/admin/php/atlas.php +++ b/admin/php/atlas.php @@ -346,8 +346,8 @@ function importarXmlAtlas() $contaAtlas = 0; foreach($xml->ATLAS as $atlas) { - $titulo = ixml($atlas,"TITULO"); - $desc = ixml($atlas,"DESCRICAO"); + $titulo = html_entity_decode(ixml($atlas,"TITULO")); + $desc = html_entity_decode(ixml($atlas,"DESCRICAO")); $icone = ixml($atlas,"ICONE"); $link = ixml($atlas,"LINKMAISINFO"); $template = ixml($atlas,"TEMPLATEHTML"); @@ -367,8 +367,8 @@ function importarXmlAtlas() $contaPrancha = 0; foreach ($atlas->PRANCHAS->PRANCHA as $prancha) { - $titulo = ixml($prancha,"TITULO"); - $desc = ixml($prancha,"DESCRICAO"); + $titulo = html_entity_decode(ixml($prancha,"TITULO")); + $desc = html_entity_decode(ixml($prancha,"DESCRICAO")); $icone = ixml($prancha,"ICONE"); $link = ixml($prancha,"LINKMAISINFO"); $w = ixml($prancha,"WABERUTRA"); diff --git a/admin/php/conexao.php b/admin/php/conexao.php index b5c03ea..8198a97 100644 --- a/admin/php/conexao.php +++ b/admin/php/conexao.php @@ -53,6 +53,9 @@ else } } } +if(!isset($conexaoadmin)) +{$conexaoadmin = "";} + if($conexaoadmin == "") { $arquivosqlite = $locaplic."/menutemas/admin.db"; diff --git a/admin/php/identifica.php b/admin/php/identifica.php index 9adc26c..b5bdcaf 100644 --- a/admin/php/identifica.php +++ b/admin/php/identifica.php @@ -128,7 +128,7 @@ function importarXmlI() {$iExistentes[$r["nome_i"]] = 0;} foreach($xml->FUNCAO as $item) { - $nome_i = ixml($item,"NOMESIS"); + $nome_i = html_entity_decode(ixml($item,"NOMESIS")); $target_i = ixml($item,"TARGET"); $abrir_i = ixml($item,"ABRIR"); if(!isset($iExistentes[$nome_i])) diff --git a/admin/php/mapas.php b/admin/php/mapas.php index e2f7514..bcd9d67 100644 --- a/admin/php/mapas.php +++ b/admin/php/mapas.php @@ -130,9 +130,9 @@ function importarXmlMapas() foreach($xml->MAPA as $mapa) { $perfil = ixml($mapa,"PERFIL"); - $descricao = ixml($mapa,"DESCRICAO"); + $descricao = html_entity_decode(ixml($mapa,"DESCRICAO")); //$descricao = mb_convert_encoding($descricao,"UTF-8","ISO-8859-1"); - $nome = ixml($mapa,"NOME"); + $nome = html_entity_decode(ixml($mapa,"NOME")); //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); $imagem = ixml($mapa,"IMAGEM"); $temas = ixml($mapa,"TEMAS"); diff --git a/admin/php/mapfiles.php b/admin/php/mapfiles.php index 6d36d88..3360bcc 100644 --- a/admin/php/mapfiles.php +++ b/admin/php/mapfiles.php @@ -28,7 +28,6 @@ File: i3geo/admin/mapfiles.php */ require_once("admin.php"); -$cp = new cpaint(); //faz a busca da função que deve ser executada switch ($funcao) { diff --git a/admin/php/menutemas.php b/admin/php/menutemas.php index 3dc5de9..71c2fe6 100644 --- a/admin/php/menutemas.php +++ b/admin/php/menutemas.php @@ -100,6 +100,28 @@ switch ($funcao) exit; break; + case "pegaTemaPorMapfile": + $sql = "SELECT * from i3geoadmin_temas where codigo_tema = '$codigo_tema'"; + $dados = pegaDados($sql); + if(count($dados) == 0) + { + $id = alteraTemas(); + $nome = ""; + $desc = ""; + $codigo = $codigo_tema; + $tipoa = ""; + $download = "SIM"; + $ogc = "SIM"; + $kml = "SIM"; + $link = ""; + $tags = ""; + alteraTemas(); + $dados = pegaDados($sql); + } + retornaJSON($dados); + exit; + break; + case "pegaTemas2": retornaJSON(pegaTemas2()); exit; @@ -654,7 +676,7 @@ function alteraTemas() //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); //$desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); //$tags = mb_convert_encoding($tags,"UTF-8","ISO-8859-1"); - require_once("conexao.php"); + include("conexao.php"); if($id != "") { $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() } else { - $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 ('','', '','','','','','','')"); + $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 ('','', '','','','','','','')"); $id = $dbh->query("SELECT * FROM i3geoadmin_temas"); $id = $id->fetchAll(); $id = intval($id[count($id)-1]['id_tema']); @@ -750,8 +772,8 @@ function importarXmlMenu() {$gruposExistentes[$r["nome_grupo"]] = 0;} foreach($xml->GRUPO as $grupo) { - $nome = ixml($grupo,"GTIPO"); - $descricao = ixml($grupo,"DTIPO"); + $nome = html_entity_decode(ixml($grupo,"GTIPO")); + $descricao = html_entity_decode(ixml($grupo,"DTIPO")); if(!isset($gruposExistentes[$nome])) $dbhw->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')"); $gruposExistentes[$nome] = 0; @@ -768,7 +790,7 @@ function importarXmlMenu() { foreach($grupo->SGRUPO as $sgrupo) { - $nome = ixml($sgrupo,"SDTIPO"); + $nome = html_entity_decode(ixml($sgrupo,"SDTIPO")); $descricao = ""; if(!isset($subgruposExistentes[$nome])) $dbhw->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')"); @@ -788,8 +810,8 @@ function importarXmlMenu() } foreach($xml->TEMA as $tema) { - $nome = ixml($tema,"TNOME"); - $descricao = ixml($tema,"TDESC"); + $nome = html_entity_decode(ixml($tema,"TNOME")); + $descricao = html_entity_decode(ixml($tema,"TDESC")); $codigo = ixml($tema,"TID"); $link = ixml($tema,"TLINK"); $tipo = ixml($tema,"TIPOA"); @@ -806,8 +828,8 @@ function importarXmlMenu() { foreach($grupo->TEMA as $tema) { - $nome = ixml($tema,"TNOME"); - $descricao = ixml($tema,"TDESC"); + $nome = html_entity_decode(ixml($tema,"TNOME")); + $descricao = html_entity_decode(ixml($tema,"TDESC")); $codigo = ixml($tema,"TID"); $link = ixml($tema,"TLINK"); $tipo = ixml($tema,"TIPOA"); @@ -824,8 +846,8 @@ function importarXmlMenu() { foreach($sgrupo->TEMA as $tema) { - $nome = ixml($tema,"TNOME"); - $descricao = ixml($tema,"TDESC"); + $nome = html_entity_decode(ixml($tema,"TNOME")); + $descricao = html_entity_decode(ixml($tema,"TDESC")); $codigo = ixml($tema,"TID"); $link = ixml($tema,"TLINK"); $tipo = ixml($tema,"TIPOA"); diff --git a/admin/php/sistemas.php b/admin/php/sistemas.php index 9ea251e..d0a8e2a 100644 --- a/admin/php/sistemas.php +++ b/admin/php/sistemas.php @@ -204,7 +204,7 @@ function importarXmlSistemas() {$sistemasExistentes[$r["nome_sistema"]] = 0;} foreach($xml->SISTEMA as $item) { - $nome = ixml($item,"NOMESIS"); + $nome = html_entity_decode(ixml($item,"NOMESIS")); $perfil = ixml($item,"PERFIL"); if(!isset($sistemasExistentes[$nome])) $dbhw->query("INSERT INTO i3geoadmin_sistemas (publicado_sistema,nome_sistema,perfil_sistema) VALUES ('','$nome','$perfil')"); @@ -215,7 +215,7 @@ function importarXmlSistemas() foreach ($item->FUNCAO as $funcao) { $abrir_funcao = ixml($funcao,"ABRIR"); - $nome_funcao = ixml($funcao,"NOMEFUNCAO"); + $nome_funcao = html_entity_decode(ixml($funcao,"NOMEFUNCAO")); $w_funcao = ixml($funcao,"JANELAW"); $h_funcao = ixml($funcao,"JANELAH"); $perfil_funcao = ixml($funcao,"PERFIL"); diff --git a/admin/php/webservices.php b/admin/php/webservices.php index 0a116c0..a1fe0dd 100644 --- a/admin/php/webservices.php +++ b/admin/php/webservices.php @@ -131,8 +131,8 @@ function importarXmlWS() { foreach($c->item as $item) { - $descricao = ixml($item,"description"); - $nome = ixml($item,"title"); + $descricao = html_entity_decode(ixml($item,"description")); + $nome = html_entity_decode(ixml($item,"title")); $autor = ixml($item,"author"); $link = ixml($item,"link"); if(!isset($wsExistentes[$nome])) -- libgit2 0.21.2