Commit 11f04aae6f809a924452e57db73caa1313396365

Authored by Edmar Moretti
1 parent cef907d5

--no commit message

admin/php/editormapfile.php
1 <?php 1 <?php
2 /* 2 /*
3 - Title: editormapfile.php 3 +Title: editormapfile.php
4 4
5 Fun&ccedil;&otilde;es utilizadas pelo editor de arquivos mapfile. 5 Fun&ccedil;&otilde;es utilizadas pelo editor de arquivos mapfile.
6 6
@@ -85,12 +85,12 @@ error_reporting(0); @@ -85,12 +85,12 @@ error_reporting(0);
85 switch (strtoupper($funcao)) 85 switch (strtoupper($funcao))
86 { 86 {
87 /* 87 /*
88 - Note: 88 + Note:
89 89
90 Valores que o par&acirc;metro &funcao pode receber. Os par&acirc;metros devem ser enviados na requisi&ccedil;&atilde;o em AJAX. 90 Valores que o par&acirc;metro &funcao pode receber. Os par&acirc;metros devem ser enviados na requisi&ccedil;&atilde;o em AJAX.
91 */ 91 */
92 /* 92 /*
93 - Valor: CRIARNOVOMAP 93 + Valor: CRIARNOVOMAP
94 94
95 Cria um novo mapfile 95 Cria um novo mapfile
96 96
@@ -128,7 +128,7 @@ switch (strtoupper($funcao)) @@ -128,7 +128,7 @@ switch (strtoupper($funcao))
128 exit; 128 exit;
129 break; 129 break;
130 /* 130 /*
131 - Valor: EDITASIMBOLO 131 + Valor: EDITASIMBOLO
132 132
133 Lista os s&iacute;mbolos de um determinado tipo 133 Lista os s&iacute;mbolos de um determinado tipo
134 134
@@ -180,7 +180,7 @@ switch (strtoupper($funcao)) @@ -180,7 +180,7 @@ switch (strtoupper($funcao))
180 exit; 180 exit;
181 break; 181 break;
182 /* 182 /*
183 - Valor: PEGALAYERS 183 + Valor: PEGALAYERS
184 184
185 Lista os layers existentes em um mapfile 185 Lista os layers existentes em um mapfile
186 186
@@ -197,7 +197,7 @@ switch (strtoupper($funcao)) @@ -197,7 +197,7 @@ switch (strtoupper($funcao))
197 exit; 197 exit;
198 break; 198 break;
199 /* 199 /*
200 - Valor: PEGAITENSLAYER 200 + Valor: PEGAITENSLAYER
201 201
202 Lista os itens da tabela de atributos de um layer 202 Lista os itens da tabela de atributos de um layer
203 203
@@ -216,7 +216,7 @@ switch (strtoupper($funcao)) @@ -216,7 +216,7 @@ switch (strtoupper($funcao))
216 exit; 216 exit;
217 break; 217 break;
218 /* 218 /*
219 - Valor: LIMPARCACHEMAPFILE 219 + Valor: LIMPARCACHEMAPFILE
220 220
221 Apaga o diretório contendo o cache de um tema (mapfile) 221 Apaga o diretório contendo o cache de um tema (mapfile)
222 222
@@ -251,7 +251,7 @@ switch (strtoupper($funcao)) @@ -251,7 +251,7 @@ switch (strtoupper($funcao))
251 exit; 251 exit;
252 break; 252 break;
253 /* 253 /*
254 - Valor: EXCLUIRMAPFILE 254 + Valor: EXCLUIRMAPFILE
255 255
256 Exclui um mapfile. 256 Exclui um mapfile.
257 257
@@ -299,7 +299,7 @@ switch (strtoupper($funcao)) @@ -299,7 +299,7 @@ switch (strtoupper($funcao))
299 } 299 }
300 break; 300 break;
301 /* 301 /*
302 - Valor: REFAZERLAYER 302 + Valor: REFAZERLAYER
303 303
304 Altera um layer existente em um mapfile com base em um layer existente em outro mapfile 304 Altera um layer existente em um mapfile com base em um layer existente em outro mapfile
305 305
@@ -320,7 +320,7 @@ switch (strtoupper($funcao)) @@ -320,7 +320,7 @@ switch (strtoupper($funcao))
320 exit; 320 exit;
321 break; 321 break;
322 /* 322 /*
323 - Valor: CLONARMAPFILE 323 + Valor: CLONARMAPFILE
324 324
325 Copia um mapfile existente 325 Copia um mapfile existente
326 326
@@ -339,7 +339,7 @@ switch (strtoupper($funcao)) @@ -339,7 +339,7 @@ switch (strtoupper($funcao))
339 exit; 339 exit;
340 break; 340 break;
341 /* 341 /*
342 - Valor: CRIARNOVOLAYER 342 + Valor: CRIARNOVOLAYER
343 343
344 Cria um novo layer em um mapfile 344 Cria um novo layer em um mapfile
345 345
@@ -358,7 +358,7 @@ switch (strtoupper($funcao)) @@ -358,7 +358,7 @@ switch (strtoupper($funcao))
358 exit; 358 exit;
359 break; 359 break;
360 /* 360 /*
361 - Valor: EXCLUIRLAYER 361 + Valor: EXCLUIRLAYER
362 362
363 Exclui um layer de um mapfile 363 Exclui um layer de um mapfile
364 364
@@ -378,7 +378,7 @@ switch (strtoupper($funcao)) @@ -378,7 +378,7 @@ switch (strtoupper($funcao))
378 break; 378 break;
379 379
380 /* 380 /*
381 - Valor: LISTACLASSES 381 + Valor: LISTACLASSES
382 382
383 Lista as classes da legenda de um layer em um mapfile 383 Lista as classes da legenda de um layer em um mapfile
384 384
@@ -397,7 +397,7 @@ switch (strtoupper($funcao)) @@ -397,7 +397,7 @@ switch (strtoupper($funcao))
397 exit; 397 exit;
398 break; 398 break;
399 /* 399 /*
400 - Valor: AUTOCLASSESLAYER 400 + Valor: AUTOCLASSESLAYER
401 401
402 Cria classes em um layer com base na tabela de atributos 402 Cria classes em um layer com base na tabela de atributos
403 403
@@ -421,7 +421,7 @@ switch (strtoupper($funcao)) @@ -421,7 +421,7 @@ switch (strtoupper($funcao))
421 exit; 421 exit;
422 break; 422 break;
423 /* 423 /*
424 - Valor: CRIARNOVACLASSE 424 + Valor: CRIARNOVACLASSE
425 425
426 Cria uma nova classe em um layer 426 Cria uma nova classe em um layer
427 427
@@ -440,7 +440,7 @@ switch (strtoupper($funcao)) @@ -440,7 +440,7 @@ switch (strtoupper($funcao))
440 exit; 440 exit;
441 break; 441 break;
442 /* 442 /*
443 - Valor: EXCLUIRCLASSE 443 + Valor: EXCLUIRCLASSE
444 444
445 Cria uma nova classe em um layer 445 Cria uma nova classe em um layer
446 446
@@ -462,7 +462,7 @@ switch (strtoupper($funcao)) @@ -462,7 +462,7 @@ switch (strtoupper($funcao))
462 exit; 462 exit;
463 break; 463 break;
464 /* 464 /*
465 - Valor: LISTAESTILOS 465 + Valor: LISTAESTILOS
466 466
467 Lista de estilos existentes em uma classe de um layer 467 Lista de estilos existentes em uma classe de um layer
468 468
@@ -483,7 +483,7 @@ switch (strtoupper($funcao)) @@ -483,7 +483,7 @@ switch (strtoupper($funcao))
483 exit; 483 exit;
484 break; 484 break;
485 /* 485 /*
486 - Valor: CRIARNOVOESTILO 486 + Valor: CRIARNOVOESTILO
487 487
488 Adiciona um novo estilo em uma classe 488 Adiciona um novo estilo em uma classe
489 489
@@ -504,7 +504,7 @@ switch (strtoupper($funcao)) @@ -504,7 +504,7 @@ switch (strtoupper($funcao))
504 exit; 504 exit;
505 break; 505 break;
506 /* 506 /*
507 - Valor: EXCLUIRESTILO 507 + Valor: EXCLUIRESTILO
508 508
509 Exclui um estilo de uma classe 509 Exclui um estilo de uma classe
510 510
@@ -528,7 +528,7 @@ switch (strtoupper($funcao)) @@ -528,7 +528,7 @@ switch (strtoupper($funcao))
528 exit; 528 exit;
529 break; 529 break;
530 /* 530 /*
531 - Valor: PEGAESTILO 531 + Valor: PEGAESTILO
532 532
533 Obt&eacute;m os dados de um estilo de uma classe 533 Obt&eacute;m os dados de um estilo de uma classe
534 534
@@ -551,7 +551,7 @@ switch (strtoupper($funcao)) @@ -551,7 +551,7 @@ switch (strtoupper($funcao))
551 exit; 551 exit;
552 break; 552 break;
553 /* 553 /*
554 - Valor: ALTERARESTILO 554 + Valor: ALTERARESTILO
555 555
556 Altera um estilo de uma classe 556 Altera um estilo de uma classe
557 557
@@ -603,7 +603,7 @@ switch (strtoupper($funcao)) @@ -603,7 +603,7 @@ switch (strtoupper($funcao))
603 exit; 603 exit;
604 break; 604 break;
605 /* 605 /*
606 - Valor: PEGACONEXAO 606 + Valor: PEGACONEXAO
607 607
608 Obt&eacute;m os valores dos elementos de conex&atilde;o com uma base de dados de um layer 608 Obt&eacute;m os valores dos elementos de conex&atilde;o com uma base de dados de um layer
609 609
@@ -622,7 +622,7 @@ switch (strtoupper($funcao)) @@ -622,7 +622,7 @@ switch (strtoupper($funcao))
622 exit; 622 exit;
623 break; 623 break;
624 /* 624 /*
625 - Valor: ALTERARCONEXAO 625 + Valor: ALTERARCONEXAO
626 626
627 Altera os valores dos elementos de conex&atilde;o com uma base de dados de um layer 627 Altera os valores dos elementos de conex&atilde;o com uma base de dados de um layer
628 628
@@ -657,7 +657,7 @@ switch (strtoupper($funcao)) @@ -657,7 +657,7 @@ switch (strtoupper($funcao))
657 exit; 657 exit;
658 break; 658 break;
659 /* 659 /*
660 - Valor: PEGAMETADADOS 660 + Valor: PEGAMETADADOS
661 661
662 Obt&eacute;m os valores dos elementos de metadados de um layer 662 Obt&eacute;m os valores dos elementos de metadados de um layer
663 663
@@ -676,7 +676,7 @@ switch (strtoupper($funcao)) @@ -676,7 +676,7 @@ switch (strtoupper($funcao))
676 exit; 676 exit;
677 break; 677 break;
678 /* 678 /*
679 - Valor: PEGATITULO 679 + Valor: PEGATITULO
680 680
681 Obt&eacute;m os valores de titulo, descricao, etc 681 Obt&eacute;m os valores de titulo, descricao, etc
682 682
@@ -719,7 +719,7 @@ switch (strtoupper($funcao)) @@ -719,7 +719,7 @@ switch (strtoupper($funcao))
719 break; 719 break;
720 720
721 /* 721 /*
722 - Valor: ALTERARMETADADOS 722 + Valor: ALTERARMETADADOS
723 723
724 Altera os valores dos elementos de metadados de um layer 724 Altera os valores dos elementos de metadados de um layer
725 725
@@ -813,7 +813,7 @@ switch (strtoupper($funcao)) @@ -813,7 +813,7 @@ switch (strtoupper($funcao))
813 exit; 813 exit;
814 break; 814 break;
815 /* 815 /*
816 - Valor: PEGAGERAL 816 + Valor: PEGAGERAL
817 817
818 Obt&eacute;m os valores dos elementos de configura&ccedil;&atilde;o geral de um layer 818 Obt&eacute;m os valores dos elementos de configura&ccedil;&atilde;o geral de um layer
819 819
@@ -832,7 +832,7 @@ switch (strtoupper($funcao)) @@ -832,7 +832,7 @@ switch (strtoupper($funcao))
832 exit; 832 exit;
833 break; 833 break;
834 /* 834 /*
835 - Valor: ALTERARGERAL 835 + Valor: ALTERARGERAL
836 836
837 Modifica os valores dos elementos de configura&ccedil;&atilde;o geral de um layer 837 Modifica os valores dos elementos de configura&ccedil;&atilde;o geral de um layer
838 838
@@ -898,7 +898,7 @@ switch (strtoupper($funcao)) @@ -898,7 +898,7 @@ switch (strtoupper($funcao))
898 exit; 898 exit;
899 break; 899 break;
900 /* 900 /*
901 - Valor: PEGACLASSEGERAL 901 + Valor: PEGACLASSEGERAL
902 902
903 Obt&eacute;m os valores dos elementos de configura&ccedil;&atilde;o geral de uma classe 903 Obt&eacute;m os valores dos elementos de configura&ccedil;&atilde;o geral de uma classe
904 904
@@ -919,7 +919,7 @@ switch (strtoupper($funcao)) @@ -919,7 +919,7 @@ switch (strtoupper($funcao))
919 exit; 919 exit;
920 break; 920 break;
921 /* 921 /*
922 - Valor: ALTERARCLASSEGERAL 922 + Valor: ALTERARCLASSEGERAL
923 923
924 Altera os valores dos elementos de configura&ccedil;&atilde;o geral de uma classe 924 Altera os valores dos elementos de configura&ccedil;&atilde;o geral de uma classe
925 925
@@ -955,7 +955,7 @@ switch (strtoupper($funcao)) @@ -955,7 +955,7 @@ switch (strtoupper($funcao))
955 exit; 955 exit;
956 break; 956 break;
957 /* 957 /*
958 - Valor: PEGACLASSELABEL 958 + Valor: PEGACLASSELABEL
959 959
960 Obt&eacute;m os valores dos elementos de configura&ccedil;&atilde;o da topon&iacute;mia de uma classe 960 Obt&eacute;m os valores dos elementos de configura&ccedil;&atilde;o da topon&iacute;mia de uma classe
961 961
@@ -976,7 +976,7 @@ switch (strtoupper($funcao)) @@ -976,7 +976,7 @@ switch (strtoupper($funcao))
976 exit; 976 exit;
977 break; 977 break;
978 /* 978 /*
979 - Valor: ALTERARCLASSELABEL 979 + Valor: ALTERARCLASSELABEL
980 980
981 Altera os valores dos elementos de configura&ccedil;&atilde;o da topon&iacute;mia de uma classe 981 Altera os valores dos elementos de configura&ccedil;&atilde;o da topon&iacute;mia de uma classe
982 982
@@ -1891,7 +1891,14 @@ function pegaClasseLabel() @@ -1891,7 +1891,14 @@ function pegaClasseLabel()
1891 $mapa = ms_newMapObj($mapfile); 1891 $mapa = ms_newMapObj($mapfile);
1892 $layer = $mapa->getlayerbyname($codigoLayer); 1892 $layer = $mapa->getlayerbyname($codigoLayer);
1893 $classe = $layer->getclass($indiceClasse); 1893 $classe = $layer->getclass($indiceClasse);
1894 - $label = $classe->label; 1894 + $v = versao();
  1895 + $vi = $v["inteiro"];
  1896 + if($vi >= 60200){
  1897 + $label = $classe->getLabel(0);
  1898 + }
  1899 + else{
  1900 + $label = $classe->label;
  1901 + }
1895 if ($label != "") 1902 if ($label != "")
1896 { 1903 {
1897 $dados["font"] = $label->font; 1904 $dados["font"] = $label->font;
classesphp/classe_mapa.php
@@ -65,6 +65,14 @@ class Mapa @@ -65,6 +65,14 @@ class Mapa
65 Vers&atilde;o atual do Mapserver (primeiro d&iacute;gito) 65 Vers&atilde;o atual do Mapserver (primeiro d&iacute;gito)
66 */ 66 */
67 public $v; 67 public $v;
  68 + /*
  69 + Variavel: $vi
  70 +
  71 + Vers&atilde;o atual do Mapserver (valor inteiro)
  72 +
  73 + Returns the MapServer version number (x.y.z) as an integer (x*10000 + y*100 + z). (New in v5.0) e.g. V5.4.3 would return 50403
  74 + */
  75 + public $vi;
68 /* 76 /*
69 Function: __construct 77 Function: __construct
70 78
@@ -76,20 +84,21 @@ $map_file - Endere&amp;ccedil;o do mapfile no servidor. @@ -76,20 +84,21 @@ $map_file - Endere&amp;ccedil;o do mapfile no servidor.
76 */ 84 */
77 function __construct($map_file,$locaplic="") 85 function __construct($map_file,$locaplic="")
78 { 86 {
79 - error_reporting(0);  
80 - if (!function_exists('ms_newMapObj')) {return false;}  
81 - if(file_exists($locaplic."/funcoes_gerais.php"))  
82 - include_once($locaplic."/funcoes_gerais.php");  
83 - else  
84 - include_once("funcoes_gerais.php"); 87 + error_reporting(0);
  88 + if (!function_exists('ms_newMapObj')) {return false;}
  89 + if(file_exists($locaplic."/funcoes_gerais.php"))
  90 + include_once($locaplic."/funcoes_gerais.php");
  91 + else
  92 + include_once("funcoes_gerais.php");
85 $this->v = versao(); 93 $this->v = versao();
  94 + $this->vi = $this->v["inteiro"];
86 $this->v = $this->v["principal"]; 95 $this->v = $this->v["principal"];
87 $this->qyfile = str_replace(".map",".qy",$map_file); 96 $this->qyfile = str_replace(".map",".qy",$map_file);
88 - $this->locaplic = $locaplic;  
89 - if(!file_exists($map_file))  
90 - {return $this->arquivo = false;}  
91 - if(!@ms_newMapObj($map_file))  
92 - {return $this->mapa = false;} 97 + $this->locaplic = $locaplic;
  98 + if(!file_exists($map_file))
  99 + {return $this->arquivo = false;}
  100 + if(!@ms_newMapObj($map_file))
  101 + {return $this->mapa = false;}
93 $this->mapa = @ms_newMapObj($map_file); 102 $this->mapa = @ms_newMapObj($map_file);
94 $this->arquivo = $map_file; 103 $this->arquivo = $map_file;
95 $c = $this->mapa->numlayers; 104 $c = $this->mapa->numlayers;
@@ -104,10 +113,10 @@ Method: salva @@ -104,10 +113,10 @@ Method: salva
104 113
105 Salva o mapfile atual 114 Salva o mapfile atual
106 */ 115 */
107 - function salva()  
108 - {  
109 - if(connection_aborted()){exit();}  
110 - $this->mapa->save($this->arquivo); 116 + function salva()
  117 + {
  118 + if(connection_aborted()){exit();}
  119 + $this->mapa->save($this->arquivo);
111 } 120 }
112 /* 121 /*
113 Method: listaTemasBuscaRapida 122 Method: listaTemasBuscaRapida
@@ -141,8 +150,8 @@ Parametro: @@ -141,8 +150,8 @@ Parametro:
141 150
142 tipo {string} - OUTPUTFORMAT que ser&aacute; aplicado. deve existir no mapfile b&aacute;sico que iniciou o i3Geo 151 tipo {string} - OUTPUTFORMAT que ser&aacute; aplicado. deve existir no mapfile b&aacute;sico que iniciou o i3Geo
143 */ 152 */
144 - function mudaoutputformat($tipo)  
145 - { 153 + function mudaoutputformat($tipo)
  154 + {
146 foreach($this->layers as $l) 155 foreach($this->layers as $l)
147 {$l->setMetaData("cache","");} 156 {$l->setMetaData("cache","");}
148 return $this->mapa->selectOutputFormat($tipo); 157 return $this->mapa->selectOutputFormat($tipo);
@@ -176,7 +185,7 @@ Grava a imagem do mapa atual @@ -176,7 +185,7 @@ Grava a imagem do mapa atual
176 */ 185 */
177 function gravaImagemCorpo() 186 function gravaImagemCorpo()
178 { 187 {
179 - $imgo = $this->mapa->draw(); 188 + $imgo = $this->mapa->draw();
180 $nome = ($imgo->imagepath).nomeRandomico().".png"; 189 $nome = ($imgo->imagepath).nomeRandomico().".png";
181 $imgo->saveImage($nome); 190 $imgo->saveImage($nome);
182 $nome = ($imgo->imageurl).basename($nome); 191 $nome = ($imgo->imageurl).basename($nome);
@@ -374,9 +383,9 @@ Include: @@ -374,9 +383,9 @@ Include:
374 { 383 {
375 ms_ResetErrorList(); 384 ms_ResetErrorList();
376 if(file_exists($this->locaplic."/classe_imagem.php")) 385 if(file_exists($this->locaplic."/classe_imagem.php"))
377 - include_once($this->locaplic."/classe_imagem.php");  
378 - else  
379 - include_once("classe_imagem.php"); 386 + include_once($this->locaplic."/classe_imagem.php");
  387 + else
  388 + include_once("classe_imagem.php");
380 $nomer = ""; 389 $nomer = "";
381 $qy = file_exists($this->qyfile); 390 $qy = file_exists($this->qyfile);
382 if($qy) 391 if($qy)
@@ -632,7 +641,7 @@ nome @@ -632,7 +641,7 @@ nome
632 { 641 {
633 foreach ($this->layers as $layer) 642 foreach ($this->layers as $layer)
634 { 643 {
635 - if ($layer->getmetadata("ESCONDIDO") == "") 644 + if ($layer->getmetadata("ESCONDIDO") == "")
636 {$final[] = array("tema"=>$layer->name,"nome"=>(pegaNome($layer,"UTF-8")));} 645 {$final[] = array("tema"=>$layer->name,"nome"=>(pegaNome($layer,"UTF-8")));}
637 } 646 }
638 } 647 }
@@ -735,7 +744,7 @@ nome @@ -735,7 +744,7 @@ nome
735 $res_count = $layer->getNumresults(); 744 $res_count = $layer->getNumresults();
736 if ($res_count > 0) 745 if ($res_count > 0)
737 { 746 {
738 - $nometmp = pegaNome($layer,"UTF-8"); 747 + $nometmp = pegaNome($layer,"UTF-8");
739 $final[] = array("tema"=>$layer->name,"nome"=>$nometmp); 748 $final[] = array("tema"=>$layer->name,"nome"=>$nometmp);
740 } 749 }
741 } 750 }
@@ -887,7 +896,12 @@ $incluitexto - sim|nao @@ -887,7 +896,12 @@ $incluitexto - sim|nao
887 $cor->setrgb($corlinha[0],$corlinha[1],$corlinha[2]); 896 $cor->setrgb($corlinha[0],$corlinha[1],$corlinha[2]);
888 if($incluitexto == "sim") 897 if($incluitexto == "sim")
889 { 898 {
890 - $label = $classe->label; 899 + if($this->vi >= 60200){
  900 + $label = $classe->getLabel(0);
  901 + }
  902 + else{
  903 + $label = $classe->label;
  904 + }
891 $label->set("size",$tamanhotexto); 905 $label->set("size",$tamanhotexto);
892 $label->set("type",MS_BITMAP); 906 $label->set("type",MS_BITMAP);
893 if ($fonte != "bitmap") 907 if ($fonte != "bitmap")
@@ -1786,14 +1800,14 @@ $arq - Nome do arquivo. @@ -1786,14 +1800,14 @@ $arq - Nome do arquivo.
1786 } 1800 }
1787 function adicionaAcesso($codigo_tema,$locaplic) 1801 function adicionaAcesso($codigo_tema,$locaplic)
1788 { 1802 {
1789 - $resultado = array();  
1790 - include("$locaplic/admin/php/conexao.php");  
1791 - if(!empty($esquemaadmin)){  
1792 - $esquemaadmin = $esquemaadmin.".";  
1793 - }  
1794 - $dbhw->query("INSERT INTO ".$esquemaadmin."i3geoadmin_acessostema (codigo_tema,nacessos,dia,mes,ano) VALUES ('$codigo_tema',1,".abs(date("d")).",".abs(date("m")).",".abs(date("Y")).")"); 1803 + $resultado = array();
  1804 + include("$locaplic/admin/php/conexao.php");
  1805 + if(!empty($esquemaadmin)){
  1806 + $esquemaadmin = $esquemaadmin.".";
  1807 + }
  1808 + $dbhw->query("INSERT INTO ".$esquemaadmin."i3geoadmin_acessostema (codigo_tema,nacessos,dia,mes,ano) VALUES ('$codigo_tema',1,".abs(date("d")).",".abs(date("m")).",".abs(date("Y")).")");
1795 $dbh = null; 1809 $dbh = null;
1796 - $dbhw = null; 1810 + $dbhw = null;
1797 } 1811 }
1798 // 1812 //
1799 //esta fun&ccedil;&atilde;o n&atilde;o est&aacute; concluida 1813 //esta fun&ccedil;&atilde;o n&atilde;o est&aacute; concluida
classesphp/classe_toponimia.php
@@ -65,6 +65,20 @@ class Toponimia @@ -65,6 +65,20 @@ class Toponimia
65 Nome do layer 65 Nome do layer
66 */ 66 */
67 protected $nome; 67 protected $nome;
  68 + /*
  69 + Variavel: $v
  70 +
  71 + Vers&atilde;o atual do Mapserver (primeiro d&iacute;gito)
  72 + */
  73 + public $v;
  74 + /*
  75 + Variavel: $vi
  76 +
  77 + Vers&atilde;o atual do Mapserver (valor inteiro)
  78 +
  79 + Returns the MapServer version number (x.y.z) as an integer (x*10000 + y*100 + z). (New in v5.0) e.g. V5.4.3 would return 50403
  80 + */
  81 + public $vi;
68 /* 82 /*
69 function __construct 83 function __construct
70 84
@@ -77,28 +91,29 @@ $tema - nome do tema que ser&amp;aacute; processado @@ -77,28 +91,29 @@ $tema - nome do tema que ser&amp;aacute; processado
77 */ 91 */
78 function __construct($map_file,$tema="",$locaplic="") 92 function __construct($map_file,$tema="",$locaplic="")
79 { 93 {
80 - //error_reporting(0);  
81 - if(file_exists($locaplic."/funcoes_gerais.php"))  
82 - include_once($locaplic."/funcoes_gerais.php");  
83 - else  
84 - include_once("funcoes_gerais.php"); 94 + //error_reporting(0);
  95 + if(file_exists($locaplic."/funcoes_gerais.php"))
  96 + include_once($locaplic."/funcoes_gerais.php");
  97 + else
  98 + include_once("funcoes_gerais.php");
85 $this->v = versao(); 99 $this->v = versao();
  100 + $this->vi = $this->v["inteiro"];
86 $this->v = $this->v["principal"]; 101 $this->v = $this->v["principal"];
87 - $this->mapa = ms_newMapObj($map_file);  
88 - $this->arquivo = $map_file;  
89 - if($tema != "" && @$this->mapa->getlayerbyname($tema))  
90 - $this->layer = $this->mapa->getlayerbyname($tema);  
91 - $this->nome = $tema; 102 + $this->mapa = ms_newMapObj($map_file);
  103 + $this->arquivo = $map_file;
  104 + if($tema != "" && @$this->mapa->getlayerbyname($tema))
  105 + $this->layer = $this->mapa->getlayerbyname($tema);
  106 + $this->nome = $tema;
92 } 107 }
93 /* 108 /*
94 function: salva 109 function: salva
95 110
96 Salva o mapfile atual 111 Salva o mapfile atual
97 */ 112 */
98 - function salva()  
99 - {  
100 - if (connection_aborted()){exit();}  
101 - $this->mapa->save($this->arquivo); 113 + function salva()
  114 + {
  115 + if (connection_aborted()){exit();}
  116 + $this->mapa->save($this->arquivo);
102 } 117 }
103 /* 118 /*
104 function: criaToponimia 119 function: criaToponimia
@@ -198,8 +213,14 @@ Retorno: @@ -198,8 +213,14 @@ Retorno:
198 } 213 }
199 $nclasses = $this->layer->numclasses; 214 $nclasses = $this->layer->numclasses;
200 for ($i=0; $i < $nclasses; ++$i){ 215 for ($i=0; $i < $nclasses; ++$i){
201 - $novac = $this->layer->getclass($i);  
202 - $label = $novac->getlabel(0); 216 + $novac = $this->layer->getclass($i);
  217 + if($this->vi >= 60200){
  218 + $indiceLabel = $novac->addLabel(new labelObj());
  219 + $label = $novac->getLabel($indiceLabel);
  220 + }
  221 + else{
  222 + $label = $novac->label;
  223 + }
203 if($wrap != "") 224 if($wrap != "")
204 { 225 {
205 $label->set("maxlength",1); 226 $label->set("maxlength",1);
@@ -207,7 +228,13 @@ Retorno: @@ -207,7 +228,13 @@ Retorno:
207 $s = "CLASS LABEL WRAP '$wrap' END END"; 228 $s = "CLASS LABEL WRAP '$wrap' END END";
208 $novac->updateFromString($s); 229 $novac->updateFromString($s);
209 } 230 }
210 - $label = $novac->label; 231 + if($this->vi >= 60200){
  232 + $indiceLabel = $novac->addLabel(new labelObj());
  233 + $label = $novac->getLabel($indiceLabel);
  234 + }
  235 + else{
  236 + $label = $novac->label;
  237 + }
211 if ($fonte != "bitmap") 238 if ($fonte != "bitmap")
212 { 239 {
213 $label->set("type",MS_TRUETYPE); 240 $label->set("type",MS_TRUETYPE);
@@ -254,7 +281,7 @@ Retorno: @@ -254,7 +281,7 @@ Retorno:
254 $label->set("position",$p[$position]); 281 $label->set("position",$p[$position]);
255 } 282 }
256 if ($tipo == "teste"){ 283 if ($tipo == "teste"){
257 - $i = gravaImagemMapa($this->mapa); 284 + $i = gravaImagemMapa($this->mapa);
258 return ($i["url"]); 285 return ($i["url"]);
259 } 286 }
260 else 287 else