Commit 005165d9eafadf6a3522e55da3fd06918993b3b9
1 parent
df14fa25
Exists in
master
and in
7 other branches
#69
Showing
11 changed files
with
298 additions
and
272 deletions
Show diff stats
admin/php/admin.php
... | ... | @@ -46,13 +46,13 @@ if(!isset($locaplic)) |
46 | 46 | } |
47 | 47 | } |
48 | 48 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
49 | - | |
50 | 49 | error_reporting(0); |
51 | 50 | // |
52 | 51 | //carrega o phpmapscript |
53 | 52 | // |
54 | 53 | include_once ($locaplic."/classesphp/carrega_ext.php"); |
55 | 54 | include_once ($locaplic."/classesphp/funcoes_gerais.php"); |
55 | + | |
56 | 56 | // |
57 | 57 | //verifica se o cliente pode editar |
58 | 58 | //se funcao for verificaEditores vai para case específico | ... | ... |
aplicmap/geral1.map
... | ... | @@ -275,7 +275,7 @@ MAP |
275 | 275 | "wms_format" "image/png" |
276 | 276 | "wms_formatlist" "image/gif,image/png,image/png; mode=24bit,image/jpeg,image/wbmp,image/tiff" |
277 | 277 | "wms_connectiontimeout" "30" |
278 | - "TEMA" "Base cartografica" | |
278 | + "TEMA" "Base cartográfica" | |
279 | 279 | "wms_server_version" "1.1.1" |
280 | 280 | "wms_style" "default" |
281 | 281 | "MENSAGEM" "As cartas RASTER são mostradas apenas em determinadas escalas. Aproxime o mapa até a escala 1:250.000 para que os dados sejam mostrados." | ... | ... |
aplicmap/geral1windows.map
... | ... | @@ -279,7 +279,7 @@ SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" |
279 | 279 | "wms_format" "image/png" |
280 | 280 | "wms_formatlist" "image/gif,image/png,image/png; mode=24bit,image/jpeg,image/wbmp,image/tiff" |
281 | 281 | "wms_connectiontimeout" "30" |
282 | - "TEMA" "Base cartografica" | |
282 | + "TEMA" "Base cartográfica" | |
283 | 283 | "wms_server_version" "1.1.1" |
284 | 284 | "wms_style" "default" |
285 | 285 | "MENSAGEM" "As cartas RASTER são mostradas apenas em determinadas escalas. Aproxime o mapa até a escala 1:250.000 para que os dados sejam mostrados." | ... | ... |
classesphp/atlas_controle.php
... | ... | @@ -80,25 +80,27 @@ if (!isset($atlasxml) || $atlasxml == "")// || !isset($editores)) |
80 | 80 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido |
81 | 81 | // |
82 | 82 | include_once("carrega_ext.php"); |
83 | -include_once("../pacotes/cpaint/cpaint2.inc.php"); | |
83 | +include_once("funcoes_gerais.php"); | |
84 | +//include_once("../pacotes/cpaint/cpaint2.inc.php"); | |
84 | 85 | |
85 | 86 | // |
86 | 87 | //cria objeto cpaint para uso com ajax |
87 | 88 | // |
88 | -$cp = new cpaint(); | |
89 | -$cp->set_data(""); | |
89 | +//$cp = new cpaint(); | |
90 | +//$cp->set_data(""); | |
90 | 91 | // |
91 | 92 | //verifica se o usuário está tentando utilizar um link que não funciona mais |
92 | 93 | // |
93 | 94 | if (!isset($map_file)) |
94 | 95 | { |
95 | 96 | //nesse caso é necessário criar o diretório temporário e iniciar o mapa |
96 | - $cp->set_data("linkquebrado"); | |
97 | - $cp->return_data(); | |
97 | + //$cp->set_data("linkquebrado"); | |
98 | + //$cp->return_data(); | |
99 | + cpjson(array("erro"=>"linkquebrado")); | |
98 | 100 | exit; |
99 | 101 | } |
100 | 102 | include_once("classe_vermultilayer.php"); |
101 | -include_once("funcoes_gerais.php"); | |
103 | + | |
102 | 104 | if ($map_file != "") |
103 | 105 | { |
104 | 106 | // |
... | ... | @@ -134,8 +136,7 @@ atlasxml {string} - nome do arquivo xml que contém a lista de atlas (veja em i3g |
134 | 136 | case "pegaListaDeAtlas": |
135 | 137 | include_once("classe_atlas.php"); |
136 | 138 | $atl = new Atlas($xml,$atlasxml); |
137 | - $resultado = $atl->pegaListaDeAtlas($tituloInstituicao); | |
138 | - $cp->set_data($resultado); | |
139 | + $retorno = $atl->pegaListaDeAtlas($tituloInstituicao); | |
139 | 140 | break; |
140 | 141 | /* |
141 | 142 | Opcao: criaAtlas |
... | ... | @@ -186,8 +187,7 @@ atlasId {string} - identificador do atlas |
186 | 187 | case "pegaListaDePranchas": |
187 | 188 | include_once("classe_atlas.php"); |
188 | 189 | $atl = new Atlas($xml,$atlasxml); |
189 | - $resultado = $atl->pegaListaDePranchas($atlasId); | |
190 | - $cp->set_data($resultado); | |
190 | + $retorno = $atl->pegaListaDePranchas($atlasId); | |
191 | 191 | break; |
192 | 192 | /* |
193 | 193 | Opcao: abrePrancha |
... | ... | @@ -205,10 +205,8 @@ pranchaId {string} - identificador da prancha |
205 | 205 | case "abrePrancha": |
206 | 206 | include_once("classe_atlas.php"); |
207 | 207 | $atl = new Atlas($xml,$atlasxml); |
208 | - $resultado = $atl->abrePrancha($atlasId,$pranchaId,$map_file,$locaplic); | |
209 | - $cp->set_data($resultado); | |
208 | + $retorno = $atl->abrePrancha($atlasId,$pranchaId,$map_file,$locaplic); | |
210 | 209 | break; |
211 | - | |
212 | 210 | } |
213 | 211 | |
214 | 212 | if (!connection_aborted()) |
... | ... | @@ -217,7 +215,7 @@ if (!connection_aborted()) |
217 | 215 | { |
218 | 216 | restauraCon($map_file,$postgis_mapa); |
219 | 217 | } |
220 | - $cp->return_data(); | |
218 | + cpjson($retorno); | |
221 | 219 | } |
222 | 220 | else |
223 | 221 | {exit();} | ... | ... |
classesphp/funcoes_gerais.php
... | ... | @@ -96,7 +96,7 @@ Include: |
96 | 96 | */ |
97 | 97 | function fusaoGrafico() |
98 | 98 | { |
99 | - global $imagem,$grafico,$dir_tmp,$cp,$map_file; | |
99 | + global $imagem,$grafico,$dir_tmp,$map_file; | |
100 | 100 | include_once("classe_imagem.php"); |
101 | 101 | if($map_file != "") |
102 | 102 | { |
... | ... | @@ -110,7 +110,7 @@ function fusaoGrafico() |
110 | 110 | $m = new Imagem(dirname($dir_tmp).$imagem); |
111 | 111 | $i = $m->fundeIm(dirname($dir_tmp).$grafico); |
112 | 112 | imagepng($i,dirname($dir_tmp).$imagem); |
113 | - $cp->set_data($imagem); | |
113 | + return ($imagem); | |
114 | 114 | } |
115 | 115 | /* |
116 | 116 | Section: R |
... | ... | @@ -601,7 +601,7 @@ $dir_tmp - Diretório temporário. |
601 | 601 | */ |
602 | 602 | function listaTrueType() |
603 | 603 | { |
604 | - global $cp,$locaplic,$imgdir,$dir_tmp; | |
604 | + global $locaplic,$imgdir,$dir_tmp; | |
605 | 605 | if (!file_exists($dir_tmp."/comum/truetype.inc")) |
606 | 606 | { |
607 | 607 | $arq = $locaplic."/symbols/fontes.txt"; |
... | ... | @@ -619,7 +619,7 @@ function listaTrueType() |
619 | 619 | } |
620 | 620 | else |
621 | 621 | {include ($dir_tmp."/comum/truetype.inc");} |
622 | - $cp->set_data($res); | |
622 | + return($res); | |
623 | 623 | } |
624 | 624 | /* |
625 | 625 | Section: mapa |
... | ... | @@ -724,7 +724,7 @@ Objeto cpaint com uma string contendo variáveis no formato javascript |
724 | 724 | */ |
725 | 725 | function retornaReferencia() |
726 | 726 | { |
727 | - global $cp,$nomeImagem,$objMapa,$utilizacgi,$locmapserv,$map_file; | |
727 | + global $nomeImagem,$objMapa,$utilizacgi,$locmapserv,$map_file; | |
728 | 728 | // |
729 | 729 | //pega a extensao original caso ela tenha sido registrada no modo dinamico |
730 | 730 | // |
... | ... | @@ -750,7 +750,7 @@ function retornaReferencia() |
750 | 750 | $s = "g_celularef = ".$d.";"; |
751 | 751 | $s .= "var extentref = '".$em->minx." ".$em->miny." ".$em->maxx." ".$em->maxy."';"; |
752 | 752 | $s .= "var refimagem='".$nomer."';var refwidth=".$objImagem->width.";var refheight=".$objImagem->height.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; |
753 | - $cp->set_data($s); | |
753 | + return($s); | |
754 | 754 | } |
755 | 755 | /* |
756 | 756 | function: retornaReferenciaDinamica |
... | ... | @@ -777,7 +777,7 @@ Objeto cpaint com uma string contendo variáveis no formato javascript |
777 | 777 | */ |
778 | 778 | function retornaReferenciaDinamica() |
779 | 779 | { |
780 | - global $cp,$nomeImagem,$map_file,$utilizacgi,$locmapserv,$locaplic,$zoom,$tipo; | |
780 | + global $nomeImagem,$map_file,$utilizacgi,$locmapserv,$locaplic,$zoom,$tipo; | |
781 | 781 | // |
782 | 782 | //adiciona o tema com o web service com o mapa mundi |
783 | 783 | // |
... | ... | @@ -844,7 +844,7 @@ function retornaReferenciaDinamica() |
844 | 844 | $r->set("maxx",$emt->maxx); |
845 | 845 | $r->set("maxy",$emt->maxy); |
846 | 846 | $mapa->save($map_file); |
847 | - $cp->set_data($s); | |
847 | + return($s); | |
848 | 848 | } |
849 | 849 | /* |
850 | 850 | function: testaMapa |
... | ... | @@ -2231,4 +2231,54 @@ function criaDirMapa($dir_tmp) |
2231 | 2231 | else |
2232 | 2232 | {return false;} |
2233 | 2233 | } |
2234 | +/* | |
2235 | +Function: array2json | |
2236 | + | |
2237 | +Converte um array em uma string no formato JSON. Utiliza as funções nativas do PHP para gerar o objeto. | |
2238 | + | |
2239 | +$cpaint - {boolean} se for true é acrescentado o elemento "data" como chave no array, mantendo a compatibilidade da resposta com o CPAINT | |
2240 | +*/ | |
2241 | +function array2json($a,$cpaint=true) | |
2242 | +{ | |
2243 | + if($cpaint == true) | |
2244 | + {$a = array("data"=>$a);} | |
2245 | + return json_encode($a); | |
2246 | +} | |
2247 | +/* | |
2248 | +Function: echojson | |
2249 | + | |
2250 | +Retorna para o navegador uma string (JSON) e para o processamento | |
2251 | + | |
2252 | +$a - string | |
2253 | +*/ | |
2254 | +function echojson($a) | |
2255 | +{ | |
2256 | + //ob_clean(); | |
2257 | + if(extension_loaded('zlib')) | |
2258 | + {ob_start('ob_gzhandler');} | |
2259 | + header("Content-type: text/html"); | |
2260 | + echo $a; | |
2261 | + if(extension_loaded('zlib')) | |
2262 | + {ob_end_flush();} | |
2263 | + exit; | |
2264 | +} | |
2265 | +/* | |
2266 | +Function: cpjson | |
2267 | + | |
2268 | +Converte um array em um objeto JSON e retorna para o navegador | |
2269 | + | |
2270 | +$obj - objeto que será convertido | |
2271 | +*/ | |
2272 | +function cpjson($obj){ | |
2273 | + if(function_exists("json_encode")) | |
2274 | + { | |
2275 | + echojson(array2json($obj)); | |
2276 | + } | |
2277 | + else | |
2278 | + { | |
2279 | + include_once("../pacotes/cpaint/cpaint2.inc.php"); | |
2280 | + $cp = new cpaint(); | |
2281 | + $cp->set_data($obj); | |
2282 | + } | |
2283 | +} | |
2234 | 2284 | ?> |
2235 | 2285 | \ No newline at end of file | ... | ... |
classesphp/graficos.php
... | ... | @@ -73,7 +73,7 @@ function graficoPizza() |
73 | 73 | */ |
74 | 74 | function graficoBarras() |
75 | 75 | { |
76 | - global $cp,$map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
76 | + global $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
77 | 77 | global $setasdv,$percentual,$nome,$margem,$margemexterna,$margeminterna,$grid,$border,$cexaxis,$las,$space,$lwd,$fontlab,$collab,$cexlab,$xlab,$ylab,$fontsub,$fontmain,$locaplic,$dir_tmp,$gw,$gh,$res,$bg,$fg,$colmain,$font,$main,$cexmain,$sub,$cexsub; |
78 | 78 | //pega os valores |
79 | 79 | $dir = dirname(dirname($map_file)); |
... | ... | @@ -116,14 +116,14 @@ function graficoBarras() |
116 | 116 | $map = ms_newMapObj($map_file); |
117 | 117 | $webo = $map->web; |
118 | 118 | $url = dirname($webo->imageurl)."/"; |
119 | - $cp->set_data($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
119 | + return($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
120 | 120 | } |
121 | 121 | /** |
122 | 122 | * Gera gráfico de histograma. |
123 | 123 | */ |
124 | 124 | function graficoHist() |
125 | 125 | { |
126 | - global $cp,$map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
126 | + global $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
127 | 127 | global $densidade,$percentual,$nome,$margem,$margemexterna,$margeminterna,$corbarras,$grid,$breaks,$border,$cexaxis,$las,$lwd,$fontlab,$collab,$cexlab,$xlab,$ylab,$fontsub,$fontmain,$locaplic,$dir_tmp,$gw,$gh,$res,$bg,$fg,$colmain,$font,$main,$cexmain,$sub,$cexsub; |
128 | 128 | $dir = dirname(dirname($map_file)); |
129 | 129 | if($nome == "") |
... | ... | @@ -165,14 +165,14 @@ function graficoHist() |
165 | 165 | $map = ms_newMapObj($map_file); |
166 | 166 | $webo = $map->web; |
167 | 167 | $url = dirname($webo->imageurl)."/"; |
168 | - $cp->set_data($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
168 | + return($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
169 | 169 | } |
170 | 170 | /** |
171 | 171 | * Gera gráfico de linhas. |
172 | 172 | */ |
173 | 173 | function graficoLinhas() |
174 | 174 | { |
175 | - global $cp,$map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
175 | + global $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
176 | 176 | global $percentual,$nome,$margem,$margemexterna,$margeminterna,$xlab,$ylab,$grid,$ppontos,$spline,$locaplic,$dir_tmp,$gw,$gh,$res,$bg,$collab,$colaxis,$cexlab,$cexaxis,$fontlab,$las,$tck,$cexmain,$border,$lty,$lwd,$lty,$lwd,$pch,$tpt,$main,$colmain,$fontmain,$nome; |
177 | 177 | //pega os valores |
178 | 178 | $dir = dirname(dirname($map_file)); |
... | ... | @@ -211,14 +211,14 @@ function graficoLinhas() |
211 | 211 | $map = ms_newMapObj($map_file); |
212 | 212 | $webo = $map->web; |
213 | 213 | $url = dirname($webo->imageurl)."/"; |
214 | - $cp->set_data($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
214 | + return($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
215 | 215 | } |
216 | 216 | /** |
217 | 217 | * Gera gráfico de distribuição de pontos (scatter). |
218 | 218 | */ |
219 | 219 | function graficoScatter() |
220 | 220 | { |
221 | - global $cp,$map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
221 | + global $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
222 | 222 | global $percentual,$nome,$margem,$margemexterna,$margeminterna,$corlinha,$grid,$ppontos,$locaplic,$dir_tmp,$gw,$gh,$res,$bg,$collab,$colaxis,$cexlab,$cexaxis,$fontlab,$las,$tck,$cexmain,$border,$lty,$lwd,$lty,$lwd,$pch,$tpt,$main,$colmain,$fontmain,$ylab,$xlab; |
223 | 223 | //pega os valores |
224 | 224 | $dir = dirname(dirname($map_file)); |
... | ... | @@ -243,14 +243,14 @@ function graficoScatter() |
243 | 243 | $map = ms_newMapObj($map_file); |
244 | 244 | $webo = $map->web; |
245 | 245 | $url = dirname($webo->imageurl)."/"; |
246 | - $cp->set_data($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
246 | + return ($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
247 | 247 | } |
248 | 248 | /** |
249 | 249 | * Gera gráfico de distribuição de pontos (scatter) com agrupamento em pixels. |
250 | 250 | */ |
251 | 251 | function graficoScatterBins() |
252 | 252 | { |
253 | - global $cp,$map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
253 | + global $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
254 | 254 | global $plota3d,$nbins,$percentual,$nome,$margem,$margemexterna,$margeminterna,$corlinha,$grid,$ppontos,$locaplic,$dir_tmp,$gw,$gh,$res,$bg,$collab,$colaxis,$cexlab,$cexaxis,$fontlab,$las,$tck,$cexmain,$border,$lty,$lwd,$lty,$lwd,$pch,$tpt,$main,$colmain,$fontmain,$ylab,$xlab; |
255 | 255 | //pega os valores |
256 | 256 | $dir = dirname(dirname($map_file)); |
... | ... | @@ -286,7 +286,7 @@ function graficoScatterBins() |
286 | 286 | $map = ms_newMapObj($map_file); |
287 | 287 | $webo = $map->web; |
288 | 288 | $url = dirname($webo->imageurl)."/"; |
289 | - $cp->set_data($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
289 | + return($url.$gfile_name.".png,".$url.(basename($nome)).",".$nome); | |
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
... | ... | @@ -294,7 +294,7 @@ function graficoScatterBins() |
294 | 294 | */ |
295 | 295 | function graficoEstrela() |
296 | 296 | { |
297 | - global $cp,$map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
297 | + global $map_file,$itemvalores,$itemclasses,$tema,$exclui,$tipo,$R_path; | |
298 | 298 | global $font,$cex,$grid,$ppontos,$locaplic,$dir_tmp,$w,$h,$res,$bg,$collab,$colaxis,$cexlab,$cexaxis,$fontlab,$las,$tck,$cexmain,$border,$lty,$lwd,$lty,$lwd,$pch,$tpt,$main,$colmain,$fontmain,$ylab,$xlab; |
299 | 299 | //pega os valores |
300 | 300 | $map = ms_newMapObj($map_file); |
... | ... | @@ -333,7 +333,7 @@ function graficoEstrela() |
333 | 333 | $map = ms_newMapObj($map_file); |
334 | 334 | $webo = $map->web; |
335 | 335 | $url = dirname($webo->imageurl)."/"; |
336 | - $cp->set_data($url.$gfile_name.".png,".$url.(basename($nomeV))); | |
336 | + return($url.$gfile_name.".png,".$url.(basename($nomeV))); | |
337 | 337 | } |
338 | 338 | function iniciaParGrafico($gw,$gh,$res,$dir_tmp,$gfile_name,$margem,$margemexterna,$margeminterna,$locaplic) |
339 | 339 | { | ... | ... |
classesphp/mapa_controle.php
... | ... | @@ -44,7 +44,12 @@ funcao - opção que será executada. |
44 | 44 | |
45 | 45 | Retorno: |
46 | 46 | |
47 | -cp - o resultado da operação será retornado em um objeto CPAINT. | |
47 | +O resultado da operação será retornado em um objeto CPAINT. | |
48 | + | |
49 | +A construção da string JSON é feita preferencialmente pelas funções nativas do PHP. | |
50 | +Para efeitos de compatibilidade, uma vez que até a versão 4.2 a string JSON era construida pelo CPAINT, | |
51 | +o objeto CPAINT ainda é definido, porém, a função cpjson verifica se as funções nativas do PHPO (json) | |
52 | +estão instaladas, se estiverem, utiliza-se a função nativa, se não, utiliza-se o CPAINT para gerar o JSON. | |
48 | 53 | |
49 | 54 | Exemplo de chamada CPAINT (Ajax) do lado do cliente (javascript): |
50 | 55 | |
... | ... | @@ -129,12 +134,13 @@ if (isset($debug) && $debug == "sim") |
129 | 134 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido |
130 | 135 | // |
131 | 136 | include_once ("carrega_ext.php"); |
132 | -include_once("../pacotes/cpaint/cpaint2.inc.php"); | |
137 | +include_once("funcoes_gerais.php"); | |
138 | +//include_once("../pacotes/cpaint/cpaint2.inc.php"); | |
133 | 139 | // |
134 | 140 | //cria objeto cpaint para uso com ajax |
135 | 141 | // |
136 | -$cp = new cpaint(); | |
137 | -$cp->set_data(""); | |
142 | +//$cp = new cpaint(); | |
143 | +//$cp->set_data(""); | |
138 | 144 | if ($funcao == "criaMapa") |
139 | 145 | { |
140 | 146 | session_destroy(); |
... | ... | @@ -151,20 +157,22 @@ if ($funcao == "criaMapa") |
151 | 157 | chdir($locaplic); |
152 | 158 | $interface = "mashup"; |
153 | 159 | include_once("ms_criamapa.php"); |
154 | - $cp->set_data(session_id()); | |
155 | - $cp->return_data(); | |
160 | + //$cp->set_data(session_id()); | |
161 | + //$cp->return_data(); | |
162 | + cpjson(session_id(),$cp); | |
156 | 163 | return; |
157 | -} | |
164 | +} | |
158 | 165 | if (!isset($map_file)) |
159 | 166 | { |
160 | 167 | //nesse caso é necessário criar o diretório temporário e iniciar o mapa |
161 | - $cp->set_data(array("erro"=>"linkquebrado")); | |
162 | - $cp->return_data(); | |
168 | + //$cp->set_data(array("erro"=>"linkquebrado")); | |
169 | + //$cp->return_data(); | |
170 | + cpjson(array("erro"=>"linkquebrado")); | |
163 | 171 | exit; |
164 | 172 | } |
165 | 173 | include_once("classe_vermultilayer.php"); |
166 | 174 | include_once("classe_estatistica.php"); |
167 | -include_once("funcoes_gerais.php"); | |
175 | + | |
168 | 176 | if (isset($debug) && $debug == "sim") |
169 | 177 | {error_reporting(E_ALL);} |
170 | 178 | // |
... | ... | @@ -179,13 +187,19 @@ $urli3geo = str_replace("/classesphp/mapa_controle.php","",$protocolo.$_SERVER[" |
179 | 187 | if($funcao != "recuperamapa") |
180 | 188 | { |
181 | 189 | if(!substituiCon($map_file,$postgis_mapa)) |
182 | - {$cp->set_data("erro");$cp->return_data();return;} | |
190 | + { | |
191 | + //$cp->set_data("erro"); | |
192 | + //$cp->return_data(); | |
193 | + cpjson("erro",$cp); | |
194 | + return; | |
195 | + } | |
183 | 196 | } |
184 | 197 | //set_time_limit(240); |
185 | 198 | |
186 | 199 | // |
187 | 200 | //faz a busca da função que deve ser executada |
188 | 201 | // |
202 | +$retorno = ""; //string que será retornada ao browser via JSON | |
189 | 203 | switch ($funcao) |
190 | 204 | { |
191 | 205 | /* |
... | ... | @@ -203,10 +217,11 @@ Include: |
203 | 217 | */ |
204 | 218 | case "inicia": |
205 | 219 | include_once("mapa_inicia.php"); |
206 | - $cp->register('iniciaMapa'); | |
207 | - $cp->start(); | |
208 | - if ($cp->get_data() == "") | |
209 | - {$cp->set_data("erro");} | |
220 | + iniciaMapa(); | |
221 | + //$cp->register('iniciaMapa'); | |
222 | + //$cp->start(); | |
223 | + //if ($cp->get_data() == "") | |
224 | + //{$cp->set_data("erro");} | |
210 | 225 | break; |
211 | 226 | /* |
212 | 227 | Property: montaFlamingo |
... | ... | @@ -218,7 +233,7 @@ Esse gerador, recebe como parâmetro o id da seção atual e transforma o mapfile a |
218 | 233 | */ |
219 | 234 | case "montaFlamingo": |
220 | 235 | include("flamingo.inc"); |
221 | - $cp->set_data($host."/ms_tmp/".basename(dirname($map_file))."/flamingo.xml"); | |
236 | + $retorno = $host."/ms_tmp/".basename(dirname($map_file))."/flamingo.xml"; | |
222 | 237 | break; |
223 | 238 | /* |
224 | 239 | Section: Análise de geometrias |
... | ... | @@ -238,8 +253,7 @@ Include: |
238 | 253 | case "incmapageometrias": |
239 | 254 | include_once("classe_analise.php"); |
240 | 255 | $m = new Analise($map_file,""); |
241 | - $resultado = $m->incmapageometrias($dir_tmp,$imgdir,$lista); | |
242 | - $cp->set_data($resultado); | |
256 | + $retorno = $m->incmapageometrias($dir_tmp,$imgdir,$lista); | |
243 | 257 | break; |
244 | 258 | /* |
245 | 259 | Property: chavegoogle |
... | ... | @@ -249,7 +263,7 @@ Retorna o valor da chave registrada para a API do Google maps |
249 | 263 | Essa chave deve ser registrada em i3geo/ms_configura.php |
250 | 264 | */ |
251 | 265 | case "chavegoogle": |
252 | - $cp->set_data($googleApiKey); | |
266 | + $retorno = $googleApiKey; | |
253 | 267 | break; |
254 | 268 | |
255 | 269 | /* |
... | ... | @@ -264,8 +278,7 @@ Include: |
264 | 278 | case "funcoesGeometrias": |
265 | 279 | include_once("classe_analise.php"); |
266 | 280 | $m = new Analise($map_file,""); |
267 | - $resultado = $m->funcoesGeometrias($dir_tmp,$imgdir,$lista,$operacao); | |
268 | - $cp->set_data($resultado); | |
281 | + $retorno = $m->funcoesGeometrias($dir_tmp,$imgdir,$lista,$operacao); | |
269 | 282 | break; |
270 | 283 | /* |
271 | 284 | Property: calculaGeometrias |
... | ... | @@ -279,8 +292,7 @@ Include: |
279 | 292 | case "calculaGeometrias": |
280 | 293 | include_once("classe_analise.php"); |
281 | 294 | $m = new Analise($map_file,""); |
282 | - $resultado = $m->calculaGeometrias($dir_tmp,$imgdir,$lista,$operacao,$postgis_con,$srid_area); | |
283 | - $cp->set_data($resultado); | |
295 | + $retorno = $m->calculaGeometrias($dir_tmp,$imgdir,$lista,$operacao,$postgis_con,$srid_area); | |
284 | 296 | break; |
285 | 297 | /* |
286 | 298 | Property: listageometrias |
... | ... | @@ -296,8 +308,7 @@ Include: |
296 | 308 | include_once("classe_temas.php"); |
297 | 309 | if(!isset($tema)){$tema = "";} |
298 | 310 | $m = new Temas($map_file,$tema); |
299 | - $resultado = $m->listaGeometrias($dir_tmp,$imgdir); | |
300 | - $cp->set_data($resultado); | |
311 | + $retorno = $m->listaGeometrias($dir_tmp,$imgdir); | |
301 | 312 | break; |
302 | 313 | /* |
303 | 314 | Property: capturageometrias |
... | ... | @@ -312,8 +323,7 @@ Include: |
312 | 323 | case "capturageometrias": |
313 | 324 | include_once("classe_temas.php"); |
314 | 325 | $m = new Temas($map_file,$tema); |
315 | - $resultado = $m->capturaGeometrias($dir_tmp,$imgdir,$nome); | |
316 | - $cp->set_data($resultado); | |
326 | + $retorno = $m->capturaGeometrias($dir_tmp,$imgdir,$nome); | |
317 | 327 | break; |
318 | 328 | /* |
319 | 329 | Property: removergeometrias |
... | ... | @@ -329,8 +339,7 @@ Include: |
329 | 339 | include_once("classe_temas.php"); |
330 | 340 | if(!isset($tema)){$tema = "";} |
331 | 341 | $m = new Temas($map_file,$tema); |
332 | - $resultado = $m->removerGeometrias($dir_tmp,$imgdir,$lista); | |
333 | - $cp->set_data($resultado); | |
342 | + $retorno = $m->removerGeometrias($dir_tmp,$imgdir,$lista); | |
334 | 343 | break; |
335 | 344 | /* |
336 | 345 | Section: Open Layers |
... | ... | @@ -358,8 +367,7 @@ Include: |
358 | 367 | include_once("classe_mapa.php"); |
359 | 368 | $m = New Mapa($map_file); |
360 | 369 | $par = $m->parametrosTemas(); |
361 | - $resultado = array("mapfile"=>$map_file,"mapext"=>$mapext,"locmapserv"=>$locmapserv,"parametros"=>$par); | |
362 | - $cp->set_data($resultado); | |
370 | + $retorno = array("mapfile"=>$map_file,"mapext"=>$mapext,"locmapserv"=>$locmapserv,"parametros"=>$par); | |
363 | 371 | break; |
364 | 372 | /* |
365 | 373 | Section: Mapa |
... | ... | @@ -372,8 +380,7 @@ Pega as mensagens do metadata 'mensagem'. |
372 | 380 | case "pegaMensagens": |
373 | 381 | include_once("classe_mapa.php"); |
374 | 382 | $m = new Mapa($map_file); |
375 | - $cp->set_data($m->pegaMensagens()); | |
376 | - | |
383 | + $retorno = $m->pegaMensagens(); | |
377 | 384 | break; |
378 | 385 | /* |
379 | 386 | Property: reiniciaMapa |
... | ... | @@ -385,7 +392,7 @@ Reinicia um mapa restaurando a cópia de segurança. |
385 | 392 | {unlink($map_file."qy");} |
386 | 393 | unlink($map_file); |
387 | 394 | copy(str_replace(".map","reinc.map",$map_file),$map_file); |
388 | - $cp->set_data("ok"); | |
395 | + $retorno = "ok"; | |
389 | 396 | break; |
390 | 397 | /* |
391 | 398 | Property: recuperamapa |
... | ... | @@ -406,7 +413,7 @@ Recupera o mapfile de segurança. |
406 | 413 | $nmf = str_replace(".map","reinc.map",$map_file); |
407 | 414 | copy($nmf,$map_file); |
408 | 415 | } |
409 | - $cp->set_data("ok"); | |
416 | + $retorno = "ok"; | |
410 | 417 | break; |
411 | 418 | /* |
412 | 419 | Property: ativalogo |
... | ... | @@ -420,7 +427,7 @@ Include: |
420 | 427 | include_once("classe_mapa.php"); |
421 | 428 | copiaSeguranca($map_file); |
422 | 429 | $m = new Mapa($map_file); |
423 | - $cp->set_data($m->ativalogo()); | |
430 | + $m->ativalogo(); | |
424 | 431 | $m->salva(); |
425 | 432 | redesenhaMapa(); |
426 | 433 | break; |
... | ... | @@ -436,7 +443,7 @@ Include: |
436 | 443 | include_once("classe_mapa.php"); |
437 | 444 | copiaSeguranca($map_file); |
438 | 445 | $m = new Mapa($map_file); |
439 | - $cp->set_data($m->ativalegenda()); | |
446 | + $m->ativalegenda(); | |
440 | 447 | $m->salva(); |
441 | 448 | redesenhaMapa(); |
442 | 449 | break; |
... | ... | @@ -457,7 +464,7 @@ Include: |
457 | 464 | include_once("classe_mapa.php"); |
458 | 465 | $m = new Mapa($map_file); |
459 | 466 | $m->mudaQS($largura,$altura); |
460 | - $cp->set_data("ok"); | |
467 | + $retorno = "ok"; | |
461 | 468 | break; |
462 | 469 | /* |
463 | 470 | Property: gradeCoord |
... | ... | @@ -471,7 +478,7 @@ Include: |
471 | 478 | include_once("classe_mapa.php"); |
472 | 479 | copiaSeguranca($map_file); |
473 | 480 | $m = new Mapa($map_file); |
474 | - $cp->set_data($m->gradeCoord($intervalo,$corlinha,$larguralinha,$tipolinha,$tamanhotexto,$fonte,$cortexto,$incluitexto,$mascara,$shadowcolor,$shadowsizex,$shadowsizey)); | |
481 | + $m->gradeCoord($intervalo,$corlinha,$larguralinha,$tipolinha,$tamanhotexto,$fonte,$cortexto,$incluitexto,$mascara,$shadowcolor,$shadowsizex,$shadowsizey); | |
475 | 482 | $m->salva(); |
476 | 483 | redesenhaMapa(); |
477 | 484 | break; |
... | ... | @@ -487,8 +494,7 @@ Include: |
487 | 494 | include_once("classe_mapa.php"); |
488 | 495 | $m = new Mapa($map_file); |
489 | 496 | if(!isset($h)){$h = "";} |
490 | - $resultado = $m->converteWS($locmapserv,$h); | |
491 | - $cp->set_data($resultado); | |
497 | + $retorno = $m->converteWS($locmapserv,$h); | |
492 | 498 | break; |
493 | 499 | /* |
494 | 500 | Property: querymapcor |
... | ... | @@ -502,7 +508,7 @@ Include: |
502 | 508 | include_once("classe_mapa.php"); |
503 | 509 | copiaSeguranca($map_file); |
504 | 510 | $m = new Mapa($map_file); |
505 | - $cp->set_data($m->corQM($cor)); | |
511 | + $m->corQM($cor); | |
506 | 512 | $m->salva(); |
507 | 513 | redesenhaMapa(); |
508 | 514 | break; |
... | ... | @@ -517,7 +523,7 @@ Include: |
517 | 523 | case "pegaquerymapcor": |
518 | 524 | include_once("classe_mapa.php"); |
519 | 525 | $m = new Mapa($map_file); |
520 | - $cp->set_data($m->corQM("")); | |
526 | + $retorno = $m->corQM(""); | |
521 | 527 | break; |
522 | 528 | /* |
523 | 529 | Property: corfundo |
... | ... | @@ -531,7 +537,7 @@ Include: |
531 | 537 | include_once("classe_mapa.php"); |
532 | 538 | copiaSeguranca($map_file); |
533 | 539 | $m = new Mapa($map_file); |
534 | - $cp->set_data($m->corfundo($cor)); | |
540 | + $m->corfundo($cor); | |
535 | 541 | $m->salva(); |
536 | 542 | redesenhaMapa(); |
537 | 543 | break; |
... | ... | @@ -546,7 +552,7 @@ Include: |
546 | 552 | case "pegacorfundo": |
547 | 553 | include_once("classe_mapa.php"); |
548 | 554 | $m = new Mapa($map_file); |
549 | - $cp->set_data($m->corfundo("")); | |
555 | + $retorno = $m->corfundo(""); | |
550 | 556 | break; |
551 | 557 | /* |
552 | 558 | Property: corpo |
... | ... | @@ -570,8 +576,7 @@ Include: |
570 | 576 | case "corpoentorno": |
571 | 577 | include_once("classe_mapa.php"); |
572 | 578 | $m = new Mapa($map_file); |
573 | - $resultado = $m->redesenhaEntorno(); | |
574 | - $cp->set_data($resultado); | |
579 | + $retorno = $m->redesenhaEntorno(); | |
575 | 580 | break; |
576 | 581 | /* |
577 | 582 | Property: adicionaTemaGeoRSS |
... | ... | @@ -586,12 +591,11 @@ Include: |
586 | 591 | copiaSeguranca($map_file); |
587 | 592 | $m = new Mapa($map_file); |
588 | 593 | $retorno = $m->adicionaTemaGeoRSS($servico,$dir_tmp,$locaplic,$canal); |
589 | - $cp->set_data($retorno); | |
590 | 594 | if ($retorno != "erro") |
591 | 595 | {$m->salva();redesenhaMapa();} |
592 | 596 | else |
593 | 597 | { |
594 | - $cp->set_data("erro.Nenhum dado espacializado foi encontrado."); | |
598 | + $retorno = "erro.Nenhum dado espacializado foi encontrado."; | |
595 | 599 | } |
596 | 600 | break; |
597 | 601 | /* |
... | ... | @@ -607,12 +611,11 @@ Include: |
607 | 611 | copiaSeguranca($map_file); |
608 | 612 | $m = new Mapa($map_file); |
609 | 613 | $retorno = $m->adicionaTemaSHP($arq); |
610 | - $cp->set_data($retorno); | |
611 | 614 | if ($retorno != "erro") |
612 | 615 | {$m->salva();redesenhaMapa();} |
613 | 616 | else |
614 | 617 | { |
615 | - $cp->set_data("erro.Nenhum dado espacializado foi encontrado."); | |
618 | + $retorno = "erro.Nenhum dado espacializado foi encontrado."; | |
616 | 619 | } |
617 | 620 | break; |
618 | 621 | /* |
... | ... | @@ -628,12 +631,11 @@ Include: |
628 | 631 | copiaSeguranca($map_file); |
629 | 632 | $m = new Mapa($map_file); |
630 | 633 | $retorno = $m->adicionaTemaIMG($arq); |
631 | - $cp->set_data($retorno); | |
632 | 634 | if ($retorno != "erro") |
633 | 635 | {$m->salva();redesenhaMapa();} |
634 | 636 | else |
635 | 637 | { |
636 | - $cp->set_data("erro.Nenhum dado espacializado foi encontrado."); | |
638 | + $retorno = "erro.Nenhum dado espacializado foi encontrado."; | |
637 | 639 | } |
638 | 640 | break; |
639 | 641 | /* |
... | ... | @@ -647,8 +649,8 @@ Include: |
647 | 649 | case "listatemas": |
648 | 650 | include_once("classe_mapa.php"); |
649 | 651 | $m = new Mapa($map_file); |
650 | - $resultado = $m->listaTemas($tipo); | |
651 | - $cp->set_data(array_reverse($resultado)); | |
652 | + $retorno = $m->listaTemas($tipo); | |
653 | + $retorno = array_reverse($retorno); | |
652 | 654 | break; |
653 | 655 | /* |
654 | 656 | Property: listatemaslocais |
... | ... | @@ -661,8 +663,7 @@ Include: |
661 | 663 | case "listatemaslocais": |
662 | 664 | include_once("classe_mapa.php"); |
663 | 665 | $m = new Mapa($map_file); |
664 | - $resultado = $m->listaTemasLocais(); | |
665 | - $cp->set_data($resultado); | |
666 | + $retorno = $m->listaTemasLocais(); | |
666 | 667 | break; |
667 | 668 | /* |
668 | 669 | Property: listatemasTipo |
... | ... | @@ -676,8 +677,7 @@ Include: |
676 | 677 | include_once("classe_mapa.php"); |
677 | 678 | $m = new Mapa($map_file); |
678 | 679 | if(!isset($selecao)){$selecao = "nao";} |
679 | - $resultado = $m->listaTemasTipo($tipo,$selecao); | |
680 | - $cp->set_data($resultado); | |
680 | + $retorno = $m->listaTemasTipo($tipo,$selecao); | |
681 | 681 | break; |
682 | 682 | /* |
683 | 683 | Property: listatemascomsel |
... | ... | @@ -690,8 +690,7 @@ Include: |
690 | 690 | case "listatemascomsel": |
691 | 691 | include_once("classe_mapa.php"); |
692 | 692 | $m = new Mapa($map_file); |
693 | - $resultado = $m->listaTemasComSel(); | |
694 | - $cp->set_data($resultado); | |
693 | + $retorno = $m->listaTemasComSel(); | |
695 | 694 | break; |
696 | 695 | /* |
697 | 696 | Property: ligatemas |
... | ... | @@ -705,7 +704,7 @@ Include: |
705 | 704 | include_once("classe_mapa.php"); |
706 | 705 | copiaSeguranca($map_file); |
707 | 706 | $m = new Mapa($map_file,$locaplic); |
708 | - $cp->set_data($m->ligaDesligaTemas($ligar,$desligar,$adicionar)); | |
707 | + $retorno = $m->ligaDesligaTemas($ligar,$desligar,$adicionar); | |
709 | 708 | $m->salva(); |
710 | 709 | break; |
711 | 710 | /* |
... | ... | @@ -723,13 +722,13 @@ Include: |
723 | 722 | $salvar = $m->adicionaTema($temas,$locaplic); |
724 | 723 | if($salvar) |
725 | 724 | $m->salva(); |
726 | - $cp->set_data("ok"); | |
725 | + $retorno = "ok"; | |
727 | 726 | $teste = testaMapa($map_file,$postgis_mapa); |
728 | 727 | if ($teste == "ok") |
729 | - {$cp->set_data("ok");} | |
728 | + {$retorno = "ok";} | |
730 | 729 | else |
731 | 730 | { |
732 | - $cp->set_data(array("erro"=>"A camada nao pode ser adicionada. ".$teste)); | |
731 | + $retorno = array("erro"=>"A camada nao pode ser adicionada. ".$teste); | |
733 | 732 | } |
734 | 733 | break; |
735 | 734 | /* |
... | ... | @@ -744,7 +743,7 @@ Include: |
744 | 743 | include_once("classe_mapa.php"); |
745 | 744 | copiaSeguranca($map_file); |
746 | 745 | $m = new Mapa($map_file); |
747 | - $cp->set_data($m->excluiTemas($temas)); | |
746 | + $m->excluiTemas($temas); | |
748 | 747 | $m->salva(); |
749 | 748 | redesenhaMapa(); |
750 | 749 | break; |
... | ... | @@ -763,10 +762,10 @@ Include: |
763 | 762 | $m->adicionatemawms($tema,$servico,$nome,$proj,$formato,$locaplic,$tipo,$versao,$nomecamada,$dir_tmp,$imgdir,$imgurl,$tiporep,$suportasld,$formatosinfo,$time); |
764 | 763 | $teste = testaMapa($map_file,$postgis_mapa); |
765 | 764 | if ($teste == "ok") |
766 | - {$cp->set_data("ok");} | |
765 | + {$retorno = "ok";} | |
767 | 766 | else |
768 | 767 | { |
769 | - $cp->set_data(array("erro"=>"A camada nao pode ser adicionada. ".$teste)); | |
768 | + $retorno = array("erro"=>"A camada nao pode ser adicionada. ".$teste); | |
770 | 769 | } |
771 | 770 | break; |
772 | 771 | /* |
... | ... | @@ -777,8 +776,7 @@ Gera a imagem do mapa de referência. |
777 | 776 | case "referencia": |
778 | 777 | $objMapa = ms_newMapObj($map_file); |
779 | 778 | $nomeImagem = nomeRandomico(); |
780 | - $cp->register('retornaReferencia'); | |
781 | - $cp->start(); | |
779 | + $retorno = retornaReferencia(); | |
782 | 780 | break; |
783 | 781 | /* |
784 | 782 | Property: referenciadinamica |
... | ... | @@ -788,8 +786,7 @@ Gera a imagem do mapa de referência de forma dinâmica, variando com a escala do |
788 | 786 | case "referenciadinamica": |
789 | 787 | //$objMapa = ms_newMapObj($map_file); |
790 | 788 | $nomeImagem = nomeRandomico(); |
791 | - $cp->register('retornaReferenciaDinamica'); | |
792 | - $cp->start(); | |
789 | + $retorno = retornaReferenciaDinamica(); | |
793 | 790 | break; |
794 | 791 | /* |
795 | 792 | Section: Temas |
... | ... | @@ -817,7 +814,6 @@ Include: |
817 | 814 | if (gethostbyname($n["ip"]) == $ipcliente) |
818 | 815 | {$retorno[] = $n["drives"];} |
819 | 816 | } |
820 | - $cp->set_data($retorno); | |
821 | 817 | break; |
822 | 818 | /* |
823 | 819 | Property: alterarepresentacao |
... | ... | @@ -831,7 +827,7 @@ Include: |
831 | 827 | include_once("classe_temas.php"); |
832 | 828 | copiaSeguranca($map_file); |
833 | 829 | $m = new Temas($map_file,$tema); |
834 | - $cp->set_data($m->alteraRepresentacao()); | |
830 | + $m->alteraRepresentacao(); | |
835 | 831 | $m->salva(); |
836 | 832 | redesenhaMapa(); |
837 | 833 | break; |
... | ... | @@ -846,7 +842,7 @@ Include: |
846 | 842 | case "geradestaque": |
847 | 843 | include_once("classe_temas.php"); |
848 | 844 | $m = new Temas($map_file,$tema); |
849 | - $cp->set_data($m->geraDestaque()); | |
845 | + $retorno = $m->geraDestaque(); | |
850 | 846 | break; |
851 | 847 | /* |
852 | 848 | Property: download |
... | ... | @@ -854,7 +850,7 @@ Property: download |
854 | 850 | Gera os arquivos para download de um tema. |
855 | 851 | */ |
856 | 852 | case "download": |
857 | - $cp->set_data(downloadTema($map_file,$tema,$locaplic,$dir_tmp)); | |
853 | + $retorno = downloadTema($map_file,$tema,$locaplic,$dir_tmp); | |
858 | 854 | break; |
859 | 855 | /* |
860 | 856 | function: insereFeature |
... | ... | @@ -869,9 +865,9 @@ Include: |
869 | 865 | copiaSeguranca($map_file); |
870 | 866 | $m = new Temas($map_file,""); |
871 | 867 | if(!isset($marca)){$marca="";} |
872 | - $cp->set_data($m->insereFeature($marca,$tipo,$xy,$texto,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte)); | |
868 | + $m->insereFeature($marca,$tipo,$xy,$texto,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte); | |
873 | 869 | $m->salva(); |
874 | - redesenhaMapa(); | |
870 | + redesenhaMapa(); | |
875 | 871 | break; |
876 | 872 | /* |
877 | 873 | Property: sobetema |
... | ... | @@ -885,7 +881,7 @@ Include: |
885 | 881 | include_once("classe_temas.php"); |
886 | 882 | copiaSeguranca($map_file); |
887 | 883 | $m = new Temas($map_file,$tema); |
888 | - $cp->set_data($m->sobeTema()); | |
884 | + $m->sobeTema(); | |
889 | 885 | $m->salva(); |
890 | 886 | redesenhaMapa(); |
891 | 887 | break; |
... | ... | @@ -901,7 +897,7 @@ Include: |
901 | 897 | include_once("classe_temas.php"); |
902 | 898 | copiaSeguranca($map_file); |
903 | 899 | $m = new Temas($map_file,$tema); |
904 | - $cp->set_data($m->desceTema()); | |
900 | + $m->desceTema(); | |
905 | 901 | $m->salva(); |
906 | 902 | redesenhaMapa(); |
907 | 903 | break; |
... | ... | @@ -916,7 +912,7 @@ Include: |
916 | 912 | case "fontetema": |
917 | 913 | include_once("classe_temas.php"); |
918 | 914 | $m = new Temas($map_file,null,$locaplic); |
919 | - $cp->set_data($m->fonteTema($tema)); | |
915 | + $retorno = $m->fonteTema($tema); | |
920 | 916 | break; |
921 | 917 | /* |
922 | 918 | Property: reordenatemas |
... | ... | @@ -930,7 +926,7 @@ Include: |
930 | 926 | include_once("classe_temas.php"); |
931 | 927 | copiaSeguranca($map_file); |
932 | 928 | $m = new Temas($map_file); |
933 | - $cp->set_data($m->reordenatemas($lista)); | |
929 | + $m->reordenatemas($lista); | |
934 | 930 | $m->salva(); |
935 | 931 | redesenhaMapa(); |
936 | 932 | break; |
... | ... | @@ -946,7 +942,7 @@ Include: |
946 | 942 | include_once("classe_temas.php"); |
947 | 943 | copiaSeguranca($map_file); |
948 | 944 | $m = new Temas($map_file,$tema); |
949 | - $cp->set_data($m->zoomTema()); | |
945 | + $m->zoomTema(); | |
950 | 946 | $m->salva(); |
951 | 947 | redesenhaMapa(); |
952 | 948 | break; |
... | ... | @@ -962,7 +958,7 @@ Include: |
962 | 958 | include_once("classe_temas.php"); |
963 | 959 | copiaSeguranca($map_file); |
964 | 960 | $m = new Temas($map_file,$tema); |
965 | - $cp->set_data($m->zoomSel()); | |
961 | + $m->zoomSel(); | |
966 | 962 | $m->salva(); |
967 | 963 | redesenhaMapa(); |
968 | 964 | break; |
... | ... | @@ -979,7 +975,7 @@ Include: |
979 | 975 | copiaSeguranca($map_file); |
980 | 976 | $m = new Temas($map_file,$tema); |
981 | 977 | if(!isset($testa)){$testa="";} |
982 | - {$cp->set_data($m->insereFiltro($filtro,$testa));} | |
978 | + {$retorno = $m->insereFiltro($filtro,$testa);} | |
983 | 979 | if($testa != "sim") |
984 | 980 | { |
985 | 981 | $m->salva(); |
... | ... | @@ -997,7 +993,7 @@ Include: |
997 | 993 | case "pegafiltro": |
998 | 994 | include_once("classe_temas.php"); |
999 | 995 | $m = new Temas($map_file,$tema); |
1000 | - $cp->set_data($m->pegaFiltro()); | |
996 | + $retorno = $m->pegaFiltro(); | |
1001 | 997 | break; |
1002 | 998 | /* |
1003 | 999 | Property: aplicaProcessos |
... | ... | @@ -1078,25 +1074,23 @@ Include: |
1078 | 1074 | copiaSeguranca($map_file); |
1079 | 1075 | $m = new Alteraclasse($map_file,$tema); |
1080 | 1076 | if ($opcao == "adicionaclasse") |
1081 | - {$cp->set_data($m->adicionaclasse());} | |
1077 | + {$retorno = $m->adicionaclasse();} | |
1082 | 1078 | if ($opcao == "valorunico") |
1083 | - {$cp->set_data($m->valorunico($item,$ignorar));} | |
1079 | + {$retorno = $m->valorunico($item,$ignorar);} | |
1084 | 1080 | if ($opcao == "intervalosiguais") |
1085 | - {$cp->set_data($m->intervalosiguais($item,$nclasses,$ignorar));} | |
1081 | + {$retorno = $m->intervalosiguais($item,$nclasses,$ignorar);} | |
1086 | 1082 | if ($opcao == "quartis") |
1087 | 1083 | {$cp->set_data($m->quartis($item,$ignorar));} |
1088 | 1084 | if ($opcao == "alteraclasses") |
1089 | 1085 | { |
1090 | 1086 | //esta operação é chamada com POST via cpaint |
1091 | 1087 | //por isso precisa ser executada com start |
1092 | - $cp->register('alteraclassesPost'); | |
1093 | - $cp->start(); | |
1088 | + alteraclassesPost(); | |
1094 | 1089 | restauraCon($map_file,$postgis_mapa); |
1095 | - $cp->return_data(); | |
1096 | - exit; | |
1090 | + cpjson(""); | |
1097 | 1091 | } |
1098 | 1092 | if ($opcao == "simbolounico") |
1099 | - {$cp->set_data($m->simbolounico());} | |
1093 | + {$retorno = $m->simbolounico();} | |
1100 | 1094 | $salvo = $m->salva(); |
1101 | 1095 | break; |
1102 | 1096 | /* |
... | ... | @@ -1111,7 +1105,7 @@ Include: |
1111 | 1105 | include_once("classe_alteraclasse.php"); |
1112 | 1106 | copiaSeguranca($map_file); |
1113 | 1107 | $m = new Alteraclasse($map_file,$tema); |
1114 | - $cp->set_data($m->inverteCoresClasses()); | |
1108 | + $retorno = $m->inverteCoresClasses(); | |
1115 | 1109 | $m->salva(); |
1116 | 1110 | break; |
1117 | 1111 | /* |
... | ... | @@ -1126,7 +1120,7 @@ Include: |
1126 | 1120 | include_once("classe_alteraclasse.php"); |
1127 | 1121 | copiaSeguranca($map_file); |
1128 | 1122 | $m = new Alteraclasse($map_file,$tema); |
1129 | - $cp->set_data($m->calculaTamanhoClasses()); | |
1123 | + $retorno = $m->calculaTamanhoClasses(); | |
1130 | 1124 | $m->salva(); |
1131 | 1125 | break; |
1132 | 1126 | /* |
... | ... | @@ -1141,7 +1135,7 @@ Include: |
1141 | 1135 | include_once("classe_alteraclasse.php"); |
1142 | 1136 | copiaSeguranca($map_file); |
1143 | 1137 | $m = new Alteraclasse($map_file,$tema); |
1144 | - $cp->set_data($m->alteraCoresClasses($cori,$corf)); | |
1138 | + $retorno = $m->alteraCoresClasses($cori,$corf); | |
1145 | 1139 | $m->salva(); |
1146 | 1140 | break; |
1147 | 1141 | /* |
... | ... | @@ -1156,7 +1150,7 @@ Include: |
1156 | 1150 | include_once("classe_alteraclasse.php"); |
1157 | 1151 | copiaSeguranca($map_file); |
1158 | 1152 | $m = new Alteraclasse($map_file,$tema); |
1159 | - $cp->set_data($m->statusClasse($classe)); | |
1153 | + $retorno = $m->statusClasse($classe); | |
1160 | 1154 | $m->salva(); |
1161 | 1155 | break; |
1162 | 1156 | /* |
... | ... | @@ -1176,7 +1170,7 @@ Include: |
1176 | 1170 | { |
1177 | 1171 | $res[] = $cores[0].",".$cores[1].",".$cores[2]; |
1178 | 1172 | } |
1179 | - $cp->set_data(implode("*",$res)); | |
1173 | + $retorno = implode("*",$res); | |
1180 | 1174 | break; |
1181 | 1175 | /* |
1182 | 1176 | Section: Análise geográfica |
... | ... | @@ -1197,7 +1191,7 @@ Include: |
1197 | 1191 | include_once("classe_analise.php"); |
1198 | 1192 | copiaSeguranca($map_file); |
1199 | 1193 | $m = new Analise($map_file,$tema); |
1200 | - $cp->set_data($m->dissolvePoligono($item,$locaplic)); | |
1194 | + $retorno = $m->dissolvePoligono($item,$locaplic); | |
1201 | 1195 | $m->salva(); |
1202 | 1196 | break; |
1203 | 1197 | /* |
... | ... | @@ -1214,7 +1208,7 @@ Include: |
1214 | 1208 | include_once("classe_analise.php"); |
1215 | 1209 | copiaSeguranca($map_file); |
1216 | 1210 | $m = new Analise($map_file,$tema); |
1217 | - $cp->set_data($m->agrupaElementos($item,$locaplic)); | |
1211 | + $retorno = $m->agrupaElementos($item,$locaplic); | |
1218 | 1212 | $m->salva(); |
1219 | 1213 | break; |
1220 | 1214 | /* |
... | ... | @@ -1231,7 +1225,7 @@ Include: |
1231 | 1225 | include_once("classe_analise.php"); |
1232 | 1226 | copiaSeguranca($map_file); |
1233 | 1227 | $m = new Analise($map_file,$tema); |
1234 | - $cp->set_data($m->pontoEmPoligono($temaPt,$temasPo,$locaplic)); | |
1228 | + $retorno = $m->pontoEmPoligono($temaPt,$temasPo,$locaplic); | |
1235 | 1229 | $m->salva(); |
1236 | 1230 | break; |
1237 | 1231 | /* |
... | ... | @@ -1248,7 +1242,7 @@ Include: |
1248 | 1242 | include_once("classe_analise.php"); |
1249 | 1243 | copiaSeguranca($map_file); |
1250 | 1244 | $m = new Analise($map_file,$tema); |
1251 | - $cp->set_data($m->nptPol($temaPt,$temaPo,$locaplic)); | |
1245 | + $retorno = $m->nptPol($temaPt,$temaPo,$locaplic); | |
1252 | 1246 | $m->salva(); |
1253 | 1247 | break; |
1254 | 1248 | /* |
... | ... | @@ -1265,7 +1259,7 @@ Include: |
1265 | 1259 | include_once("classe_analise.php"); |
1266 | 1260 | copiaSeguranca($map_file); |
1267 | 1261 | $m = new Analise($map_file,$tema); |
1268 | - $cp->set_data($m->criaBuffer($distancia,$locaplic,$unir)); | |
1262 | + $retorno = $m->criaBuffer($distancia,$locaplic,$unir); | |
1269 | 1263 | $m->salva(); |
1270 | 1264 | //limpa selecao |
1271 | 1265 | if (file_exists($map_file."qy")) |
... | ... | @@ -1286,7 +1280,7 @@ Include: |
1286 | 1280 | copiaSeguranca($map_file); |
1287 | 1281 | $m = new Analise($map_file,$temaorigem); |
1288 | 1282 | $temaoverlay = $m->criaBuffer($distancia,$locaplic); |
1289 | - $cp->set_data($m->distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorigem,$itemdestino)); | |
1283 | + $retorno = $m->distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorigem,$itemdestino); | |
1290 | 1284 | $m->salva(); |
1291 | 1285 | break; |
1292 | 1286 | /* |
... | ... | @@ -1303,7 +1297,7 @@ Include: |
1303 | 1297 | include_once("classe_analise.php"); |
1304 | 1298 | copiaSeguranca($map_file); |
1305 | 1299 | $m = new Analise($map_file,$tema); |
1306 | - $cp->set_data($m->criaCentroide($locaplic)); | |
1300 | + $retorno = $m->criaCentroide($locaplic); | |
1307 | 1301 | $m->salva(); |
1308 | 1302 | break; |
1309 | 1303 | /* |
... | ... | @@ -1324,9 +1318,8 @@ Include: |
1324 | 1318 | if(!isset($limitepontos)) |
1325 | 1319 | {$limitepontos = "";} |
1326 | 1320 | $m = new Analise($map_file,$tema); |
1327 | - $res = $m->analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma,$limitepontos,$tema2,$extendelimite); | |
1321 | + $retorno = $m->analiseDistriPt($locaplic,$dir_tmp,$R_path,$numclasses,$tipo,$cori,$corf,$tmpurl,$sigma,$limitepontos,$tema2,$extendelimite); | |
1328 | 1322 | $m->salva(); |
1329 | - $cp->set_data($res); | |
1330 | 1323 | break; |
1331 | 1324 | /* |
1332 | 1325 | Property: gradeDePontos |
... | ... | @@ -1343,7 +1336,7 @@ Include: |
1343 | 1336 | copiaSeguranca($map_file); |
1344 | 1337 | if(!isset($tema)){$tema = "";} |
1345 | 1338 | $m = new Analise($map_file,$tema); |
1346 | - $cp->set_data($m->gradeDePontos($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty)); | |
1339 | + $retorno = $m->gradeDePontos($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty); | |
1347 | 1340 | $m->salva(); |
1348 | 1341 | break; |
1349 | 1342 | /* |
... | ... | @@ -1361,7 +1354,7 @@ Include: |
1361 | 1354 | copiaSeguranca($map_file); |
1362 | 1355 | if(!isset($tema)){$tema = "";} |
1363 | 1356 | $m = new Analise($map_file,$tema); |
1364 | - $cp->set_data($m->gradeDePol($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty)); | |
1357 | + $retorno = $m->gradeDePol($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty); | |
1365 | 1358 | $m->salva(); |
1366 | 1359 | break; |
1367 | 1360 | /* |
... | ... | @@ -1379,7 +1372,7 @@ Include: |
1379 | 1372 | copiaSeguranca($map_file); |
1380 | 1373 | $m = new Analise($map_file,$tema); |
1381 | 1374 | if(!isset($tema)){$tema = "";} |
1382 | - $cp->set_data($m->gradeDeHex($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty)); | |
1375 | + $retorno = $m->gradeDeHex($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty); | |
1383 | 1376 | $m->salva(); |
1384 | 1377 | break; |
1385 | 1378 | /* |
... | ... | @@ -1400,7 +1393,7 @@ Include: |
1400 | 1393 | case "sphPT2shp": |
1401 | 1394 | include_once("classe_shp.php"); |
1402 | 1395 | $m = new SHP($map_file,$tema); |
1403 | - $cp->set_data($m->shpPT2shp($locaplic,$para)); | |
1396 | + $retorno = $m->shpPT2shp($locaplic,$para); | |
1404 | 1397 | $m->salva(); |
1405 | 1398 | break; |
1406 | 1399 | /* |
... | ... | @@ -1414,7 +1407,7 @@ Include: |
1414 | 1407 | case "listaPontosShape": |
1415 | 1408 | include_once("classe_shp.php"); |
1416 | 1409 | $m = new SHP($map_file,$tema); |
1417 | - $cp->set_data($m->listaPontosShape()); | |
1410 | + $retorno = $m->listaPontosShape(); | |
1418 | 1411 | break; |
1419 | 1412 | /* |
1420 | 1413 | Property: criashpvazio |
... | ... | @@ -1429,7 +1422,7 @@ Include: |
1429 | 1422 | $m = new SHP($map_file); |
1430 | 1423 | if(!isset($tituloTema)) |
1431 | 1424 | {$tituloTema = "";} |
1432 | - $cp->set_data($m->criaSHPvazio($tituloTema)); | |
1425 | + $retorno = $m->criaSHPvazio($tituloTema); | |
1433 | 1426 | $m->salva(); |
1434 | 1427 | break; |
1435 | 1428 | /* |
... | ... | @@ -1459,7 +1452,7 @@ Include: |
1459 | 1452 | case "pegaxyUltimoPonto": |
1460 | 1453 | include_once("classe_shp.php"); |
1461 | 1454 | $m = new SHP($map_file,$tema); |
1462 | - $cp->set_data($m->ultimoXY()); | |
1455 | + $retorno = $m->ultimoXY(); | |
1463 | 1456 | break; |
1464 | 1457 | |
1465 | 1458 | /* |
... | ... | @@ -1476,7 +1469,7 @@ Include: |
1476 | 1469 | include_once("classe_shp.php"); |
1477 | 1470 | copiaSeguranca($map_file); |
1478 | 1471 | $m = new SHP($map_file,$tema,$locaplic); |
1479 | - $cp->set_data($m->insereSHPgrafico($x,$y,$itens,$width,$inclinacao,$shadow_height)); | |
1472 | + $retorno = $m->insereSHPgrafico($x,$y,$itens,$width,$inclinacao,$shadow_height); | |
1480 | 1473 | break; |
1481 | 1474 | /* |
1482 | 1475 | Property: mostrawkt |
... | ... | @@ -1486,7 +1479,7 @@ Gera string wkt de um conjunto de pontos. |
1486 | 1479 | */ |
1487 | 1480 | case "mostrawkt": |
1488 | 1481 | $res = xy2wkt($xy); |
1489 | - $cp->set_data(array($res["ponto"],$res["linha"],$res["poligono"])); | |
1482 | + $retorno = array($res["ponto"],$res["linha"],$res["poligono"]); | |
1490 | 1483 | break; |
1491 | 1484 | /* |
1492 | 1485 | Section: Gráficos |
... | ... | @@ -1505,7 +1498,7 @@ Pega os dados necessários para a geração dos gráficos da ferramenta seleção |
1505 | 1498 | {$exclui = "";} |
1506 | 1499 | if(!isset($tipo)) |
1507 | 1500 | {$tipo = "nenhum";} |
1508 | - $cp->set_data(iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,false)); | |
1501 | + $retorno = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,false); | |
1509 | 1502 | break; |
1510 | 1503 | /* |
1511 | 1504 | Property: graficotema |
... | ... | @@ -1536,8 +1529,7 @@ Include: |
1536 | 1529 | //$_SESSION["utilizacgi"] = "nao"; |
1537 | 1530 | //$utilizacgi = "nao"; |
1538 | 1531 | restauraCon($map_file,$postgis_mapa); |
1539 | - $cp->register('fusaoGrafico'); | |
1540 | - $cp->start(); | |
1532 | + $retorno = fusaoGrafico(); | |
1541 | 1533 | break; |
1542 | 1534 | /* |
1543 | 1535 | Property: graficoestrela |
... | ... | @@ -1549,8 +1541,7 @@ Include: |
1549 | 1541 | */ |
1550 | 1542 | case "graficoestrela": |
1551 | 1543 | include_once("graficos.php"); |
1552 | - $cp->register('graficoEstrela'); | |
1553 | - $cp->start(); | |
1544 | + $retorno = graficoEstrela(); | |
1554 | 1545 | break; |
1555 | 1546 | /* |
1556 | 1547 | Property: graficoscatter |
... | ... | @@ -1562,8 +1553,7 @@ Include: |
1562 | 1553 | */ |
1563 | 1554 | case "graficoscatter": |
1564 | 1555 | include_once("graficos.php"); |
1565 | - $cp->register('graficoScatter'); | |
1566 | - $cp->start(); | |
1556 | + $retorno = graficoScatter(); | |
1567 | 1557 | break; |
1568 | 1558 | /* |
1569 | 1559 | Property: graficoscatterbins |
... | ... | @@ -1575,8 +1565,7 @@ Include: |
1575 | 1565 | */ |
1576 | 1566 | case "graficoscatterbins": |
1577 | 1567 | include_once("graficos.php"); |
1578 | - $cp->register('graficoScatterBins'); | |
1579 | - $cp->start(); | |
1568 | + $retorno = graficoScatterBins(); | |
1580 | 1569 | break; |
1581 | 1570 | /* |
1582 | 1571 | Property: graficolinhas |
... | ... | @@ -1588,8 +1577,7 @@ Include: |
1588 | 1577 | */ |
1589 | 1578 | case "graficolinhas": |
1590 | 1579 | include_once("graficos.php"); |
1591 | - $cp->register('graficoLinhas'); | |
1592 | - $cp->start(); | |
1580 | + $retorno = graficoLinhas(); | |
1593 | 1581 | break; |
1594 | 1582 | /* |
1595 | 1583 | Property: graficohist |
... | ... | @@ -1601,8 +1589,7 @@ Include: |
1601 | 1589 | */ |
1602 | 1590 | case "graficohist": |
1603 | 1591 | include_once("graficos.php"); |
1604 | - $cp->register('graficoHist'); | |
1605 | - $cp->start(); | |
1592 | + $retorno = graficoHist(); | |
1606 | 1593 | break; |
1607 | 1594 | /* |
1608 | 1595 | Property: graficobarras |
... | ... | @@ -1614,8 +1601,7 @@ Include: |
1614 | 1601 | */ |
1615 | 1602 | case "graficobarras": |
1616 | 1603 | include_once("graficos.php"); |
1617 | - $cp->register('graficoBarras'); | |
1618 | - $cp->start(); | |
1604 | + $retorno = graficoBarras(); | |
1619 | 1605 | break; |
1620 | 1606 | /* |
1621 | 1607 | Property: graficopizza |
... | ... | @@ -1627,8 +1613,7 @@ Include: |
1627 | 1613 | */ |
1628 | 1614 | case "graficopizza": |
1629 | 1615 | include_once("graficos.php"); |
1630 | - $cp->register('graficoPizza'); | |
1631 | - $cp->start(); | |
1616 | + $retorno = graficoPizza(); | |
1632 | 1617 | break; |
1633 | 1618 | /* |
1634 | 1619 | Section: Menu de temas |
... | ... | @@ -1651,7 +1636,7 @@ Pega a lista de tags registrados nos menus de temas. |
1651 | 1636 | } |
1652 | 1637 | include_once("classe_menutemas.php"); |
1653 | 1638 | $m = new Menutemas($map_file,$perfil,$locsistemas,$locaplic,$menutemas,$urli3geo); |
1654 | - $cp->set_data($m->listatags($rss,$nrss)); | |
1639 | + $retorno = $m->listatags($rss,$nrss); | |
1655 | 1640 | break; |
1656 | 1641 | /* |
1657 | 1642 | Property: pegalistademenus |
... | ... | @@ -1670,7 +1655,7 @@ Parametros: |
1670 | 1655 | } |
1671 | 1656 | include_once("classe_menutemas.php"); |
1672 | 1657 | $m = new Menutemas($map_file,$perfil,$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); |
1673 | - $cp->set_data($m->pegaListaDeMenus()); | |
1658 | + $retorno = $m->pegaListaDeMenus(); | |
1674 | 1659 | break; |
1675 | 1660 | /* |
1676 | 1661 | Property: pegalistadegrupos |
... | ... | @@ -1703,7 +1688,7 @@ Include: |
1703 | 1688 | if(!isset($idmenu)){$idmenu="";} |
1704 | 1689 | if(!isset($listasistemas)){$listasistemas="nao";} |
1705 | 1690 | if(!isset($listasgrupos)){$listasgrupos="nao";} |
1706 | - $cp->set_data(array("idmenu"=>$idmenu,"grupos"=>$m->pegaListaDeGrupos($idmenu,$listasistemas,$listasgrupos))); | |
1691 | + $retorno = array("idmenu"=>$idmenu,"grupos"=>$m->pegaListaDeGrupos($idmenu,$listasistemas,$listasgrupos)); | |
1707 | 1692 | break; |
1708 | 1693 | /* |
1709 | 1694 | Property: pegaSistemas |
... | ... | @@ -1720,7 +1705,7 @@ Pega a lista de sistemas. |
1720 | 1705 | } |
1721 | 1706 | include_once("classe_menutemas.php"); |
1722 | 1707 | $m = new Menutemas($map_file,$perfil,$locsistemas,$locaplic,"","",$editores); |
1723 | - $cp->set_data($m->pegaSistemas()); | |
1708 | + $retorno = $m->pegaSistemas(); | |
1724 | 1709 | break; |
1725 | 1710 | |
1726 | 1711 | /* |
... | ... | @@ -1742,7 +1727,7 @@ Include: |
1742 | 1727 | include_once("classe_menutemas.php"); |
1743 | 1728 | $m = new Menutemas($map_file,$perfil,$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); |
1744 | 1729 | if(!isset($idmenu)){$idmenu = "";} |
1745 | - $cp->set_data($m->pegaListaDeSubGrupos($grupo,$idmenu)); | |
1730 | + $retorno = $m->pegaListaDeSubGrupos($grupo,$idmenu); | |
1746 | 1731 | break; |
1747 | 1732 | /* |
1748 | 1733 | Property: pegalistadetemas |
... | ... | @@ -1763,7 +1748,7 @@ Include: |
1763 | 1748 | include_once("classe_menutemas.php"); |
1764 | 1749 | $m = new Menutemas($map_file,$perfil,$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); |
1765 | 1750 | if(!isset($idmenu)){$idmenu = "";} |
1766 | - $cp->set_data(array("temas"=>$m->pegaListaDeTemas($grupo,$subgrupo,$idmenu))); | |
1751 | + $retorno = array("temas"=>$m->pegaListaDeTemas($grupo,$subgrupo,$idmenu)); | |
1767 | 1752 | break; |
1768 | 1753 | /* |
1769 | 1754 | Property: procurartemas |
... | ... | @@ -1783,7 +1768,7 @@ Include: |
1783 | 1768 | } |
1784 | 1769 | include_once("classe_menutemas.php"); |
1785 | 1770 | $m = new Menutemas($map_file,$perfil,$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); |
1786 | - $cp->set_data($m->procurartemas($procurar)); | |
1771 | + $retorno = $m->procurartemas($procurar); | |
1787 | 1772 | break; |
1788 | 1773 | /* |
1789 | 1774 | Property: pegaMapas |
... | ... | @@ -1805,7 +1790,7 @@ Include: |
1805 | 1790 | {include_once($locaplic."/ms_configura.php");} |
1806 | 1791 | } |
1807 | 1792 | $m = new Menutemas($map_file,$perfil,$locsistemas,$locaplic,$menutemas,$urli3geo); |
1808 | - $cp->set_data($m->pegaListaDeMapas($locmapas)); | |
1793 | + $retorno = $m->pegaListaDeMapas($locmapas); | |
1809 | 1794 | break; |
1810 | 1795 | /* |
1811 | 1796 | Section: Webservices |
... | ... | @@ -1819,7 +1804,7 @@ Lista os canais de um georss. |
1819 | 1804 | |
1820 | 1805 | */ |
1821 | 1806 | case "georssCanais": |
1822 | - $cp->set_data(georssCanais($servico,$map_file,$dir_tmp,$locaplic)); | |
1807 | + $retorno = georssCanais($servico,$map_file,$dir_tmp,$locaplic); | |
1823 | 1808 | break; |
1824 | 1809 | /* |
1825 | 1810 | Property: getcapabilities |
... | ... | @@ -1831,9 +1816,8 @@ Include: |
1831 | 1816 | */ |
1832 | 1817 | case "getcapabilities": |
1833 | 1818 | include_once("wmswfs.php"); |
1834 | - $cp->register('getcapabilities'); | |
1819 | + $retorno = getcapabilities(); | |
1835 | 1820 | restauraCon($map_file,$postgis_mapa); |
1836 | - $cp->start(); | |
1837 | 1821 | break; |
1838 | 1822 | /* |
1839 | 1823 | Property: getcapabilities2 |
... | ... | @@ -1845,9 +1829,8 @@ Include: |
1845 | 1829 | */ |
1846 | 1830 | case "getcapabilities2": |
1847 | 1831 | include_once("wmswfs.php"); |
1848 | - $cp->register('getcapabilities2'); | |
1832 | + $retorno = getcapabilities2(); | |
1849 | 1833 | restauraCon($map_file,$postgis_mapa); |
1850 | - $cp->start(); | |
1851 | 1834 | break; |
1852 | 1835 | /* |
1853 | 1836 | Property: getcapabilities3 |
... | ... | @@ -1859,9 +1842,8 @@ Include: |
1859 | 1842 | */ |
1860 | 1843 | case "getcapabilities3": |
1861 | 1844 | include_once("wmswfs.php"); |
1862 | - $cp->register('getcapabilities3'); | |
1845 | + $retorno = getcapabilities3(); | |
1863 | 1846 | restauraCon($map_file,$postgis_mapa); |
1864 | - $cp->start(); | |
1865 | 1847 | break; |
1866 | 1848 | /* |
1867 | 1849 | Property: temaswms |
... | ... | @@ -1874,8 +1856,7 @@ Include: |
1874 | 1856 | case "temaswms": |
1875 | 1857 | include_once("wmswfs.php"); |
1876 | 1858 | restauraCon($map_file,$postgis_mapa); |
1877 | - $cp->register('temaswms'); | |
1878 | - $cp->start(); | |
1859 | + $retorno = temaswms(); | |
1879 | 1860 | break; |
1880 | 1861 | /* |
1881 | 1862 | Property: listaLayersWMS |
... | ... | @@ -1887,8 +1868,7 @@ Include: |
1887 | 1868 | */ |
1888 | 1869 | case "listaLayersWMS": |
1889 | 1870 | include_once("wmswfs.php"); |
1890 | - $cp->register('listaLayersWMS'); | |
1891 | - $cp->start(); | |
1871 | + $retorno = listaLayersWMS(); | |
1892 | 1872 | break; |
1893 | 1873 | /* |
1894 | 1874 | Section: Atributos |
... | ... | @@ -1904,7 +1884,7 @@ Include: |
1904 | 1884 | <classe_atributos.php> |
1905 | 1885 | */ |
1906 | 1886 | case "buscaRapida": |
1907 | - $cp->set_data(buscaRapida($servico,$palavra)); | |
1887 | + $retorno = buscaRapida($servico,$palavra); | |
1908 | 1888 | break; |
1909 | 1889 | /* |
1910 | 1890 | Property: listaitens |
... | ... | @@ -1917,7 +1897,7 @@ Include: |
1917 | 1897 | case "listaitens": |
1918 | 1898 | include_once("classe_atributos.php"); |
1919 | 1899 | $m = new Atributos($map_file,$tema); |
1920 | - $cp->set_data($m->listaItens()); | |
1900 | + $retorno = $m->listaItens(); | |
1921 | 1901 | break; |
1922 | 1902 | /* |
1923 | 1903 | Property: listavaloresitens |
... | ... | @@ -1931,7 +1911,7 @@ Include: |
1931 | 1911 | include_once("classe_atributos.php"); |
1932 | 1912 | if(!isset($tema)){$tema = "";} |
1933 | 1913 | $m = new Atributos($map_file,$tema); |
1934 | - $cp->set_data($m->buscaRegistros($palavra,$lista,$tipo,$onde)); | |
1914 | + $retorno = $m->buscaRegistros($palavra,$lista,$tipo,$onde); | |
1935 | 1915 | break; |
1936 | 1916 | /* |
1937 | 1917 | Property: identifica |
... | ... | @@ -1948,7 +1928,7 @@ Include: |
1948 | 1928 | if (!isset($resolucao)){$resolucao = 5;} |
1949 | 1929 | include_once("classe_atributos.php"); |
1950 | 1930 | $m = new Atributos($map_file,$tema); |
1951 | - $cp->set_data($m->identifica($opcao,$xy,$resolucao)); | |
1931 | + $retorno = $m->identifica($opcao,$xy,$resolucao); | |
1952 | 1932 | break; |
1953 | 1933 | /* |
1954 | 1934 | Property: identifica2 |
... | ... | @@ -1963,7 +1943,7 @@ Include: |
1963 | 1943 | if (!isset($resolucao)){$resolucao = 5;} |
1964 | 1944 | include_once("classe_atributos.php"); |
1965 | 1945 | $m = new Atributos($map_file,$tema); |
1966 | - $cp->set_data($m->identifica2($opcao,$xy,$resolucao)); | |
1946 | + $retorno = $m->identifica2($opcao,$xy,$resolucao); | |
1967 | 1947 | break; |
1968 | 1948 | |
1969 | 1949 | /* |
... | ... | @@ -1979,7 +1959,7 @@ Include: |
1979 | 1959 | include_once("classe_atributos.php"); |
1980 | 1960 | $m = new Atributos($map_file,$tema); |
1981 | 1961 | $xy = explode(",",$xy); |
1982 | - $cp->set_data($m->identificaQBP($tema,$xy[0],$xy[1],$map_file,$resolucao,$item,$tiporetorno="unico")); | |
1962 | + $retorno = $m->identificaQBP($tema,$xy[0],$xy[1],$map_file,$resolucao,$item,$tiporetorno="unico"); | |
1983 | 1963 | break; |
1984 | 1964 | /* |
1985 | 1965 | Property: estatistica |
... | ... | @@ -1992,7 +1972,7 @@ Include: |
1992 | 1972 | case "estatistica": |
1993 | 1973 | include_once("classe_atributos.php"); |
1994 | 1974 | $m = new Atributos($map_file,$tema); |
1995 | - $cp->set_data($m->estatDescritivas($item,$exclui)); | |
1975 | + $retorno = $m->estatDescritivas($item,$exclui); | |
1996 | 1976 | break; |
1997 | 1977 | /* |
1998 | 1978 | Property: listatexto |
... | ... | @@ -2005,7 +1985,7 @@ Include: |
2005 | 1985 | case "listatexto": |
2006 | 1986 | include_once("classe_atributos.php"); |
2007 | 1987 | $m = new Atributos($map_file,$tema); |
2008 | - $cp->set_data($m->itensTexto($tipo)); | |
1988 | + $retorno = $m->itensTexto($tipo); | |
2009 | 1989 | break; |
2010 | 1990 | /* |
2011 | 1991 | Property: listaregistros |
... | ... | @@ -2023,7 +2003,8 @@ Include: |
2023 | 2003 | if(!isset($fim)){$fim = "";} |
2024 | 2004 | if(!isset($tipolista)){$tipolista = "";} |
2025 | 2005 | if(!isset($itemtema)){$itemtema = "";} |
2026 | - $cp->set_data($m->listaRegistros($itemtema,$tipo,"",$inicio,$fim,$tipolista)); | |
2006 | + //$cp->set_data($m->listaRegistros($itemtema,$tipo,"",$inicio,$fim,$tipolista)); | |
2007 | + $retorno = $m->listaRegistros($itemtema,$tipo,"",$inicio,$fim,$tipolista); | |
2027 | 2008 | break; |
2028 | 2009 | /* |
2029 | 2010 | Property: extregistros |
... | ... | @@ -2036,7 +2017,7 @@ Include: |
2036 | 2017 | case "extregistros": |
2037 | 2018 | include_once("classe_atributos.php"); |
2038 | 2019 | $m = new Atributos($map_file,$tema); |
2039 | - $cp->set_data($m->extensaoRegistro($registro)); | |
2020 | + $retorno = $m->extensaoRegistro($registro); | |
2040 | 2021 | $m->salva(); |
2041 | 2022 | break; |
2042 | 2023 | /* |
... | ... | @@ -2051,7 +2032,7 @@ Retorna coordenadas utm a partir de coordenadas geo |
2051 | 2032 | */ |
2052 | 2033 | case "geo2utm": |
2053 | 2034 | $zona = geo2zonaUTM($x); |
2054 | - $cp->set_data(geo2utm($x,$y,$zona)); | |
2035 | + $retorno = geo2utm($x,$y,$zona); | |
2055 | 2036 | break; |
2056 | 2037 | /* |
2057 | 2038 | Property: desativacgi |
... | ... | @@ -2061,7 +2042,7 @@ Desativa o modo cgi. |
2061 | 2042 | */ |
2062 | 2043 | case "desativacgi": |
2063 | 2044 | $_SESSION["utilizacgi"] = "nao"; |
2064 | - $cp->set_data($_SESSION["utilizacgi"]); | |
2045 | + $retorno = $_SESSION["utilizacgi"]; | |
2065 | 2046 | break; |
2066 | 2047 | |
2067 | 2048 | /* |
... | ... | @@ -2159,7 +2140,7 @@ Include: |
2159 | 2140 | $m = new Navegacao($map_file); |
2160 | 2141 | $m->aplicaResolucao($resolucao); |
2161 | 2142 | //$m->desabilitaRASTER(); |
2162 | - $cp->set_data(($m->mapa->width).",".($m->mapa->height).",".$m->gravaImagemCorpo()); | |
2143 | + $retorno = ($m->mapa->width).",".($m->mapa->height).",".$m->gravaImagemCorpo(); | |
2163 | 2144 | break; |
2164 | 2145 | /* |
2165 | 2146 | Property: localizaIP |
... | ... | @@ -2180,7 +2161,7 @@ Include: |
2180 | 2161 | $ip = pegaIPcliente2(); |
2181 | 2162 | $r = ip2geo($ip); |
2182 | 2163 | } |
2183 | - $cp->set_data($r); | |
2164 | + $retorno = $r; | |
2184 | 2165 | break; |
2185 | 2166 | |
2186 | 2167 | /* |
... | ... | @@ -2223,33 +2204,33 @@ Include: |
2223 | 2204 | $m = new Legenda($map_file,$locaplic,$tema); |
2224 | 2205 | if ($opcao == "excluiestilo") |
2225 | 2206 | { |
2226 | - $cp->set_data($m->excluiEstilo($classe,$estilo)); | |
2207 | + $retorno = $m->excluiEstilo($classe,$estilo); | |
2227 | 2208 | $m->salva(); |
2228 | 2209 | } |
2229 | 2210 | if ($opcao == "adicionaestilo") |
2230 | 2211 | { |
2231 | - $cp->set_data($m->adicionaEstilo($classe,$estilo)); | |
2212 | + $retorno = $m->adicionaEstilo($classe,$estilo); | |
2232 | 2213 | $m->salva(); |
2233 | 2214 | } |
2234 | 2215 | if ($opcao == "sobeestilo") |
2235 | 2216 | { |
2236 | - $cp->set_data($m->sobeEstilo ($classe,$estilo)); | |
2217 | + $retorno = $m->sobeEstilo ($classe,$estilo); | |
2237 | 2218 | $m->salva(); |
2238 | 2219 | } |
2239 | 2220 | if ($opcao == "desceestilo") |
2240 | 2221 | { |
2241 | - $cp->set_data($m->desceEstilo ($classe,$estilo)); | |
2222 | + $retorno = $m->desceEstilo ($classe,$estilo); | |
2242 | 2223 | $m->salva(); |
2243 | 2224 | } |
2244 | 2225 | if ($opcao == "aplica") |
2245 | 2226 | { |
2246 | - $cp->set_data($m->aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size)); | |
2227 | + $retorno = $m->aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size); | |
2247 | 2228 | $m->salva(); |
2248 | 2229 | } |
2249 | 2230 | if ($opcao == "listaSimbolos") |
2250 | - {$cp->set_data($m->listaSimbolos($tipo,$dir_tmp,$imgdir,$onclick));} | |
2231 | + {$retorno = $m->listaSimbolos($tipo,$dir_tmp,$imgdir,$onclick);} | |
2251 | 2232 | if ($opcao == "pegaparametros") |
2252 | - {$cp->set_data($m->pegaParametros($classe));} | |
2233 | + {$retorno = $m->pegaParametros($classe);} | |
2253 | 2234 | break; |
2254 | 2235 | /* |
2255 | 2236 | Property: editalegenda |
... | ... | @@ -2264,7 +2245,7 @@ Include: |
2264 | 2245 | $m = new Legenda($map_file,$locaplic,$tema); |
2265 | 2246 | $r = $m->tabelaLegenda(); |
2266 | 2247 | if (!$r){$r = "erro.Erro legenda nao disponivel";} |
2267 | - $cp->set_data($r); | |
2248 | + $retorno = $r; | |
2268 | 2249 | break; |
2269 | 2250 | /* |
2270 | 2251 | Property: criaLegendaHTML |
... | ... | @@ -2281,7 +2262,7 @@ Include: |
2281 | 2262 | $m = new Legenda($map_file,$locaplic,$tema,$templateLegenda); |
2282 | 2263 | $r = $m->criaLegenda(); |
2283 | 2264 | if(!$r){$r = "erro. Legenda nao disponivel";} |
2284 | - $cp->set_data($r); | |
2265 | + $retorno = $r; | |
2285 | 2266 | break; |
2286 | 2267 | /* |
2287 | 2268 | Property: testaLegenda |
... | ... | @@ -2296,7 +2277,7 @@ Include: |
2296 | 2277 | copy($map_file,str_replace(".map","testeleg.map",$map_file)); |
2297 | 2278 | $m = new Legenda(str_replace(".map","testeleg.map",$map_file)); |
2298 | 2279 | $m->aplicaParametrosLegImg($fonte,$imagecolor,$position,$status,$outlinecolor,$keyspacingy,$keyspacingx,$keysizey,$keysizex,$height,$width,$labelsize); |
2299 | - $cp->set_data($m->legendaGrafica()); | |
2280 | + $retorno = $m->legendaGrafica(); | |
2300 | 2281 | break; |
2301 | 2282 | /* |
2302 | 2283 | Property: contagemclasse |
... | ... | @@ -2311,7 +2292,7 @@ Include: |
2311 | 2292 | $m = new Legenda($map_file,$locaplic,$tema); |
2312 | 2293 | $r = $m->tabelaLegenda("sim"); |
2313 | 2294 | if (!$r){$r = "erro.Erro legenda nao disponivel";} |
2314 | - $cp->set_data($r); | |
2295 | + $retorno = $r; | |
2315 | 2296 | break; |
2316 | 2297 | /* |
2317 | 2298 | Property: criaLegendaImagem |
... | ... | @@ -2324,7 +2305,7 @@ Include: |
2324 | 2305 | case "criaLegendaImagem": |
2325 | 2306 | include_once("classe_legenda.php"); |
2326 | 2307 | $m = new Legenda($map_file); |
2327 | - $cp->set_data($m->legendaGrafica()); | |
2308 | + $retorno = $m->legendaGrafica(); | |
2328 | 2309 | break; |
2329 | 2310 | /* |
2330 | 2311 | Property: pegaParametrosLegImg |
... | ... | @@ -2337,7 +2318,7 @@ Include: |
2337 | 2318 | case "pegaParametrosLegImg": |
2338 | 2319 | include_once("classe_legenda.php"); |
2339 | 2320 | $m = new Legenda($map_file); |
2340 | - $cp->set_data($m->pegaParametrosLegImg()); | |
2321 | + $retorno = $m->pegaParametrosLegImg(); | |
2341 | 2322 | break; |
2342 | 2323 | /* |
2343 | 2324 | Property: aplicaParametrosLegImg |
... | ... | @@ -2358,7 +2339,7 @@ Include: |
2358 | 2339 | $utilizacgi = "nao"; |
2359 | 2340 | } |
2360 | 2341 | $m = new Legenda($map_file); |
2361 | - $cp->set_data($m->aplicaParametrosLegImg($fonte,$imagecolor,$position,$status,$outlinecolor,$keyspacingy,$keyspacingx,$keysizey,$keysizex,$height,$width,$labelsize)); | |
2342 | + $retorno = $m->aplicaParametrosLegImg($fonte,$imagecolor,$position,$status,$outlinecolor,$keyspacingy,$keyspacingx,$keysizey,$keysizex,$height,$width,$labelsize); | |
2362 | 2343 | $m->salva(); |
2363 | 2344 | break; |
2364 | 2345 | /* |
... | ... | @@ -2377,7 +2358,7 @@ Include: |
2377 | 2358 | case "escalagrafica": |
2378 | 2359 | include_once("classe_escala.php"); |
2379 | 2360 | $m = new Escala($map_file); |
2380 | - $cp->set_data($m->retornaBarraEscala()); | |
2361 | + $retorno = $m->retornaBarraEscala(); | |
2381 | 2362 | break; |
2382 | 2363 | /* |
2383 | 2364 | Property: testaescalagrafica |
... | ... | @@ -2390,7 +2371,7 @@ Include: |
2390 | 2371 | case "testaescalagrafica": |
2391 | 2372 | include_once("classe_escala.php"); |
2392 | 2373 | $m = new Escala($map_file); |
2393 | - $cp->set_data($m->testaescalagrafica($w,$h,$estilo,$intervalos,$unidade,$cor,$bcor,$ocor)); | |
2374 | + $retorno = $m->testaescalagrafica($w,$h,$estilo,$intervalos,$unidade,$cor,$bcor,$ocor); | |
2394 | 2375 | break; |
2395 | 2376 | /* |
2396 | 2377 | Property: escalaparametros |
... | ... | @@ -2403,7 +2384,7 @@ Include: |
2403 | 2384 | case "escalaparametros": |
2404 | 2385 | include_once("classe_escala.php"); |
2405 | 2386 | $m = new Escala($map_file); |
2406 | - $cp->set_data($m->parametrosBarraEscala()); | |
2387 | + $retorno = $m->parametrosBarraEscala(); | |
2407 | 2388 | break; |
2408 | 2389 | /* |
2409 | 2390 | Property: mudaescalagrafica |
... | ... | @@ -2417,7 +2398,7 @@ Include: |
2417 | 2398 | include_once("classe_escala.php"); |
2418 | 2399 | copiaSeguranca($map_file); |
2419 | 2400 | $m = new Escala($map_file); |
2420 | - $cp->set_data($m->mudaEscalaGrafica($w,$h,$estilo,$intervalos,$unidade,$cor,$bcor,$ocor)); | |
2401 | + $retorno = $m->mudaEscalaGrafica($w,$h,$estilo,$intervalos,$unidade,$cor,$bcor,$ocor); | |
2421 | 2402 | break; |
2422 | 2403 | /* |
2423 | 2404 | Section: Seleção |
... | ... | @@ -2442,7 +2423,7 @@ Include: |
2442 | 2423 | $m = new Selecao($map_file,$tema); |
2443 | 2424 | $ok[] = $m->selecaoPT($xy,$tipo,$tolerancia); |
2444 | 2425 | } |
2445 | - $cp->set_data(implode(",",$ok)); | |
2426 | + $retorno = implode(",",$ok); | |
2446 | 2427 | break; |
2447 | 2428 | /* |
2448 | 2429 | Property: selecaoext |
... | ... | @@ -2461,7 +2442,7 @@ Include: |
2461 | 2442 | $m = new Selecao($map_file,$tema); |
2462 | 2443 | $ok[] = $m->selecaoEXT($tipo); |
2463 | 2444 | } |
2464 | - $cp->set_data(implode(",",$ok)); | |
2445 | + $retorno = implode(",",$ok); | |
2465 | 2446 | break; |
2466 | 2447 | /* |
2467 | 2448 | Property: selecaobox |
... | ... | @@ -2480,7 +2461,7 @@ Include: |
2480 | 2461 | $m = new Selecao($map_file,$tema); |
2481 | 2462 | $ok[] = $m->selecaoBOX($tipo,$ext); |
2482 | 2463 | } |
2483 | - $cp->set_data(implode(",",$ok)); | |
2464 | + $retorno = implode(",",$ok); | |
2484 | 2465 | break; |
2485 | 2466 | |
2486 | 2467 | /* |
... | ... | @@ -2495,7 +2476,7 @@ Include: |
2495 | 2476 | include_once("classe_selecao.php"); |
2496 | 2477 | copiaSeguranca($map_file); |
2497 | 2478 | $m = new Selecao($map_file,$tema); |
2498 | - $cp->set_data($m->selecaoAtributos($tipo,$item,$operador,$valor)); | |
2479 | + $retorno = $m->selecaoAtributos($tipo,$item,$operador,$valor); | |
2499 | 2480 | break; |
2500 | 2481 | /* |
2501 | 2482 | Property: selecaoatrib2 |
... | ... | @@ -2509,7 +2490,7 @@ Include: |
2509 | 2490 | include_once("classe_selecao.php"); |
2510 | 2491 | copiaSeguranca($map_file); |
2511 | 2492 | $m = new Selecao($map_file,$tema); |
2512 | - $cp->set_data($m->selecaoAtributos2($filtro,$tipo)); | |
2493 | + $retorno = $m->selecaoAtributos2($filtro,$tipo); | |
2513 | 2494 | break; |
2514 | 2495 | /* |
2515 | 2496 | Property: selecaotema |
... | ... | @@ -2528,7 +2509,7 @@ Include: |
2528 | 2509 | $m = new Selecao($map_file,$tema); |
2529 | 2510 | $ok[] = $m->selecaoTema($temao,$tipo); |
2530 | 2511 | } |
2531 | - $cp->set_data(implode(",",$ok)); | |
2512 | + $retorno = implode(",",$ok); | |
2532 | 2513 | break; |
2533 | 2514 | /* |
2534 | 2515 | Property: selecaoPoli |
... | ... | @@ -2542,10 +2523,8 @@ Include: |
2542 | 2523 | //esta operação é chamada com POST via cpaint |
2543 | 2524 | //por isso precisa ser executada com start |
2544 | 2525 | copiaSeguranca($map_file); |
2545 | - $cp->register('selecaoPoli'); | |
2546 | - $cp->start(); | |
2526 | + $retorno = selecaoPoli(); | |
2547 | 2527 | restauraCon($map_file,$postgis_mapa); |
2548 | - $cp->return_data(); | |
2549 | 2528 | break; |
2550 | 2529 | /* |
2551 | 2530 | Property: limpasel |
... | ... | @@ -2558,7 +2537,7 @@ Include: |
2558 | 2537 | case "limpasel": |
2559 | 2538 | include_once("classe_selecao.php"); |
2560 | 2539 | $m = new Selecao($map_file,$tema); |
2561 | - $cp->set_data($m->selecaoLimpa()); | |
2540 | + $retorno = $m->selecaoLimpa(); | |
2562 | 2541 | break; |
2563 | 2542 | /* |
2564 | 2543 | Property: incluisel |
... | ... | @@ -2571,7 +2550,7 @@ Include: |
2571 | 2550 | case "incluisel": |
2572 | 2551 | include_once("classe_selecao.php"); |
2573 | 2552 | $m = new Selecao($map_file,$tema); |
2574 | - $cp->set_data($m->incluiSel($ids)); | |
2553 | + $retorno = $m->incluiSel($ids); | |
2575 | 2554 | break; |
2576 | 2555 | /* |
2577 | 2556 | Property: criatemasel |
... | ... | @@ -2585,7 +2564,7 @@ Include: |
2585 | 2564 | include_once("classe_selecao.php"); |
2586 | 2565 | copiaSeguranca($map_file); |
2587 | 2566 | $m = new Selecao($map_file,$tema); |
2588 | - $cp->set_data($m->selecao2tema($locaplic,$dir_tmp)); | |
2567 | + $retorno = $m->selecao2tema($locaplic,$dir_tmp); | |
2589 | 2568 | $m->salva(); |
2590 | 2569 | break; |
2591 | 2570 | /* |
... | ... | @@ -2606,7 +2585,7 @@ Include: |
2606 | 2585 | copiaSeguranca($map_file); |
2607 | 2586 | $m = new Toponimia($map_file,$tema); |
2608 | 2587 | if(!isset($tipo)){$tipo="";} |
2609 | - $cp->set_data($m->criaToponimia($item,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$tipo)); | |
2588 | + $retorno = $m->criaToponimia($item,$position,$partials,$offsetx,$offsety,$minfeaturesize,$mindistance,$force,$shadowcolor,$shadowsizex,$shadowsizey,$outlinecolor,$cor,$sombray,$sombrax,$sombra,$fundo,$angulo,$tamanho,$fonte,$tipo); | |
2610 | 2589 | if ($tipo != "teste") |
2611 | 2590 | {$m->salva();} |
2612 | 2591 | break; |
... | ... | @@ -2622,7 +2601,7 @@ Include: |
2622 | 2601 | include_once("classe_toponimia.php"); |
2623 | 2602 | copiaSeguranca($map_file); |
2624 | 2603 | $m = new Toponimia($map_file,$tema); |
2625 | - $cp->set_data($m->ativaEtiquetas($item)); | |
2604 | + $retorno = $m->ativaEtiquetas($item); | |
2626 | 2605 | $m->salva(); |
2627 | 2606 | break; |
2628 | 2607 | /* |
... | ... | @@ -2637,7 +2616,7 @@ Include: |
2637 | 2616 | include_once("classe_toponimia.php"); |
2638 | 2617 | copiaSeguranca($map_file); |
2639 | 2618 | $m = new Toponimia($map_file,$tema); |
2640 | - $cp->set_data($m->removeEtiquetas()); | |
2619 | + $retorno = $m->removeEtiquetas(); | |
2641 | 2620 | $m->salva(); |
2642 | 2621 | break; |
2643 | 2622 | /* |
... | ... | @@ -2649,9 +2628,8 @@ Include: |
2649 | 2628 | <classe_toponimia.php> |
2650 | 2629 | */ |
2651 | 2630 | case "listatruetype": |
2652 | - $cp->register('listaTrueType'); | |
2631 | + $retorno = listaTrueType(); | |
2653 | 2632 | restauraCon($map_file,$postgis_mapa); |
2654 | - $cp->start(); | |
2655 | 2633 | break; |
2656 | 2634 | /* |
2657 | 2635 | Section: Outros |
... | ... | @@ -2668,7 +2646,7 @@ Parameter: |
2668 | 2646 | celsize - tamanho de cada pixel em dd |
2669 | 2647 | */ |
2670 | 2648 | case "areaPixel": |
2671 | - $cp->set_data(calculaAreaPixel($map_file,$celsize)); | |
2649 | + $retorno = calculaAreaPixel($map_file,$celsize); | |
2672 | 2650 | break; |
2673 | 2651 | /* |
2674 | 2652 | Property: listaEpsg |
... | ... | @@ -2677,7 +2655,7 @@ Pega os códigos de projeção EPSG. |
2677 | 2655 | |
2678 | 2656 | */ |
2679 | 2657 | case "listaEpsg": |
2680 | - $cp->set_data(listaEpsg()); | |
2658 | + $retorno = listaEpsg(); | |
2681 | 2659 | break; |
2682 | 2660 | /* |
2683 | 2661 | Property: listaDiretorios |
... | ... | @@ -2686,7 +2664,7 @@ Lista os diretórios de um diretório. |
2686 | 2664 | |
2687 | 2665 | */ |
2688 | 2666 | case "listaDiretorios": |
2689 | - $cp->set_data(listaDiretorios($diretorio)); | |
2667 | + $retorno = listaDiretorios($diretorio); | |
2690 | 2668 | break; |
2691 | 2669 | /* |
2692 | 2670 | Property: listaArquivos* |
... | ... | @@ -2694,14 +2672,15 @@ Property: listaArquivos* |
2694 | 2672 | Lista os arquivos de um diretório. |
2695 | 2673 | */ |
2696 | 2674 | case "listaArquivos": |
2697 | - $cp->set_data(listaArquivos($diretorio)); | |
2675 | + $retorno = listaArquivos($diretorio); | |
2698 | 2676 | break; |
2699 | 2677 | } |
2700 | 2678 | if (!connection_aborted()) |
2701 | 2679 | { |
2702 | 2680 | if(isset($map_file) && isset($postgis_mapa) && $map_file != "") |
2703 | 2681 | restauraCon($map_file,$postgis_mapa); |
2704 | - $cp->return_data(); | |
2682 | + //$cp->return_data(); | |
2683 | + cpjson($retorno); | |
2705 | 2684 | } |
2706 | 2685 | else |
2707 | 2686 | {exit();} |
... | ... | @@ -2715,7 +2694,7 @@ Include: |
2715 | 2694 | */ |
2716 | 2695 | function alteraclassesPost($ids,$nomes,$exps) |
2717 | 2696 | { |
2718 | - global $map_file,$tema,$cp; | |
2697 | + global $map_file,$tema; | |
2719 | 2698 | $m = new Alteraclasse($map_file,$tema); |
2720 | 2699 | $m->alteraclasses($ids,$nomes,$exps); |
2721 | 2700 | $m->salva(); |
... | ... | @@ -2730,7 +2709,7 @@ Include: |
2730 | 2709 | */ |
2731 | 2710 | function selecaoPoli($xs,$ys,$tema,$tipo) |
2732 | 2711 | { |
2733 | - global $map_file,$cp; | |
2712 | + global $map_file; | |
2734 | 2713 | include_once("classe_selecao.php"); |
2735 | 2714 | $temas = explode(",",$tema); |
2736 | 2715 | foreach($temas as $tema) |
... | ... | @@ -2739,7 +2718,7 @@ function selecaoPoli($xs,$ys,$tema,$tipo) |
2739 | 2718 | $ok[] = $m->selecaoPorPoligono($tipo,$xs,$ys); |
2740 | 2719 | $m->salva(); |
2741 | 2720 | } |
2742 | - $cp->set_data(implode(",",$ok)); | |
2721 | + return implode(",",$ok); | |
2743 | 2722 | } |
2744 | 2723 | /* |
2745 | 2724 | Function: redesenhaMapa |
... | ... | @@ -2785,8 +2764,9 @@ function redesenhaMapa() |
2785 | 2764 | restauraCon($map_file,$postgis_mapa); |
2786 | 2765 | ob_clean(); |
2787 | 2766 | if (($par == "") || ($imagem == "")) |
2788 | - {$cp->set_data("erro");} | |
2767 | + {$retorno = "erro";} | |
2789 | 2768 | else |
2790 | - {$cp->set_data(array("variaveis"=>($mensagens.";".$imagem.";var tempo=".(microtime(1) - $tempo)),"temas"=>$par));} | |
2769 | + {$retorno = array("variaveis"=>($mensagens.";".$imagem.";var tempo=".(microtime(1) - $tempo)),"temas"=>$par);} | |
2770 | + cpjson($retorno); | |
2791 | 2771 | } |
2792 | 2772 | ?> |
2793 | 2773 | \ No newline at end of file | ... | ... |
classesphp/mapa_inicia.php
... | ... | @@ -79,7 +79,7 @@ Se $expoeMapfile = "nao", o nome do mapfile não é retornado |
79 | 79 | */ |
80 | 80 | function iniciaMapa() |
81 | 81 | { |
82 | - global $mensagemInicia,$kmlurl,$tituloInstituicao,$tempo,$navegadoresLocais,$locaplic,$cp,$embedLegenda,$map_file,$mapext,$w,$h,$locsistemas,$locidentifica,$R_path,$locmapas,$locmapserv,$postgis_con,$utilizacgi,$expoeMapfile,$interface; | |
82 | + global $mensagemInicia,$kmlurl,$tituloInstituicao,$tempo,$navegadoresLocais,$locaplic,$embedLegenda,$map_file,$mapext,$w,$h,$locsistemas,$locidentifica,$R_path,$locmapas,$locmapserv,$postgis_con,$utilizacgi,$expoeMapfile,$interface; | |
83 | 83 | error_reporting(E_ALL); |
84 | 84 | // |
85 | 85 | //pega o xml com os sietmas para identificação |
... | ... | @@ -225,6 +225,7 @@ function iniciaMapa() |
225 | 225 | $res .= "var mensagemInicia ='".$mensagemInicia."';"; |
226 | 226 | copy($map_file,(str_replace(".map","reinc.map",$map_file))); |
227 | 227 | copy($map_file,(str_replace(".map","seguranca.map",$map_file))); |
228 | - $cp->set_data(array("variaveis"=>$res,"temas"=>$temas)); | |
228 | + //$cp->set_data(array("variaveis"=>$res,"temas"=>$temas)); | |
229 | + cpjson(array("variaveis"=>$res,"temas"=>$temas)); | |
229 | 230 | } |
230 | 231 | ?> |
231 | 232 | \ No newline at end of file | ... | ... |
classesphp/wmswfs.php
... | ... | @@ -138,13 +138,11 @@ Chama a função getcapabilities e retorna o resultado. |
138 | 138 | parameters: |
139 | 139 | $servico - Endereço do web service. |
140 | 140 | |
141 | -$cp - Objeto CPAINT. | |
142 | - | |
143 | 141 | $id_ws - id do wms se estiver sendo utilizado o banco de administração do i3geo |
144 | 142 | */ |
145 | 143 | function getcapabilities() |
146 | 144 | { |
147 | - global $servico,$cp,$id_ws; | |
145 | + global $servico,$id_ws; | |
148 | 146 | $teste = explode("=",$servico); |
149 | 147 | if ( count($teste) > 1 ){$servico = $servico."&";} |
150 | 148 | $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&version=1.1.0"; |
... | ... | @@ -157,7 +155,7 @@ function getcapabilities() |
157 | 155 | return; |
158 | 156 | } |
159 | 157 | $wms_capabilities = implode("",$wms_capabilities); |
160 | - $cp->set_data(xml2html($wms_capabilities)); | |
158 | + return(xml2html($wms_capabilities)); | |
161 | 159 | } |
162 | 160 | /* |
163 | 161 | function: getcapabilities2 |
... | ... | @@ -167,11 +165,10 @@ Chama a função getcapabilities e retorna o resultado formatado (WMS). |
167 | 165 | parameters: |
168 | 166 | $servico - Endereço do web service. |
169 | 167 | |
170 | -$cp - Objeto CPAINT. | |
171 | 168 | */ |
172 | 169 | function getcapabilities2() |
173 | 170 | { |
174 | - global $servico,$cp; | |
171 | + global $servico; | |
175 | 172 | $teste = explode("=",$servico); |
176 | 173 | if ( count($teste) > 1 ){$servico = $servico."&";} |
177 | 174 | $wms_service_request = $servico . "REQUEST=GetCapabilities&SERVICE=WMS&version=1.1.0"; |
... | ... | @@ -218,7 +215,7 @@ function getcapabilities2() |
218 | 215 | foreach ($entries as $entry){$temp .= $entry->nodeValue.".";} |
219 | 216 | $retorno .= "<br><br><b>Contato: </b>".$temp; |
220 | 217 | |
221 | - $cp->set_data($retorno); | |
218 | + return($retorno); | |
222 | 219 | } |
223 | 220 | /* |
224 | 221 | function: getcapabilities3 |
... | ... | @@ -229,11 +226,10 @@ parameters: |
229 | 226 | |
230 | 227 | $servico - Endereço do web service. |
231 | 228 | |
232 | -$cp - Objeto CPAINT. | |
233 | 229 | */ |
234 | 230 | function getcapabilities3() |
235 | 231 | { |
236 | - global $servico,$cp; | |
232 | + global $servico; | |
237 | 233 | $teste = explode("=",$servico); |
238 | 234 | if ( count($teste) > 1 ){$servico = $servico."&";} |
239 | 235 | $wms_service_request = $servico . "request=getcapabilities&service=wfs&version=1.0.0"; |
... | ... | @@ -263,7 +259,7 @@ function getcapabilities3() |
263 | 259 | {$temp .= $v->nodeValue;} |
264 | 260 | $retorno .= "<br><br><b>Título: </b>".$temp; |
265 | 261 | } |
266 | - $cp->set_data($retorno); | |
262 | + return($retorno); | |
267 | 263 | } |
268 | 264 | /* |
269 | 265 | function: temaswms |
... | ... | @@ -274,11 +270,10 @@ parameters: |
274 | 270 | |
275 | 271 | $servico - Endereço do web service. |
276 | 272 | |
277 | -$cp - Objeto CPAINT. | |
278 | 273 | */ |
279 | 274 | function temaswms() |
280 | 275 | { |
281 | - global $servico,$cp,$id_ws; | |
276 | + global $servico,$id_ws; | |
282 | 277 | $wms_service_request = gravaCacheWMS($servico); |
283 | 278 | # ------------------------------------------------------------- |
284 | 279 | # Test that the capabilites file has successfully downloaded. |
... | ... | @@ -377,7 +372,7 @@ function temaswms() |
377 | 372 | $retorna[] = "<br>Formatos info:<input size=30 id=formatosinfo type=text class=digitar value='".implode(",",wms_formatsinfo($dom))."'/><br><br>"; |
378 | 373 | $retorna[] = "<br>Versao:<input size=30 id=versao type=text class=digitar value='".(wms_version($dom))."'/><br><br>"; |
379 | 374 | $retorna[] = "<br>Suporta SLD:<input size=30 id=suportasld type=text class=digitar value='".$suporta."'/><br><br><br>"; |
380 | - $cp->set_data(implode($retorna)); | |
375 | + return(implode($retorna)); | |
381 | 376 | } |
382 | 377 | /* |
383 | 378 | function: listaLayersWMS |
... | ... | @@ -388,15 +383,13 @@ parameters: |
388 | 383 | |
389 | 384 | $servico - Endereço do web service. |
390 | 385 | |
391 | -$cp - Objeto CPAINT. | |
392 | - | |
393 | 386 | $nivel - nível do layer na hierarquia existente no getcapabilities (string do tipo |
394 | 387 | |
395 | 388 | $nomelayer - nome do layer que contém os próximos layers |
396 | 389 | */ |
397 | 390 | function listaLayersWMS() |
398 | 391 | { |
399 | - global $servico,$cp,$nivel,$id_ws,$nomelayer; | |
392 | + global $servico,$nivel,$id_ws,$nomelayer; | |
400 | 393 | if(!isset($nomelayer)){$nomelayer = "undefined";} |
401 | 394 | $wms_service_request = gravaCacheWMS($servico); |
402 | 395 | include_once("../admin/php/admin.php"); |
... | ... | @@ -468,7 +461,7 @@ function listaLayersWMS() |
468 | 461 | {$res[] = array("nome"=>$r["nome"],"titulo"=>$r["titulo"],"estilos"=>$r["estilos"],"srs"=>wms_srs($dom),"formats"=>wms_formats($dom),"version"=>wms_version($dom),"formatsinfo"=>wms_formatsinfo($dom));} |
469 | 462 | } |
470 | 463 | } |
471 | - $cp->set_data($res); | |
464 | + return($res); | |
472 | 465 | } |
473 | 466 | |
474 | 467 | function imprimeEstilos($es,$suporta,$retorna,$tval,$tituloalternativo) | ... | ... |
menutemas/admin.db
No preview for this file type
temas/testept.map
1 | 1 | MAP |
2 | -SYMBOLSET ../symbols/simbolos.sym | |
3 | -FONTSET "../symbols/fontes.txt" | |
2 | + FONTSET "../symbols/fontes.txt" | |
3 | + SYMBOLSET "../symbols/simbolos.sym" | |
4 | 4 | LAYER |
5 | 5 | CONNECTION "" |
6 | 6 | DATA "c:\ms4w\Apache\htdocs\geodados\brasil\limitespol\localidades.shp" |
... | ... | @@ -8,12 +8,16 @@ FONTSET "../symbols/fontes.txt" |
8 | 8 | METADATA |
9 | 9 | "CLASSE" "SIM" |
10 | 10 | "palletestep" "" |
11 | - "description_template" "" | |
11 | + "permitekmz" "nao" | |
12 | 12 | "ITENSDESC" "Nome,Ano,UF" |
13 | + "description_template" "" | |
13 | 14 | "palletefile" "" |
15 | + "permitedownload" "sim" | |
14 | 16 | "download" "SIM" |
15 | - "ITENS" "NOMEMUN,ANOCRIA,ESTADO" | |
16 | 17 | "arquivodownload" "" |
18 | + "ITENS" "NOMEMUN,ANOCRIA,ESTADO" | |
19 | + "permitekml" "sim" | |
20 | + "permiteogc" "sim" | |
17 | 21 | "TEMA" "Teste de pontos" |
18 | 22 | END |
19 | 23 | NAME "testept" | ... | ... |