Commit 0f0bfabc4c4b726cfff7b36bb4f73bf38fe0cfcc
1 parent
755b6c21
Exists in
master
and in
7 other branches
Correção na acentuação das respostas em ajax
Showing
1 changed file
with
13 additions
and
9 deletions
Show diff stats
admin/php/classe_arvore.php
@@ -31,7 +31,7 @@ class Arvore | @@ -31,7 +31,7 @@ class Arvore | ||
31 | if($editores != "") | 31 | if($editores != "") |
32 | {$this->editor = $this->verificaeditores($editores);} | 32 | {$this->editor = $this->verificaeditores($editores);} |
33 | $this->editores = $editores; | 33 | $this->editores = $editores; |
34 | - $this->pubsql = "publicado != 'NAO' or publicado isnull"; | 34 | + $this->pubsql = " (publicado != 'NAO' or publicado isnull) and "; |
35 | if($this->editor) | 35 | if($this->editor) |
36 | {$this->pubsql = "";} | 36 | {$this->pubsql = "";} |
37 | } | 37 | } |
@@ -57,7 +57,7 @@ class Arvore | @@ -57,7 +57,7 @@ class Arvore | ||
57 | if(strtolower($reg["aberto"]) == "sim") | 57 | if(strtolower($reg["aberto"]) == "sim") |
58 | $status = "aberto"; | 58 | $status = "aberto"; |
59 | $url = "";//$this->urli3geo."/admin/xmlmenutemas.php?id_menu=".$reg["id_menu"]; | 59 | $url = "";//$this->urli3geo."/admin/xmlmenutemas.php?id_menu=".$reg["id_menu"]; |
60 | - $resultado[] = array("desc"=>$reg["desc_menu"],"publicado"=>$reg["publicado_menu"],"nomemenu"=>$reg["nome_menu"],"idmenu"=>$reg["id_menu"],"arquivo"=>"","status"=>$status,"url"=>$url); | 60 | + $resultado[] = array("desc"=>$this->converte($reg["desc_menu"]),"publicado"=>$reg["publicado_menu"],"nomemenu"=>$this->converte($reg["nome_menu"]),"idmenu"=>$reg["id_menu"],"arquivo"=>"","status"=>$status,"url"=>$url); |
61 | } | 61 | } |
62 | } | 62 | } |
63 | return $resultado; | 63 | return $resultado; |
@@ -94,7 +94,7 @@ class Arvore | @@ -94,7 +94,7 @@ class Arvore | ||
94 | $down = "nao"; | 94 | $down = "nao"; |
95 | if (strtolower($t["download_tema"]) == "sim") | 95 | if (strtolower($t["download_tema"]) == "sim") |
96 | {$down = "sim";} | 96 | {$down = "sim";} |
97 | - $texto = array("tid"=>$tema["codigo_tema"],"nome"=>$tema["nome_tema"],"link"=>$t["link_tema"],"download"=>$down); | 97 | + $texto = array("tid"=>$tema["codigo_tema"],"nome"=>$this->converte($tema["nome_tema"]),"link"=>$t["link_tema"],"download"=>$down); |
98 | if (stristr($nome,$procurar)) | 98 | if (stristr($nome,$procurar)) |
99 | {$resultado[] = $texto;} | 99 | {$resultado[] = $texto;} |
100 | else | 100 | else |
@@ -106,12 +106,12 @@ class Arvore | @@ -106,12 +106,12 @@ class Arvore | ||
106 | } | 106 | } |
107 | } | 107 | } |
108 | if (count($resultado) > 0) | 108 | if (count($resultado) > 0) |
109 | - {$subgrupo[] = array("subgrupo"=>$sgrupo["nome_subgrupo"],"temas"=>$resultado);} | 109 | + {$subgrupo[] = array("subgrupo"=>$this->converte($sgrupo["nome_subgrupo"]),"temas"=>$resultado);} |
110 | $resultado = array(); | 110 | $resultado = array(); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | if (count($subgrupo) > 0) | 113 | if (count($subgrupo) > 0) |
114 | - {$final[] = array("grupo"=>$grupo["nome_grupo"],"subgrupos"=>$subgrupo);} | 114 | + {$final[] = array("grupo"=>$this->converte($grupo["nome_grupo"]),"subgrupos"=>$subgrupo);} |
115 | $subgrupo = array(); | 115 | $subgrupo = array(); |
116 | } | 116 | } |
117 | } | 117 | } |
@@ -185,11 +185,11 @@ class Arvore | @@ -185,11 +185,11 @@ class Arvore | ||
185 | if (strtolower($tema["ogc_tema"]) == "sim") | 185 | if (strtolower($tema["ogc_tema"]) == "sim") |
186 | {$ogc = "sim";$grupoogc = "sim";} | 186 | {$ogc = "sim";$grupoogc = "sim";} |
187 | } | 187 | } |
188 | - $subgrupos[] = array("publicado"=>($sgrupo["publicado"]),"nome"=>($sgrupo["nome_subgrupo"]),"download"=>$down,"ogc"=>$ogc); | 188 | + $subgrupos[] = array("publicado"=>($sgrupo["publicado"]),"nome"=>$this->converte($sgrupo["nome_subgrupo"]),"download"=>$down,"ogc"=>$ogc); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | } | 191 | } |
192 | - $grupos[] = array("publicado"=>($grupo["publicado"]),"id_n1"=>($grupo["id_n1"]),"nome"=>($grupo["nome_grupo"]),"ogc"=>$grupoogc,"download"=>$grupodown,"subgrupos"=>$subgrupos,"temasgrupo"=>$temas); | 192 | + $grupos[] = array("publicado"=>($grupo["publicado"]),"id_n1"=>($grupo["id_n1"]),"nome"=>$this->converte($grupo["nome_grupo"]),"ogc"=>$grupoogc,"download"=>$grupodown,"subgrupos"=>$subgrupos,"temasgrupo"=>$temas); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | $grupos[] = array("temasraiz"=>$temasraiz); | 195 | $grupos[] = array("temasraiz"=>$temasraiz); |
@@ -225,7 +225,7 @@ class Arvore | @@ -225,7 +225,7 @@ class Arvore | ||
225 | if (strtolower($tema["ogc_tema"]) == "sim") | 225 | if (strtolower($tema["ogc_tema"]) == "sim") |
226 | {$ogc = "sim";$grupoogc = "sim";} | 226 | {$ogc = "sim";$grupoogc = "sim";} |
227 | } | 227 | } |
228 | - $subgrupos[] = array("publicado"=>($sgrupo["publicado"]),"id_n2"=>($sgrupo["id_n2"]),"nome"=>($sgrupo["nome_subgrupo"]),"download"=>$down,"ogc"=>$ogc); | 228 | + $subgrupos[] = array("publicado"=>($sgrupo["publicado"]),"id_n2"=>($sgrupo["id_n2"]),"nome"=>$this->converte($sgrupo["nome_subgrupo"]),"download"=>$down,"ogc"=>$ogc); |
229 | } | 229 | } |
230 | } | 230 | } |
231 | return (array("subgrupo"=>$subgrupos,"temasgrupo"=>$temasraiz)); | 231 | return (array("subgrupo"=>$subgrupos,"temasgrupo"=>$temasraiz)); |
@@ -256,7 +256,7 @@ class Arvore | @@ -256,7 +256,7 @@ class Arvore | ||
256 | {$ogc = "nao";} | 256 | {$ogc = "nao";} |
257 | if ($recordset["link_tema"] != "") | 257 | if ($recordset["link_tema"] != "") |
258 | {$link = $recordset["link_tema"];} | 258 | {$link = $recordset["link_tema"];} |
259 | - return array("publicado"=>$publicado,"nacessos"=>($recordset["nacessos"]),"tid"=>($recordset["codigo_tema"]),"nome"=>($recordset["nome_tema"]),"link"=>$link,"download"=>$down,"ogc"=>$ogc); | 259 | + return array("publicado"=>$publicado,"nacessos"=>($recordset["nacessos"]),"tid"=>($recordset["codigo_tema"]),"nome"=>$this->converte($recordset["nome_tema"]),"link"=>$link,"download"=>$down,"ogc"=>$ogc); |
260 | } | 260 | } |
261 | //executa o sql | 261 | //executa o sql |
262 | function execSQL($sql) | 262 | function execSQL($sql) |
@@ -319,5 +319,9 @@ class Arvore | @@ -319,5 +319,9 @@ class Arvore | ||
319 | $str = preg_replace("/\s+/i", ' ', $str); | 319 | $str = preg_replace("/\s+/i", ' ', $str); |
320 | return $str; | 320 | return $str; |
321 | } | 321 | } |
322 | + function converte($texto){ | ||
323 | + $texto = mb_convert_encoding($texto,mb_detect_encoding($texto),"UTF-8"); | ||
324 | + return $texto; | ||
325 | + } | ||
322 | } | 326 | } |
323 | ?> | 327 | ?> |
324 | \ No newline at end of file | 328 | \ No newline at end of file |