Commit fae8e9690e09f27fc6225d4f0204ef8bac8e6387

Authored by Edmar Moretti
1 parent d1cd233c

Remoção da passagem de valor por referência na chamada de funções (operação depreciada no PHP)

admin/admin.db
No preview for this file type
admin/php/parsemapfile.php
@@ -396,7 +396,7 @@ function mapfile() @@ -396,7 +396,7 @@ function mapfile()
396 $xml .= "<sizeunits>$layer->sizeunits</sizeunits>\n"; 396 $xml .= "<sizeunits>$layer->sizeunits</sizeunits>\n";
397 $xml .= "<projection>$layer->getProjection</projection>\n"; 397 $xml .= "<projection>$layer->getProjection</projection>\n";
398 $xml .= "<classes>\n"; 398 $xml .= "<classes>\n";
399 - $xml .= pegaClasses(&$xml); 399 + $xml = pegaClasses($xml);
400 $xml .= "</classes>\n"; 400 $xml .= "</classes>\n";
401 } 401 }
402 $xml .= "</layer>"; 402 $xml .= "</layer>";
@@ -421,12 +421,13 @@ function pegaClasses($xml) @@ -421,12 +421,13 @@ function pegaClasses($xml)
421 $xml .= "<symbolname>$classe->symbolname</symbolname>\n"; 421 $xml .= "<symbolname>$classe->symbolname</symbolname>\n";
422 $xml .= "<type>$classe->type</type>\n"; 422 $xml .= "<type>$classe->type</type>\n";
423 $xml .= "<estilos>\n"; 423 $xml .= "<estilos>\n";
424 - pegaEstilos($xml,$classe); 424 + $xml = pegaEstilos($xml,$classe);
425 $xml .= "</estilos>\n"; 425 $xml .= "</estilos>\n";
426 $xml .= "</classe>\n"; 426 $xml .= "</classe>\n";
427 } 427 }
  428 + return $xml;
428 } 429 }
429 -function pegaEstilos(&$xml,$classe) 430 +function pegaEstilos($xml,$classe)
430 { 431 {
431 $numestilos = $classe->numstyles; 432 $numestilos = $classe->numstyles;
432 $estilos = array(); 433 $estilos = array();
@@ -441,6 +442,7 @@ function pegaEstilos(&amp;$xml,$classe) @@ -441,6 +442,7 @@ function pegaEstilos(&amp;$xml,$classe)
441 $xml .= "<outlinecolor>".$estilo->outlinecolor->red.",".$estilo->outlinecolor->green.",".$estilo->outlinecolor->blue."</outlinecolor>\n"; 442 $xml .= "<outlinecolor>".$estilo->outlinecolor->red.",".$estilo->outlinecolor->green.",".$estilo->outlinecolor->blue."</outlinecolor>\n";
442 $xml .= "</estilo>\n"; 443 $xml .= "</estilo>\n";
443 } 444 }
  445 + return $xml;
444 } 446 }
445 447
446 ?> 448 ?>
447 \ No newline at end of file 449 \ No newline at end of file
admin/php/xml.php
@@ -94,7 +94,7 @@ function geraXmlSistemas($perfil,$locaplic,$editores) @@ -94,7 +94,7 @@ function geraXmlSistemas($perfil,$locaplic,$editores)
94 $xml .= " <PERFIL>".$row["perfil_sistema"]."</PERFIL>\n"; 94 $xml .= " <PERFIL>".$row["perfil_sistema"]."</PERFIL>\n";
95 $xml .= " <PUBLICADO>".$row["publicado_sistema"]."</PUBLICADO>\n"; 95 $xml .= " <PUBLICADO>".$row["publicado_sistema"]."</PUBLICADO>\n";
96 $xml .= " <NOMESIS>".xmlTexto_prepara($row["nome_sistema"])."</NOMESIS>\n"; 96 $xml .= " <NOMESIS>".xmlTexto_prepara($row["nome_sistema"])."</NOMESIS>\n";
97 - geraXmlSistemas_pegafuncoes($perfil,&$xml,$row["id_sistema"],$dbh); 97 + geraXmlSistemas_pegafuncoes($perfil,$xml,$row["id_sistema"],$dbh);
98 $xml .= "</SISTEMA>\n"; 98 $xml .= "</SISTEMA>\n";
99 } 99 }
100 } 100 }
classesphp/classe_analise.php
@@ -1023,7 +1023,7 @@ $locaplic - Localização do I3geo. @@ -1023,7 +1023,7 @@ $locaplic - Localização do I3geo.
1023 $nomeshp = $this->diretorio."/".$nomefinal; 1023 $nomeshp = $this->diretorio."/".$nomefinal;
1024 //pega os shapes selecionados 1024 //pega os shapes selecionados
1025 $itemspt = pegaItens($layerPt); 1025 $itemspt = pegaItens($layerPt);
1026 - $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); 1026 + $existesel = carregaquery2($this->arquivo,$this->layer,$this->mapa);
1027 if ($existesel == "nao") 1027 if ($existesel == "nao")
1028 {$layerPt->queryByrect($this->mapa->extent);} 1028 {$layerPt->queryByrect($this->mapa->extent);}
1029 $res_count = $layerPt->getNumresults(); 1029 $res_count = $layerPt->getNumresults();
@@ -1194,7 +1194,7 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig @@ -1194,7 +1194,7 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig
1194 //define o nome do novo shapefile que será criado 1194 //define o nome do novo shapefile que será criado
1195 $nomefinal = nomeRandomico(); 1195 $nomefinal = nomeRandomico();
1196 $nomeshp = $this->diretorio."/".$nomefinal; 1196 $nomeshp = $this->diretorio."/".$nomefinal;
1197 - $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); 1197 + $existesel = carregaquery2($this->arquivo,$this->layer,$this->mapa);
1198 if ($existesel == "nao") 1198 if ($existesel == "nao")
1199 {return "errox";} 1199 {return "errox";}
1200 $layerorigem = $this->mapa->getlayerbyname($temaorigem); 1200 $layerorigem = $this->mapa->getlayerbyname($temaorigem);
@@ -1345,7 +1345,7 @@ nome do layer criado com o buffer. @@ -1345,7 +1345,7 @@ nome do layer criado com o buffer.
1345 $listaShapes = array(); 1345 $listaShapes = array();
1346 if($this->nome != ""){ 1346 if($this->nome != ""){
1347 //pega os shapes selecionados 1347 //pega os shapes selecionados
1348 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 1348 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
1349 $sopen = $this->layer->open(); 1349 $sopen = $this->layer->open();
1350 if($sopen == MS_FAILURE){return "erro";} 1350 if($sopen == MS_FAILURE){return "erro";}
1351 $items = pegaItens($this->layer); 1351 $items = pegaItens($this->layer);
@@ -1474,7 +1474,7 @@ $item {string} - (opcional) Item q será utilizado para ponderar os valores. @@ -1474,7 +1474,7 @@ $item {string} - (opcional) Item q será utilizado para ponderar os valores.
1474 $nomeCentro = nomeRandomico(); 1474 $nomeCentro = nomeRandomico();
1475 $nomeshp = $this->diretorio."/".$nomeCentro; 1475 $nomeshp = $this->diretorio."/".$nomeCentro;
1476 //pega os shapes selecionados 1476 //pega os shapes selecionados
1477 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 1477 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
1478 if($this->layer->getNumresults() == 0) 1478 if($this->layer->getNumresults() == 0)
1479 {$this->layer->querybyrect($this->mapa->extent);} 1479 {$this->layer->querybyrect($this->mapa->extent);}
1480 $sopen = $this->layer->open(); 1480 $sopen = $this->layer->open();
@@ -1571,7 +1571,7 @@ $locaplic - Localização do I3geo. @@ -1571,7 +1571,7 @@ $locaplic - Localização do I3geo.
1571 $nomeCentroides = nomeRandomico(); 1571 $nomeCentroides = nomeRandomico();
1572 $nomeshp = $this->diretorio."/".$nomeCentroides; 1572 $nomeshp = $this->diretorio."/".$nomeCentroides;
1573 //pega os shapes selecionados 1573 //pega os shapes selecionados
1574 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 1574 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
1575 $sopen = $this->layer->open(); 1575 $sopen = $this->layer->open();
1576 if($sopen == MS_FAILURE){return "erro";} 1576 if($sopen == MS_FAILURE){return "erro";}
1577 $items = pegaItens($this->layer); 1577 $items = pegaItens($this->layer);
@@ -2211,7 +2211,7 @@ Salva o mapa acrescentando um novo layer com o resultado. @@ -2211,7 +2211,7 @@ Salva o mapa acrescentando um novo layer com o resultado.
2211 include_once "../pacotes/phpxbase/api_conversion.php"; 2211 include_once "../pacotes/phpxbase/api_conversion.php";
2212 } 2212 }
2213 //define o nome do novo shapefile que será criado 2213 //define o nome do novo shapefile que será criado
2214 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 2214 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
2215 $sopen = $this->layer->open(); 2215 $sopen = $this->layer->open();
2216 if($sopen == MS_FAILURE){return "erro";} 2216 if($sopen == MS_FAILURE){return "erro";}
2217 $res_count = $this->layer->getNumresults(); 2217 $res_count = $this->layer->getNumresults();
@@ -2350,7 +2350,7 @@ $locaplic - Localização do I3geo @@ -2350,7 +2350,7 @@ $locaplic - Localização do I3geo
2350 include_once "../pacotes/phpxbase/api_conversion.php"; 2350 include_once "../pacotes/phpxbase/api_conversion.php";
2351 } 2351 }
2352 //define o nome do novo shapefile que será criado 2352 //define o nome do novo shapefile que será criado
2353 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 2353 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
2354 $sopen = $this->layer->open(); 2354 $sopen = $this->layer->open();
2355 if($sopen == MS_FAILURE){return "erro";} 2355 if($sopen == MS_FAILURE){return "erro";}
2356 $res_count = $this->layer->getNumresults(); 2356 $res_count = $this->layer->getNumresults();
@@ -2524,7 +2524,7 @@ $operacao - Tipo de análise. @@ -2524,7 +2524,7 @@ $operacao - Tipo de análise.
2524 $calculo = array(); 2524 $calculo = array();
2525 foreach ($lista as $l) 2525 foreach ($lista as $l)
2526 { 2526 {
2527 - $geos = &$this->unserializeGeo($dir.$l); 2527 + $geos = $this->unserializeGeo($dir.$l);
2528 foreach ($geos["dados"] as $geo) 2528 foreach ($geos["dados"] as $geo)
2529 { 2529 {
2530 $geometrias[] = $geo["wkt"]; 2530 $geometrias[] = $geo["wkt"];
@@ -2594,7 +2594,7 @@ $operacao - Tipo de análise. @@ -2594,7 +2594,7 @@ $operacao - Tipo de análise.
2594 $dir = $dir_tmp."/".$imgdir."/"; 2594 $dir = $dir_tmp."/".$imgdir."/";
2595 foreach ($lista as $l) 2595 foreach ($lista as $l)
2596 { 2596 {
2597 - $geos = &$this->unserializeGeo($dir.$l); 2597 + $geos = $this->unserializeGeo($dir.$l);
2598 // 2598 //
2599 //verifica a versão do mapserver 2599 //verifica a versão do mapserver
2600 //se for anterior a 5, utiliza a conexão com o postgis para fazer o processamento dos daods 2600 //se for anterior a 5, utiliza a conexão com o postgis para fazer o processamento dos daods
@@ -2661,7 +2661,7 @@ $tipoLista - tipo de valores que são passados em $lista stringArquivos|arraywkt. @@ -2661,7 +2661,7 @@ $tipoLista - tipo de valores que são passados em $lista stringArquivos|arraywkt.
2661 $valoresoriginais = array(); 2661 $valoresoriginais = array();
2662 foreach ($lista as $l) 2662 foreach ($lista as $l)
2663 { 2663 {
2664 - $geos = &$this->unserializeGeo($dir.$l); 2664 + $geos = $this->unserializeGeo($dir.$l);
2665 //pega todas as geometrias 2665 //pega todas as geometrias
2666 foreach ($geos["dados"] as $geo) 2666 foreach ($geos["dados"] as $geo)
2667 { 2667 {
@@ -2774,7 +2774,7 @@ function gravaCoordenadasPt($tema,$limitepontos=&quot;TRUE&quot;,$extendelimite) @@ -2774,7 +2774,7 @@ function gravaCoordenadasPt($tema,$limitepontos=&quot;TRUE&quot;,$extendelimite)
2774 $nomefinal = nomeRandomico(); 2774 $nomefinal = nomeRandomico();
2775 $nomearq = $this->diretorio."/".$nomefinal; 2775 $nomearq = $this->diretorio."/".$nomefinal;
2776 $itemspt = pegaItens($layerPt); 2776 $itemspt = pegaItens($layerPt);
2777 - $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); 2777 + $existesel = carregaquery2($this->arquivo,$this->layer,$this->mapa);
2778 if ($existesel == "nao") 2778 if ($existesel == "nao")
2779 { 2779 {
2780 //if($layerPt->getProjection() == "" ) 2780 //if($layerPt->getProjection() == "" )
classesphp/classe_atributos.php
@@ -269,7 +269,7 @@ $tipo - Tipo de busca brasil|null @@ -269,7 +269,7 @@ $tipo - Tipo de busca brasil|null
269 $this->layer->setfilter(""); 269 $this->layer->setfilter("");
270 //le o arquivo de query se existir e checa se existe seleção para o tema 270 //le o arquivo de query se existir e checa se existe seleção para o tema
271 $items = pegaItens($this->layer); 271 $items = pegaItens($this->layer);
272 - $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); 272 + $existesel = carregaquery2($this->arquivo,$this->layer,$this->mapa);
273 if ($existesel == "nao") 273 if ($existesel == "nao")
274 {$this->layer->querybyrect($this->mapa->extent);} 274 {$this->layer->querybyrect($this->mapa->extent);}
275 $sopen = $this->layer->open(); 275 $sopen = $this->layer->open();
@@ -338,7 +338,7 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona @@ -338,7 +338,7 @@ $tipolista - Indica se serão mostrados todos os registros ou apenas os seleciona
338 else 338 else
339 {$items[] = $itemtema;} 339 {$items[] = $itemtema;}
340 $resultadoFinal[] = array("itens"=>$items); 340 $resultadoFinal[] = array("itens"=>$items);
341 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 341 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
342 $indxlayer = $this->layer->index; 342 $indxlayer = $this->layer->index;
343 $sopen = $this->layer->open(); 343 $sopen = $this->layer->open();
344 if($sopen == MS_FAILURE){return "erro";} 344 if($sopen == MS_FAILURE){return "erro";}
@@ -551,7 +551,7 @@ Include: @@ -551,7 +551,7 @@ Include:
551 $filtro = $this->layer->getfilterstring(); 551 $filtro = $this->layer->getfilterstring();
552 if ($filtro != ""){$this->layer->setfilter("");} 552 if ($filtro != ""){$this->layer->setfilter("");}
553 //le o arquivo de query se existir e checa se existe sele&ccedil;&atilde;o para o tema 553 //le o arquivo de query se existir e checa se existe sele&ccedil;&atilde;o para o tema
554 - $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); 554 + $existesel = carregaquery2($this->arquivo,$this->layer,$this->mapa);
555 if ($existesel == "nao") 555 if ($existesel == "nao")
556 {$this->layer->queryByrect($this->mapa->extent);} 556 {$this->layer->queryByrect($this->mapa->extent);}
557 $sopen = $this->layer->open(); 557 $sopen = $this->layer->open();
classesphp/classe_mapa.php
@@ -367,7 +367,7 @@ Include: @@ -367,7 +367,7 @@ Include:
367 foreach($this->layers as $l) 367 foreach($this->layers as $l)
368 { 368 {
369 $l->set("template","none.htm"); 369 $l->set("template","none.htm");
370 - carregaquery($this->arquivo,&$l,&$this->mapa); 370 + carregaquery2($this->arquivo,$l,$this->mapa);
371 } 371 }
372 } 372 }
373 $legenda = $this->mapa->legend; 373 $legenda = $this->mapa->legend;
@@ -971,7 +971,7 @@ $random - indica se os nomes dos novos layers serão modificados ou nao @@ -971,7 +971,7 @@ $random - indica se os nomes dos novos layers serão modificados ou nao
971 { 971 {
972 $nlayer = $nmap->getlayerbyname($n); 972 $nlayer = $nmap->getlayerbyname($n);
973 if(function_exists("autoClasses")) 973 if(function_exists("autoClasses"))
974 - autoClasses(&$nlayer,$this->mapa); 974 + autoClasses($nlayer,$this->mapa);
975 // 975 //
976 //cria as classes com base em atributos 976 //cria as classes com base em atributos
977 // 977 //
classesphp/classe_shp.php
@@ -388,7 +388,7 @@ array - xy @@ -388,7 +388,7 @@ array - xy
388 if(!$this->layer){return "erro";} 388 if(!$this->layer){return "erro";}
389 $this->layer->set("template","none.htm"); 389 $this->layer->set("template","none.htm");
390 $this->layer->setfilter(""); 390 $this->layer->setfilter("");
391 - $existesel = carregaquery($this->arquivo,&$this->layer,&$this->mapa); 391 + $existesel = carregaquery2($this->arquivo,$this->layer,$this->mapa);
392 $sopen = $this->layer->open(); 392 $sopen = $this->layer->open();
393 if($sopen == MS_FAILURE){return "erro";} 393 if($sopen == MS_FAILURE){return "erro";}
394 $res_count = $this->layer->getNumresults(); 394 $res_count = $this->layer->getNumresults();
classesphp/classe_temas.php
@@ -780,7 +780,7 @@ $nome - nome que será dado a geometria @@ -780,7 +780,7 @@ $nome - nome que será dado a geometria
780 $ext = $this->mapa->extent; 780 $ext = $this->mapa->extent;
781 $sb = $this->mapa->scalebar; 781 $sb = $this->mapa->scalebar;
782 $sb->set("status",MS_OFF); 782 $sb->set("status",MS_OFF);
783 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 783 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
784 $items = pegaItens($this->layer); 784 $items = pegaItens($this->layer);
785 $sopen = $this->layer->open(); 785 $sopen = $this->layer->open();
786 if($sopen == MS_FAILURE){return "erro";} 786 if($sopen == MS_FAILURE){return "erro";}
@@ -1012,7 +1012,7 @@ Calcula a extensão geográfica dos elementos selecionados de um tema e ajusta o m @@ -1012,7 +1012,7 @@ Calcula a extensão geográfica dos elementos selecionados de um tema e ajusta o m
1012 $extatual = $this->mapa->extent; 1012 $extatual = $this->mapa->extent;
1013 $prjMapa = $this->mapa->getProjection(); 1013 $prjMapa = $this->mapa->getProjection();
1014 $prjTema = $this->layer->getProjection(); 1014 $prjTema = $this->layer->getProjection();
1015 - carregaquery($this->arquivo,&$this->layer,&$this->mapa); 1015 + carregaquery2($this->arquivo,$this->layer,$this->mapa);
1016 $sopen = $this->layer->open(); 1016 $sopen = $this->layer->open();
1017 if($sopen == MS_FAILURE){return "erro";} 1017 if($sopen == MS_FAILURE){return "erro";}
1018 $res_count = $this->layer->getNumresults(); 1018 $res_count = $this->layer->getNumresults();
classesphp/funcoes_gerais.php
@@ -1894,7 +1894,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE) @@ -1894,7 +1894,7 @@ function criaSHP($tema,$map_file,$locaplic,$dir_tmp,$nomeRand=TRUE)
1894 $reg = array(); 1894 $reg = array();
1895 $novoshpf = ms_newShapefileObj($nomeshp.".shp", -2); 1895 $novoshpf = ms_newShapefileObj($nomeshp.".shp", -2);
1896 //le o arquivo de query se existir e checa se existe sele&ccedil;&atilde;o para o tema 1896 //le o arquivo de query se existir e checa se existe sele&ccedil;&atilde;o para o tema
1897 - $existesel = carregaquery($map_file,&$layer,&$map); 1897 + $existesel = carregaquery2($map_file,$layer,$map);
1898 if ($existesel == "nao") 1898 if ($existesel == "nao")
1899 {@$layer->queryByrect($map->extent);} 1899 {@$layer->queryByrect($map->extent);}
1900 //pega cada registro 1900 //pega cada registro
@@ -2735,7 +2735,11 @@ function removeLinha($texto,$mapfile) @@ -2735,7 +2735,11 @@ function removeLinha($texto,$mapfile)
2735 foreach($novoarray as $linha) 2735 foreach($novoarray as $linha)
2736 {$escreve = fwrite ($abre,$linha);} 2736 {$escreve = fwrite ($abre,$linha);}
2737 $fecha = fclose ($abre); 2737 $fecha = fclose ($abre);
2738 -} 2738 +}
  2739 +//
  2740 +//depreciado para incluir &$ para compatibilizar com PHP 5.x
  2741 +//utilize carregaquery2
  2742 +//
2739 function carregaquery($mapfile,$objlayer,$objmapa) 2743 function carregaquery($mapfile,$objlayer,$objmapa)
2740 { 2744 {
2741 $qyfile = dirname($mapfile)."/".$objlayer->name.".php"; 2745 $qyfile = dirname($mapfile)."/".$objlayer->name.".php";
@@ -2752,6 +2756,22 @@ function carregaquery($mapfile,$objlayer,$objmapa) @@ -2752,6 +2756,22 @@ function carregaquery($mapfile,$objlayer,$objmapa)
2752 } 2756 }
2753 return "nao"; 2757 return "nao";
2754 } 2758 }
  2759 +function carregaquery2($mapfile,&$objlayer,&$objmapa)
  2760 +{
  2761 + $qyfile = dirname($mapfile)."/".$objlayer->name.".php";
  2762 + if(file_exists($qyfile))
  2763 + {
  2764 + $indxlayer = $objlayer->index;
  2765 + $handle = fopen ($qyfile, "r");
  2766 + $conteudo = fread ($handle, filesize ($qyfile));
  2767 + fclose ($handle);
  2768 + $shp = unserialize($conteudo);
  2769 + foreach ($shp as $indx)
  2770 + {$objmapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);}
  2771 + return "sim";
  2772 + }
  2773 + return "nao";
  2774 +}
2755 /* 2775 /*
2756 Function: verificaEditores 2776 Function: verificaEditores
2757 2777
classesphp/graficos.php
@@ -387,7 +387,7 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t @@ -387,7 +387,7 @@ function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$t
387 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); 387 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3])));
388 } 388 }
389 $layer = $map->getLayerByName($tema); 389 $layer = $map->getLayerByName($tema);
390 - $selecionados = carregaquery($map_file,&$layer,&$map); 390 + $selecionados = carregaquery2($map_file,$layer,$map);
391 if ($exclui == ""){$exclui = "nulo";} 391 if ($exclui == ""){$exclui = "nulo";}
392 $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados); 392 $valores = pegaValoresM($map,$layer,array($itemclasses,$itemvalores),$exclui,$selecionados);
393 $dados = agrupaValores($valores,0,1,$tipo); 393 $dados = agrupaValores($valores,0,1,$tipo);
@@ -433,7 +433,7 @@ function dadosLinhaDoTempo($map_file,$tema,$ext=&quot;&quot;) @@ -433,7 +433,7 @@ function dadosLinhaDoTempo($map_file,$tema,$ext=&quot;&quot;)
433 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); 433 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3])));
434 } 434 }
435 $layer = $map->getLayerByName($tema); 435 $layer = $map->getLayerByName($tema);
436 - $selecionados = carregaquery($map_file,&$layer,&$map); 436 + $selecionados = carregaquery2($map_file,$layer,$map);
437 if ($exclui == ""){$exclui = "nulo";} 437 if ($exclui == ""){$exclui = "nulo";}
438 //define os itens para pegar os dados 438 //define os itens para pegar os dados
439 $itens = array(); 439 $itens = array();
classesphp/mapa_googleearth.php
@@ -140,8 +140,9 @@ function retornaWms($map_fileX,$postgis_mapa){ @@ -140,8 +140,9 @@ function retornaWms($map_fileX,$postgis_mapa){
140 $l = $mapa->getLayerByname($layerName); 140 $l = $mapa->getLayerByname($layerName);
141 if ($l->getmetadata("classesnome") != "") 141 if ($l->getmetadata("classesnome") != "")
142 { 142 {
143 - include_once("funcoes_gerais.php");  
144 - autoClasses(&$l,$mapa); 143 + if(!function_exists("autoClasses"))
  144 + {include_once("funcoes_gerais.php");}
  145 + autoClasses($l,$mapa);
145 } 146 }
146 if($layerName != $_GET["layer"]) 147 if($layerName != $_GET["layer"])
147 {$l->set("status",MS_OFF);} 148 {$l->set("status",MS_OFF);}
classesphp/mapa_googlemaps.php
@@ -150,8 +150,9 @@ if(!isset($_GET[&quot;telaR&quot;])){//no caso de projecoes remotas, o mapfile nao´e alter @@ -150,8 +150,9 @@ if(!isset($_GET[&quot;telaR&quot;])){//no caso de projecoes remotas, o mapfile nao´e alter
150 $l = $mapa->getLayerByname($layerName); 150 $l = $mapa->getLayerByname($layerName);
151 if ($l->getmetadata("classesnome") != "") 151 if ($l->getmetadata("classesnome") != "")
152 { 152 {
153 - include_once("funcoes_gerais.php");  
154 - autoClasses(&$l,$mapa); 153 + if(!function_exists("autoClasses"))
  154 + {include_once("funcoes_gerais.php");}
  155 + autoClasses($l,$mapa);
155 } 156 }
156 if($layerName != $_GET["layer"]) 157 if($layerName != $_GET["layer"])
157 {$l->set("status",MS_OFF);} 158 {$l->set("status",MS_OFF);}
@@ -251,9 +252,9 @@ if (!function_exists(&#39;imagepng&#39;)) @@ -251,9 +252,9 @@ if (!function_exists(&#39;imagepng&#39;))
251 } 252 }
252 if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") 253 if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum")
253 { 254 {
254 - $nomer = ($img->imagepath)."filtroimgtemp".nomeRandomico().".png"; 255 + $nomer = ($img->imagepath)."filtroimgtemp".nomeRand().".png";
255 $img->saveImage($nomer); 256 $img->saveImage($nomer);
256 - filtraImagem($nomer,trim($_GET["TIPOIMAGEM"])); 257 + filtraImg($nomer,trim($_GET["TIPOIMAGEM"]));
257 $img = imagecreatefrompng($nomer); 258 $img = imagecreatefrompng($nomer);
258 imagealphablending($img, false); 259 imagealphablending($img, false);
259 imagesavealpha($img, true); 260 imagesavealpha($img, true);
@@ -265,7 +266,7 @@ else{ @@ -265,7 +266,7 @@ else{
265 if($cache == true) 266 if($cache == true)
266 {$nomer = salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} 267 {$nomer = salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);}
267 else{ 268 else{
268 - $nomer = ($img->imagepath)."imgtemp".nomeRandomico().".png"; 269 + $nomer = ($img->imagepath)."imgtemp".nomeRand().".png";
269 $img->saveImage($nomer); 270 $img->saveImage($nomer);
270 } 271 }
271 ob_clean(); 272 ob_clean();
@@ -332,7 +333,7 @@ function carregaCacheImagem($bbox,$layer,$map,$w,$h){ @@ -332,7 +333,7 @@ function carregaCacheImagem($bbox,$layer,$map,$w,$h){
332 exit; 333 exit;
333 } 334 }
334 } 335 }
335 -function nomeRandomico($n=10) 336 +function nomeRand($n=10)
336 { 337 {
337 $nomes = ""; 338 $nomes = "";
338 $a = 'azertyuiopqsdfghjklmwxcvbnABCDEFGHIJKLMNOPQRSTUVWXYZ'; 339 $a = 'azertyuiopqsdfghjklmwxcvbnABCDEFGHIJKLMNOPQRSTUVWXYZ';
@@ -341,7 +342,7 @@ function nomeRandomico($n=10) @@ -341,7 +342,7 @@ function nomeRandomico($n=10)
341 {$nomes .= $a{mt_rand(0, $max)};} 342 {$nomes .= $a{mt_rand(0, $max)};}
342 return $nomes; 343 return $nomes;
343 } 344 }
344 -function filtraImagem($nomer,$tipoimagem){ 345 +function filtraImg($nomer,$tipoimagem){
345 include_once("classe_imagem.php"); 346 include_once("classe_imagem.php");
346 $tiposImagem = explode(" ",$tipoimagem); 347 $tiposImagem = explode(" ",$tipoimagem);
347 foreach ($tiposImagem as $tipoimagem){ 348 foreach ($tiposImagem as $tipoimagem){
classesphp/mapa_openlayers.php
@@ -123,8 +123,9 @@ if(!isset($_GET[&quot;telaR&quot;])){//no caso de projecoes remotas, o mapfile nao e alter @@ -123,8 +123,9 @@ if(!isset($_GET[&quot;telaR&quot;])){//no caso de projecoes remotas, o mapfile nao e alter
123 $layerName = $l->name; 123 $layerName = $l->name;
124 if ($l->getmetadata("classesnome") != "") 124 if ($l->getmetadata("classesnome") != "")
125 { 125 {
126 - include_once("funcoes_gerais.php");  
127 - autoClasses(&$l,$mapa); 126 + if(!function_exists("autoClasses"))
  127 + {include_once("funcoes_gerais.php");}
  128 + autoClasses($l,$mapa);
128 } 129 }
129 if($layerName != $_GET["layer"]) 130 if($layerName != $_GET["layer"])
130 {$l->set("status",MS_OFF);} 131 {$l->set("status",MS_OFF);}
@@ -242,9 +243,9 @@ if (!function_exists(&#39;imagepng&#39;)) @@ -242,9 +243,9 @@ if (!function_exists(&#39;imagepng&#39;))
242 } 243 }
243 if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") 244 if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum")
244 { 245 {
245 - $nomer = ($img->imagepath)."filtroimgtemp".nomeRandomico().".png"; 246 + $nomer = ($img->imagepath)."filtroimgtemp".nomeRand().".png";
246 $img->saveImage($nomer); 247 $img->saveImage($nomer);
247 - filtraImagem($nomer,$_GET["TIPOIMAGEM"]); 248 + filtraImg($nomer,$_GET["TIPOIMAGEM"]);
248 $img = imagecreatefrompng($nomer); 249 $img = imagecreatefrompng($nomer);
249 imagealphablending($img, false); 250 imagealphablending($img, false);
250 imagesavealpha($img, true); 251 imagesavealpha($img, true);
@@ -257,7 +258,7 @@ else{ @@ -257,7 +258,7 @@ else{
257 if($cache == true) 258 if($cache == true)
258 {$nomer = salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);} 259 {$nomer = salvaCacheImagem($_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]);}
259 else{ 260 else{
260 - $nomer = ($img->imagepath)."imgtemp".nomeRandomico().".png"; 261 + $nomer = ($img->imagepath)."imgtemp".nomeRand().".png";
261 $img->saveImage($nomer); 262 $img->saveImage($nomer);
262 } 263 }
263 ob_clean(); 264 ob_clean();
@@ -332,7 +333,7 @@ function carregaCacheImagem($bbox,$layer,$map,$w,$h){ @@ -332,7 +333,7 @@ function carregaCacheImagem($bbox,$layer,$map,$w,$h){
332 exit; 333 exit;
333 } 334 }
334 } 335 }
335 -function nomeRandomico($n=10) 336 +function nomeRand($n=10)
336 { 337 {
337 $nomes = ""; 338 $nomes = "";
338 $a = 'azertyuiopqsdfghjklmwxcvbnABCDEFGHIJKLMNOPQRSTUVWXYZ'; 339 $a = 'azertyuiopqsdfghjklmwxcvbnABCDEFGHIJKLMNOPQRSTUVWXYZ';
@@ -341,7 +342,7 @@ function nomeRandomico($n=10) @@ -341,7 +342,7 @@ function nomeRandomico($n=10)
341 {$nomes .= $a{mt_rand(0, $max)};} 342 {$nomes .= $a{mt_rand(0, $max)};}
342 return $nomes; 343 return $nomes;
343 } 344 }
344 -function filtraImagem($nomer,$tipoimagem){ 345 +function filtraImg($nomer,$tipoimagem){
345 include_once("classe_imagem.php"); 346 include_once("classe_imagem.php");
346 $tiposImagem = explode(" ",$tipoimagem); 347 $tiposImagem = explode(" ",$tipoimagem);
347 foreach ($tiposImagem as $tipoimagem){ 348 foreach ($tiposImagem as $tipoimagem){
classesphp/parse_cgi.php
@@ -85,7 +85,7 @@ foreach ($layersNames as $layerName) @@ -85,7 +85,7 @@ foreach ($layersNames as $layerName)
85 { 85 {
86 $layer = $map->getLayerByname($layerName); 86 $layer = $map->getLayerByname($layerName);
87 if ($layer->getmetadata("classesnome") != "") 87 if ($layer->getmetadata("classesnome") != "")
88 - {autoClasses(&$layer,$map);} 88 + {autoClasses($layer,$map);}
89 if($layer->type == MS_LAYER_POLYGON) 89 if($layer->type == MS_LAYER_POLYGON)
90 { 90 {
91 $nclasses = $layer->numclasses; 91 $nclasses = $layer->numclasses;
ferramentas/tabela/relatorio.php
@@ -12,7 +12,7 @@ $postgis_mapa = $_SESSION[&quot;postgis_mapa&quot;]; @@ -12,7 +12,7 @@ $postgis_mapa = $_SESSION[&quot;postgis_mapa&quot;];
12 include("../../classesphp/carrega_ext.php"); 12 include("../../classesphp/carrega_ext.php");
13 include("../../classesphp/funcoes_gerais.php"); 13 include("../../classesphp/funcoes_gerais.php");
14 $versao = versao(); 14 $versao = versao();
15 -$versao = versao["principal"]; 15 +$versao = $versao["principal"];
16 substituiCon($map_file,$postgis_mapa); 16 substituiCon($map_file,$postgis_mapa);
17 $temp = explode(",",$nomesrel); 17 $temp = explode(",",$nomesrel);
18 $colunas = array(); 18 $colunas = array();
@@ -32,14 +32,12 @@ foreach($temp as $t) @@ -32,14 +32,12 @@ foreach($temp as $t)
32 } 32 }
33 if($itemagruparel != "" && !in_array($itemagruparel,$itensrel)) 33 if($itemagruparel != "" && !in_array($itemagruparel,$itensrel))
34 {$itensrel[] = $itemagruparel;} 34 {$itensrel[] = $itemagruparel;}
35 -  
36 $mapa = ms_newMapObj($map_file); 35 $mapa = ms_newMapObj($map_file);
37 if($ext && $ext != ""){ 36 if($ext && $ext != ""){
38 $e = explode(" ",$ext); 37 $e = explode(" ",$ext);
39 $extatual = $mapa->extent; 38 $extatual = $mapa->extent;
40 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); 39 $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3])));
41 } 40 }
42 -  
43 $layer = $mapa->getlayerbyname($temarel); 41 $layer = $mapa->getlayerbyname($temarel);
44 $layer->set("template","none.html"); 42 $layer->set("template","none.html");
45 $existesel = "nao"; 43 $existesel = "nao";
@@ -47,7 +45,7 @@ $existesel = &quot;nao&quot;; @@ -47,7 +45,7 @@ $existesel = &quot;nao&quot;;
47 if (file_exists($map_file."qy")) 45 if (file_exists($map_file."qy"))
48 {$mapa->loadquery($map_file."qy");} 46 {$mapa->loadquery($map_file."qy");}
49 */ 47 */
50 -carregaquery($map_file,&$layer,&$mapa); 48 +carregaquery2($map_file,$layer,$mapa);
51 if ($layer->getNumresults() > 0){$existesel = "sim";} 49 if ($layer->getNumresults() > 0){$existesel = "sim";}
52 if ($existesel == "nao") 50 if ($existesel == "nao")
53 {$layer->querybyrect($mapa->extent);} 51 {$layer->querybyrect($mapa->extent);}
geraminiatura.php
@@ -132,7 +132,7 @@ function verificaMiniatura($map,$tipo,$admin=false) @@ -132,7 +132,7 @@ function verificaMiniatura($map,$tipo,$admin=false)
132 $layern = $nmapa->getLayerByName($teman); 132 $layern = $nmapa->getLayerByName($teman);
133 $layern->set("status",MS_DEFAULT); 133 $layern->set("status",MS_DEFAULT);
134 ms_newLayerObj($mapa, $layern); 134 ms_newLayerObj($mapa, $layern);
135 - autoClasses(&$layern,$mapa,$locaplic); 135 + autoClasses($layern,$mapa,$locaplic);
136 if ($layern->data == "") 136 if ($layern->data == "")
137 $dados = $layern->connection; 137 $dados = $layern->connection;
138 else 138 else
@@ -157,7 +157,7 @@ function verificaMiniatura($map,$tipo,$admin=false) @@ -157,7 +157,7 @@ function verificaMiniatura($map,$tipo,$admin=false)
157 } 157 }
158 } 158 }
159 } 159 }
160 - zoomTemaMiniatura($pegarext,&$mapa); 160 + zoomTemaMiniatura($pegarext,$mapa);
161 if ($tipo == "mini" || $tipo == "todos") 161 if ($tipo == "mini" || $tipo == "todos")
162 { 162 {
163 $mapa->setsize(50,50); 163 $mapa->setsize(50,50);
ms_criamapa.php
@@ -612,7 +612,7 @@ function incluiTemasIniciais() @@ -612,7 +612,7 @@ function incluiTemasIniciais()
612 if ($layern->name == "estadosl") 612 if ($layern->name == "estadosl")
613 {$layern->set("data",$locaplic."/aplicmap/dados/estados.shp");} 613 {$layern->set("data",$locaplic."/aplicmap/dados/estados.shp");}
614 $layern->setmetadata("NOMEORIGINAL",$layern->name); 614 $layern->setmetadata("NOMEORIGINAL",$layern->name);
615 - autoClasses(&$layern,$mapn); 615 + autoClasses($layern,$mapn);
616 // 616 //
617 //necessário para não alterar a extensão do mapa por esse parâmetro 617 //necessário para não alterar a extensão do mapa por esse parâmetro
618 // 618 //
@@ -634,7 +634,7 @@ function incluiTemasIniciais() @@ -634,7 +634,7 @@ function incluiTemasIniciais()
634 $layern->set("type",$tipotemp); 634 $layern->set("type",$tipotemp);
635 $layern->set("status",statustemp); 635 $layern->set("status",statustemp);
636 } 636 }
637 - ms_newLayerObj(&$mapn, $layern); 637 + ms_newLayerObj($mapn, $layern);
638 } 638 }
639 } 639 }
640 } 640 }
@@ -644,7 +644,7 @@ function incluiTemasIniciais() @@ -644,7 +644,7 @@ function incluiTemasIniciais()
644 // 644 //
645 if($existeraster) 645 if($existeraster)
646 { 646 {
647 - $of = &$mapn->outputformat; 647 + $of = $mapn->outputformat;
648 $of->set("imagemode",MS_IMAGEMODE_RGB); 648 $of->set("imagemode",MS_IMAGEMODE_RGB);
649 } 649 }
650 erroCriacao(); 650 erroCriacao();
@@ -1059,7 +1059,7 @@ function incluiMapaGvsig($gvsiggvp,$gvsigview){ @@ -1059,7 +1059,7 @@ function incluiMapaGvsig($gvsiggvp,$gvsigview){
1059 include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); 1059 include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php");
1060 $gm = new gvsig2mapfile($gvsiggvp); 1060 $gm = new gvsig2mapfile($gvsiggvp);
1061 $dataView = $gm->getViewData($gvsigview); 1061 $dataView = $gm->getViewData($gvsigview);
1062 - //var_dump($dataView); 1062 + //var_dump($dataView);exit;
1063 $lnames = $mapn->getalllayernames(); 1063 $lnames = $mapn->getalllayernames();
1064 foreach($lnames as $name){ 1064 foreach($lnames as $name){
1065 $layer = $mapn->getlayerbyname($name); 1065 $layer = $mapn->getlayerbyname($name);
@@ -231,7 +231,7 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;) @@ -231,7 +231,7 @@ if ($tipo == &quot;&quot; || $tipo == &quot;metadados&quot;)
231 } 231 }
232 } 232 }
233 } 233 }
234 - autoClasses(&$l,$oMap); 234 + autoClasses($l,$oMap);
235 $permite = $l->getmetadata("permiteogc"); 235 $permite = $l->getmetadata("permiteogc");
236 if($permite != "nao") 236 if($permite != "nao")
237 ms_newLayerObj($oMap, $l); 237 ms_newLayerObj($oMap, $l);
testamapfile.php
@@ -197,7 +197,7 @@ function verifica($map,$solegenda) @@ -197,7 +197,7 @@ function verifica($map,$solegenda)
197 } 197 }
198 } 198 }
199 199
200 - autoClasses(&$layern,$nmapa); 200 + autoClasses($layern,$nmapa);
201 if($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata("wms_sld_body") == ""){ 201 if($layern->classitem != "" && $layern->connectiontype == 7 && $layern->numclasses > 0 && $layern->getmetadata("wms_sld_body") == ""){
202 $tipotemp = $layern->type; 202 $tipotemp = $layern->type;
203 $tiporep = $layern->getmetadata("tipooriginal"); 203 $tiporep = $layern->getmetadata("tipooriginal");
@@ -219,7 +219,7 @@ function verifica($map,$solegenda) @@ -219,7 +219,7 @@ function verifica($map,$solegenda)
219 $dados = $layern->data; 219 $dados = $layern->data;
220 $pegarext = $teman; 220 $pegarext = $teman;
221 } 221 }
222 - zoomTema($pegarext,&$mapa); 222 + zoomTema($pegarext,$mapa);
223 if ($tipo == "mini") 223 if ($tipo == "mini")
224 { 224 {
225 $mapa->setsize(50,50); 225 $mapa->setsize(50,50);