Commit 44af465ffb49c234acdecd25207a343e8cf02b1f

Authored by Edmar Moretti
1 parent f3ef944a

Ajustes na codificação de caracteres da legenda

admin/admin.db
No preview for this file type
aplicmap/legenda6.htm
1 1 <!--
2   -
3 2 [leg_layer_html opt_flag=1]
4   -
5 3 </div><div style='display:block;' id='legendaLayer_[leg_layer_name]' >
6   -
7   - <table class=legendatemas cellspacing=0 width=248 >
8 4 [if name=TEMA oper=neq value=NAO]
9 5 <table [if name=CLASSE oper=eq value=NAO] style=display:none; [/if] >
10 6 <tr><td style=text-align:left >
... ... @@ -22,22 +18,18 @@
22 18 [/leg_layer_html]
23 19  
24 20 [leg_class_html]
25   -
  21 +<table style=margin-top:5px;position:relative;left:15px; >
26 22 [if name=CLASSE oper=neq value=NAO]
27   - <table style=margin-top:5px;position:relative;left:15px; >
28 23 <tr>
29 24 <td style=width:20px;text-align:left; ><input type=checkbox CHECKED title=liga/desliga class=inputsb style='border: 0px solid red;cursor:pointer;opacity:0.3;' value=[leg_class_index] name=[leg_layer_name] id='legendack_[leg_layer_name]_[leg_class_index]' onclick='i3GEO.arvoreDeCamadas.inverteStatusClasse(this)' />
30 25 </td>
31 26 <td style=text-align:left >
32 27 <img src=[leg_icon width=16 height=16 ] />
33 28 </td>
34   - <td width=195 style=text-align:left; ><span style=font-size:9px;position:relative;left:2px; >[leg_class_name]</span></td>
  29 + <td style="text-align:left;width:195px" ><span style="font-size:9px;position:relative;left:2px;" >[leg_class_name]</span></td>
35 30 </tr>
36   - </table>
37 31 [/if]
38   - </table>
  32 +</table>
39 33  
40 34 [/leg_class_html]
41   -
42   --->
43   -
  35 +-->
44 36 \ No newline at end of file
... ...
classesphp/classe_alteraclasse.php
... ... @@ -195,7 +195,7 @@ class Alteraclasse
195 195 $ids = explode(";",$ids);
196 196 $minScales = explode(";",$minScales);
197 197 $maxScales = explode(";",$maxScales);
198   - //$nomes = mb_convert_encoding($nomes,"ISO-8859-1","UTF-8");
  198 + $nomes = $this->converteTexto($nomes);
199 199 $nomes = explode(";",$nomes);
200 200 //$exps = mb_convert_encoding($exps,"ISO-8859-1","UTF-8");
201 201 $exps = explode(";",$exps);
... ... @@ -576,8 +576,8 @@ class Alteraclasse
576 576 {
577 577 $ns = $vs;
578 578 }
579   - else
580   - {$ns = $this->pegaValores($this->mapa,$this->layer,$itemNome,false,$ignorar);
  579 + else{
  580 + $ns = $this->pegaValores($this->mapa,$this->layer,$itemNome,false,$ignorar);
581 581 }
582 582 $lista = array();
583 583 for ($i = 0; $i < count($vs); ++$i){
... ... @@ -1064,14 +1064,14 @@ class Alteraclasse
1064 1064 {string}
1065 1065 */
1066 1066 function converteTexto($texto)
1067   - {
1068   - if (function_exists("mb_convert_encoding"))
1069   - {
1070   - if (!mb_detect_encoding($texto,"ISO-8859-1",true))
1071   - {
1072   - $texto = mb_convert_encoding($texto,"ISO-8859-1","UTF-8");
1073   - }
1074   - }
  1067 + {
  1068 + if (function_exists("mb_convert_encoding"))
  1069 + {
  1070 + if (!mb_detect_encoding($texto,"UTF-8",true))
  1071 + {
  1072 + $texto = mb_convert_encoding($texto,"UTF-8","ISO-8859-1");
  1073 + }
  1074 + }
1075 1075 return $texto;
1076 1076 }
1077 1077 }
... ...
classesphp/classe_legenda.php
... ... @@ -252,9 +252,13 @@ string com a legenda HTML
252 252 if(!$l = @$this->mapa->processlegendtemplate($tmparray)){
253 253 return ("erro");
254 254 }
255   - if (function_exists("mb_convert_encoding")){
256   - $l = mb_convert_encoding($l,"UTF-8","ISO-8859-1");
  255 + //e necessario explodir as partes da legenda para converter os caracteres
  256 + $pedacos = explode("<tr>",$l);
  257 + $n = count($pedacos);
  258 + for($i=0;$i<$n;$i++){
  259 + $pedacos[$i] = $this->converte($pedacos[$i]);
257 260 }
  261 + $l = implode("<tr>",$pedacos);
258 262 return (array("legenda"=>$l,"desativar"=>$desligar));
259 263 }
260 264 /*
... ... @@ -355,11 +359,14 @@ array
355 359 $imgi->saveImage($nomer);
356 360 $i = ($imgi->imageurl).basename($nomer);
357 361 $nomeclasse = $classe->name;
358   - if (function_exists("mb_convert_encoding"))
359   - {$nomeclasse = mb_convert_encoding($nomeclasse,"UTF-8","ISO-8859-1");}
  362 +
  363 + //if (function_exists("mb_convert_encoding"))
  364 + //{$nomeclasse = mb_convert_encoding($nomeclasse,"UTF-8","ISO-8859-1");}
  365 + $nomeclasse = $this->converte($nomeclasse);
360 366 $nomeexp = $classe->getExpressionString();
361 367 if (function_exists("mb_convert_encoding"))
362 368 {$nomeexp = mb_convert_encoding($nomeexp,"UTF-8","ISO-8859-1");}
  369 +
363 370 $linhas[] = array("tema"=>$l,"idclasse"=>$c,"nomeclasse"=>$nomeclasse,"expressao"=>$nomeexp,"imagem"=>$i,"proc"=>"","minScale"=>$classe->minscaledenom,"maxScale"=>$classe->maxscaledenom);
364 371 }
365 372 if (($totaliza=="sim") && ($nc > 1)){
... ... @@ -918,6 +925,16 @@ $width
918 925 $this->layer->setMetaData("cache","");
919 926 return "ok";
920 927 }
921   -
  928 + function converte($texto)
  929 + {
  930 + if (function_exists("mb_convert_encoding"))
  931 + {
  932 + if (!mb_detect_encoding($texto,"UTF-8",true))
  933 + {
  934 + $texto = mb_convert_encoding($texto,"UTF-8","ISO-8859-1");
  935 + }
  936 + }
  937 + return $texto;
  938 + }
922 939 }
923 940 ?>
924 941 \ No newline at end of file
... ...