Commit 722c5220c6853b139c211c02a997218f6707ded3
1 parent
f2262db5
Exists in
master
and in
7 other branches
Incluido o parametro locaplic na construção das classes, possibilitando o includ…
…e em diretórios diferentes.
Showing
12 changed files
with
111 additions
and
23 deletions
Show diff stats
classesphp/atlas_controle.php
| @@ -54,15 +54,13 @@ File: i3geo/classesphp/atlas_controle.php | @@ -54,15 +54,13 @@ File: i3geo/classesphp/atlas_controle.php | ||
| 54 | error_reporting(0); | 54 | error_reporting(0); |
| 55 | $tempo = microtime(1); | 55 | $tempo = microtime(1); |
| 56 | // | 56 | // |
| 57 | -//pega as variaveis passadas com get ou post | 57 | +// quando as funções abaixo forem utilizadas, é necessário definir $map_file para que o programa continue. |
| 58 | // | 58 | // |
| 59 | -include_once("pega_variaveis.php"); | ||
| 60 | // | 59 | // |
| 61 | -// quando as funções abaixo forem utilizadas, é necessário definir $map_file para que o programa continue. | 60 | +//pega as variaveis passadas com get ou post |
| 62 | // | 61 | // |
| 63 | -if (($funcao == "pegaListaDeAtlas") || ($funcao == "criaAtlas")) | ||
| 64 | -{$map_file = "";} | ||
| 65 | -if (isset ($g_sid)) | 62 | +include_once("pega_variaveis.php"); |
| 63 | +if(isset($g_sid)) | ||
| 66 | { | 64 | { |
| 67 | session_name("i3GeoPHP"); | 65 | session_name("i3GeoPHP"); |
| 68 | session_id($g_sid); | 66 | session_id($g_sid); |
| @@ -72,6 +70,9 @@ if (isset ($g_sid)) | @@ -72,6 +70,9 @@ if (isset ($g_sid)) | ||
| 72 | eval("\$".$k."='".$_SESSION[$k]."';"); | 70 | eval("\$".$k."='".$_SESSION[$k]."';"); |
| 73 | } | 71 | } |
| 74 | } | 72 | } |
| 73 | +if (($funcao == "pegaListaDeAtlas") || ($funcao == "criaAtlas")) | ||
| 74 | +{$map_file = "";} | ||
| 75 | + | ||
| 75 | if (!isset($atlasxml)) | 76 | if (!isset($atlasxml)) |
| 76 | { | 77 | { |
| 77 | include_once("../ms_configura.php"); | 78 | include_once("../ms_configura.php"); |
| @@ -81,8 +82,9 @@ if (!isset($atlasxml)) | @@ -81,8 +82,9 @@ if (!isset($atlasxml)) | ||
| 81 | //ativa o php mapscript e as extensões necessárias | 82 | //ativa o php mapscript e as extensões necessárias |
| 82 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | 83 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido |
| 83 | // | 84 | // |
| 84 | -include_once ("carrega_ext.php"); | 85 | +include_once("carrega_ext.php"); |
| 85 | require_once("../pacotes/cpaint/cpaint2.inc.php"); | 86 | require_once("../pacotes/cpaint/cpaint2.inc.php"); |
| 87 | + | ||
| 86 | // | 88 | // |
| 87 | //cria objeto cpaint para uso com ajax | 89 | //cria objeto cpaint para uso com ajax |
| 88 | // | 90 | // |
classesphp/classe_alteraclasse.php
| @@ -71,10 +71,14 @@ $map_file - Endereço do mapfile no servidor. | @@ -71,10 +71,14 @@ $map_file - Endereço do mapfile no servidor. | ||
| 71 | 71 | ||
| 72 | $tema - nome do tema | 72 | $tema - nome do tema |
| 73 | */ | 73 | */ |
| 74 | - function __construct($map_file,$tema="") | 74 | + function __construct($map_file,$tema="",$locaplic="") |
| 75 | { | 75 | { |
| 76 | //error_reporting(E_ALL); | 76 | //error_reporting(E_ALL); |
| 77 | + if (file_exists($locaplic."/funcoes_gerais.php")) | ||
| 78 | + require_once($locaplic."/funcoes_gerais.php"); | ||
| 79 | + else | ||
| 77 | require_once("funcoes_gerais.php"); | 80 | require_once("funcoes_gerais.php"); |
| 81 | + $this->locaplic = $locaplic; | ||
| 78 | $this->mapa = ms_newMapObj($map_file); | 82 | $this->mapa = ms_newMapObj($map_file); |
| 79 | $this->arquivo = $map_file; | 83 | $this->arquivo = $map_file; |
| 80 | $this->layer = $this->mapa->getlayerbyname($tema); | 84 | $this->layer = $this->mapa->getlayerbyname($tema); |
| @@ -249,7 +253,10 @@ Include: | @@ -249,7 +253,10 @@ Include: | ||
| 249 | $valores = pegaValores($this->mapa,$this->layer,$item,true,$ignorar); | 253 | $valores = pegaValores($this->mapa,$this->layer,$item,true,$ignorar); |
| 250 | if (count($valores) > 0) | 254 | if (count($valores) > 0) |
| 251 | { | 255 | { |
| 252 | - require_once("classe_estatistica.php"); | 256 | + if(file_exists($this->locaplic."/classe_estatistica.php")) |
| 257 | + require_once($this->locaplic."/classe_estatistica.php"); | ||
| 258 | + else | ||
| 259 | + require_once("classe_estatistica.php"); | ||
| 253 | $estat = new estatistica(); | 260 | $estat = new estatistica(); |
| 254 | $estat->calcula($valores); | 261 | $estat->calcula($valores); |
| 255 | $calc = $estat->resultado; | 262 | $calc = $estat->resultado; |
| @@ -372,6 +379,9 @@ Include: | @@ -372,6 +379,9 @@ Include: | ||
| 372 | */ | 379 | */ |
| 373 | function alteraCoresClasses($cori,$corf) | 380 | function alteraCoresClasses($cori,$corf) |
| 374 | { | 381 | { |
| 382 | + if(file_exists($this->locaplic."/class.palette.php")) | ||
| 383 | + include($this->locaplic."/class.palette.php"); | ||
| 384 | + else | ||
| 375 | include("class.palette.php"); | 385 | include("class.palette.php"); |
| 376 | $cori = RGB2hex(explode(",",$cori)); | 386 | $cori = RGB2hex(explode(",",$cori)); |
| 377 | $corf = RGB2hex(explode(",",$corf)); | 387 | $corf = RGB2hex(explode(",",$corf)); |
classesphp/classe_analise.php
| @@ -75,10 +75,14 @@ $map_file - Endereço do mapfile no servidor. | @@ -75,10 +75,14 @@ $map_file - Endereço do mapfile no servidor. | ||
| 75 | 75 | ||
| 76 | $tema - Nome do tema que será processado | 76 | $tema - Nome do tema que será processado |
| 77 | */ | 77 | */ |
| 78 | - function __construct($map_file,$tema="") | 78 | + function __construct($map_file,$tema="",$locaplic) |
| 79 | { | 79 | { |
| 80 | //error_reporting(E_ALL); | 80 | //error_reporting(E_ALL); |
| 81 | + if(file_exists($locaplic."/funcoes_gerais.php")) | ||
| 82 | + require_once($locaplic."/funcoes_gerais.php"); | ||
| 83 | + else | ||
| 81 | require_once("funcoes_gerais.php"); | 84 | require_once("funcoes_gerais.php"); |
| 85 | + $thhis->locaplic = $locaplic; | ||
| 82 | $this->mapa = ms_newMapObj($map_file); | 86 | $this->mapa = ms_newMapObj($map_file); |
| 83 | $this->arquivo = $map_file; | 87 | $this->arquivo = $map_file; |
| 84 | if($tema != "") | 88 | if($tema != "") |
| @@ -616,6 +620,9 @@ $locaplic - diretório da aplicação i3geo | @@ -616,6 +620,9 @@ $locaplic - diretório da aplicação i3geo | ||
| 616 | { | 620 | { |
| 617 | if (file_exists($nomearq)) | 621 | if (file_exists($nomearq)) |
| 618 | { | 622 | { |
| 623 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 624 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 625 | + else | ||
| 619 | require_once "../pacotes/phpxbase/api_conversion.php"; | 626 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 620 | //define o nome do novo shapefile que será criado | 627 | //define o nome do novo shapefile que será criado |
| 621 | $nomefinal = nomeRandomico(); | 628 | $nomefinal = nomeRandomico(); |
| @@ -700,6 +707,9 @@ $locaplic - diretório da aplicação i3geo | @@ -700,6 +707,9 @@ $locaplic - diretório da aplicação i3geo | ||
| 700 | { | 707 | { |
| 701 | if (file_exists($nomearq)) | 708 | if (file_exists($nomearq)) |
| 702 | { | 709 | { |
| 710 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 711 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 712 | + else | ||
| 703 | require_once "../pacotes/phpxbase/api_conversion.php"; | 713 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 704 | // | 714 | // |
| 705 | //define os nomes dos novos shapefiles que serão criados | 715 | //define os nomes dos novos shapefiles que serão criados |
| @@ -858,6 +868,9 @@ $locaplic - Localização do I3geo. | @@ -858,6 +868,9 @@ $locaplic - Localização do I3geo. | ||
| 858 | */ | 868 | */ |
| 859 | function pontoEmPoligono($temaPt,$temasPo,$locaplic) | 869 | function pontoEmPoligono($temaPt,$temasPo,$locaplic) |
| 860 | { | 870 | { |
| 871 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 872 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 873 | + else | ||
| 861 | require_once "../pacotes/phpxbase/api_conversion.php"; | 874 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 862 | $layerPt = $this->mapa->getlayerbyname($temaPt); | 875 | $layerPt = $this->mapa->getlayerbyname($temaPt); |
| 863 | $layerPt->set("template","none.htm"); | 876 | $layerPt->set("template","none.htm"); |
| @@ -1000,6 +1013,9 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | @@ -1000,6 +1013,9 @@ function distanciaptpt($temaorigem,$temadestino,$temaoverlay,$locaplic,$itemorig | ||
| 1000 | { | 1013 | { |
| 1001 | //error_reporting(E_ALL); | 1014 | //error_reporting(E_ALL); |
| 1002 | //para manipular dbf | 1015 | //para manipular dbf |
| 1016 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1017 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1018 | + else | ||
| 1003 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1019 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1004 | //define o nome do novo shapefile que será criado | 1020 | //define o nome do novo shapefile que será criado |
| 1005 | $nomefinal = nomeRandomico(); | 1021 | $nomefinal = nomeRandomico(); |
| @@ -1121,8 +1137,10 @@ nome do layer criado com o buffer. | @@ -1121,8 +1137,10 @@ nome do layer criado com o buffer. | ||
| 1121 | function criaBuffer($distancia,$locaplic) | 1137 | function criaBuffer($distancia,$locaplic) |
| 1122 | { | 1138 | { |
| 1123 | //para manipular dbf | 1139 | //para manipular dbf |
| 1140 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1141 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1142 | + else | ||
| 1124 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1143 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1125 | - //define o nome do novo shapefile que será criado | ||
| 1126 | $nomebuffer = nomeRandomico(); | 1144 | $nomebuffer = nomeRandomico(); |
| 1127 | $nomeshp = $this->diretorio."/".$nomebuffer; | 1145 | $nomeshp = $this->diretorio."/".$nomebuffer; |
| 1128 | //pega os shapes selecionados | 1146 | //pega os shapes selecionados |
| @@ -1216,8 +1234,10 @@ $locaplic - Localização do I3geo. | @@ -1216,8 +1234,10 @@ $locaplic - Localização do I3geo. | ||
| 1216 | function criaCentroide($locaplic) | 1234 | function criaCentroide($locaplic) |
| 1217 | { | 1235 | { |
| 1218 | //para manipular dbf | 1236 | //para manipular dbf |
| 1237 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1238 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1239 | + else | ||
| 1219 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1240 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1220 | - //define o nome do novo shapefile que será criado | ||
| 1221 | $nomeCentroides = nomeRandomico(); | 1241 | $nomeCentroides = nomeRandomico(); |
| 1222 | $nomeshp = $this->diretorio."/".$nomeCentroides; | 1242 | $nomeshp = $this->diretorio."/".$nomeCentroides; |
| 1223 | //pega os shapes selecionados | 1243 | //pega os shapes selecionados |
| @@ -1304,8 +1324,10 @@ $npty - Número de pontos em Y (opcional) | @@ -1304,8 +1324,10 @@ $npty - Número de pontos em Y (opcional) | ||
| 1304 | function gradeDePontos($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty) | 1324 | function gradeDePontos($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty) |
| 1305 | { | 1325 | { |
| 1306 | //para manipular dbf | 1326 | //para manipular dbf |
| 1327 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1328 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1329 | + else | ||
| 1307 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1330 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1308 | - //define o nome do novo shapefile que será criado | ||
| 1309 | $nomegrade = nomeRandomico(); | 1331 | $nomegrade = nomeRandomico(); |
| 1310 | $nomeshp = $this->diretorio."/".$nomegrade; | 1332 | $nomeshp = $this->diretorio."/".$nomegrade; |
| 1311 | $this->mapa->preparequery(); | 1333 | $this->mapa->preparequery(); |
| @@ -1413,6 +1435,9 @@ $npty - Número de pontos em Y (opcional) | @@ -1413,6 +1435,9 @@ $npty - Número de pontos em Y (opcional) | ||
| 1413 | function gradeDePol($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty) | 1435 | function gradeDePol($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty) |
| 1414 | { | 1436 | { |
| 1415 | //para manipular dbf | 1437 | //para manipular dbf |
| 1438 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1439 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1440 | + else | ||
| 1416 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1441 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1417 | $nomegrade = nomeRandomico(); | 1442 | $nomegrade = nomeRandomico(); |
| 1418 | $nomeshp = $this->diretorio."/".$nomegrade; | 1443 | $nomeshp = $this->diretorio."/".$nomegrade; |
| @@ -1547,6 +1572,9 @@ $npty - Número de pontos em Y (opcional) | @@ -1547,6 +1572,9 @@ $npty - Número de pontos em Y (opcional) | ||
| 1547 | function gradeDeHex($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty) | 1572 | function gradeDeHex($xdd,$ydd,$px,$py,$locaplic,$nptx,$npty) |
| 1548 | { | 1573 | { |
| 1549 | //para manipular dbf | 1574 | //para manipular dbf |
| 1575 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1576 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1577 | + else | ||
| 1550 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1578 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1551 | $nomegrade = nomeRandomico(); | 1579 | $nomegrade = nomeRandomico(); |
| 1552 | $nomeshp = $this->diretorio."/".$nomegrade; | 1580 | $nomeshp = $this->diretorio."/".$nomegrade; |
| @@ -1684,6 +1712,9 @@ $locaplic - Localização do I3geo | @@ -1684,6 +1712,9 @@ $locaplic - Localização do I3geo | ||
| 1684 | function nptPol($temaPt,$temaPo,$locaplic) | 1712 | function nptPol($temaPt,$temaPo,$locaplic) |
| 1685 | { | 1713 | { |
| 1686 | //para manipular dbf | 1714 | //para manipular dbf |
| 1715 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1716 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1717 | + else | ||
| 1687 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1718 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1688 | $layerPt = $this->mapa->getlayerbyname($temaPt); | 1719 | $layerPt = $this->mapa->getlayerbyname($temaPt); |
| 1689 | $layerPt->set("template","none.htm"); | 1720 | $layerPt->set("template","none.htm"); |
| @@ -1957,6 +1988,9 @@ $operacao - Tipo de análise. | @@ -1957,6 +1988,9 @@ $operacao - Tipo de análise. | ||
| 1957 | if ($tiposhape == 0){$tiposhapefile = MS_SHP_MULTIPOINT;} | 1988 | if ($tiposhape == 0){$tiposhapefile = MS_SHP_MULTIPOINT;} |
| 1958 | if ($tiposhape == 1){$tiposhapefile = MS_SHP_ARC;} | 1989 | if ($tiposhape == 1){$tiposhapefile = MS_SHP_ARC;} |
| 1959 | //cria o shapefile | 1990 | //cria o shapefile |
| 1991 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1992 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1993 | + else | ||
| 1960 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1994 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1961 | $diretorio = dirname($this->arquivo); | 1995 | $diretorio = dirname($this->arquivo); |
| 1962 | $novonomelayer = nomeRandomico(); | 1996 | $novonomelayer = nomeRandomico(); |
classesphp/classe_atributos.php
| @@ -71,9 +71,10 @@ $map_file - Endereço do mapfile no servidor. | @@ -71,9 +71,10 @@ $map_file - Endereço do mapfile no servidor. | ||
| 71 | 71 | ||
| 72 | $tema - nome do tema | 72 | $tema - nome do tema |
| 73 | */ | 73 | */ |
| 74 | - function __construct($map_file,$tema="") | 74 | + function __construct($map_file,$tema="",$locaplic) |
| 75 | { | 75 | { |
| 76 | //error_reporting(E_ALL); | 76 | //error_reporting(E_ALL); |
| 77 | + $this->locaplic = $locaplic; | ||
| 77 | $this->mapa = ms_newMapObj($map_file); | 78 | $this->mapa = ms_newMapObj($map_file); |
| 78 | $this->arquivo = $map_file; | 79 | $this->arquivo = $map_file; |
| 79 | if($tema != "") | 80 | if($tema != "") |
| @@ -505,6 +506,9 @@ Include: | @@ -505,6 +506,9 @@ Include: | ||
| 505 | if (count($valoresn) == 0) | 506 | if (count($valoresn) == 0) |
| 506 | {return("erro. Nenhum valor valido");} | 507 | {return("erro. Nenhum valor valido");} |
| 507 | //faz os calculos | 508 | //faz os calculos |
| 509 | + if(file_exists($this->locaplic."/classe_estatistica.php")) | ||
| 510 | + require_once($this->locaplic."/classe_estatistica.php"); | ||
| 511 | + else | ||
| 508 | require_once("classe_estatistica.php"); | 512 | require_once("classe_estatistica.php"); |
| 509 | $estat = new estatistica(); | 513 | $estat = new estatistica(); |
| 510 | $resultado = $estat->calcula($valoresn); | 514 | $resultado = $estat->calcula($valoresn); |
classesphp/classe_legenda.php
| @@ -109,6 +109,9 @@ $template - nome do template para processar a legenda | @@ -109,6 +109,9 @@ $template - nome do template para processar a legenda | ||
| 109 | function __construct($map_file,$locaplic,$tema="",$template="") | 109 | function __construct($map_file,$locaplic,$tema="",$template="") |
| 110 | { | 110 | { |
| 111 | //error_reporting(E_ALL); | 111 | //error_reporting(E_ALL); |
| 112 | + if(file_exists($locaplic."/funcoes_gerais.php")) | ||
| 113 | + require_once($locaplic."/funcoes_gerais.php"); | ||
| 114 | + else | ||
| 112 | require_once("funcoes_gerais.php"); | 115 | require_once("funcoes_gerais.php"); |
| 113 | $this->mapa = ms_newMapObj($map_file); | 116 | $this->mapa = ms_newMapObj($map_file); |
| 114 | $this->arquivo = $map_file; | 117 | $this->arquivo = $map_file; |
classesphp/classe_mapa.php
| @@ -61,10 +61,14 @@ parameters: | @@ -61,10 +61,14 @@ parameters: | ||
| 61 | 61 | ||
| 62 | $map_file - Endereço do mapfile no servidor. | 62 | $map_file - Endereço do mapfile no servidor. |
| 63 | */ | 63 | */ |
| 64 | - function __construct($map_file) | 64 | + function __construct($map_file,$locaplic="") |
| 65 | { | 65 | { |
| 66 | //error_reporting(E_ALL); | 66 | //error_reporting(E_ALL); |
| 67 | + if(file_exists($locaplic."/funcoes_gerais.php")) | ||
| 68 | + require_once($locaplic."/funcoes_gerais.php"); | ||
| 69 | + else | ||
| 67 | require_once("funcoes_gerais.php"); | 70 | require_once("funcoes_gerais.php"); |
| 71 | + $this->locaplic = $locaplic; | ||
| 68 | $this->mapa = ms_newMapObj($map_file); | 72 | $this->mapa = ms_newMapObj($map_file); |
| 69 | $this->arquivo = $map_file; | 73 | $this->arquivo = $map_file; |
| 70 | for ($i=0;$i < ($this->mapa->numlayers);$i++) | 74 | for ($i=0;$i < ($this->mapa->numlayers);$i++) |
| @@ -139,7 +143,7 @@ string - javascript com os parametros | @@ -139,7 +143,7 @@ string - javascript com os parametros | ||
| 139 | //verifica se o tema pode receber a operação de zoom para o tema | 143 | //verifica se o tema pode receber a operação de zoom para o tema |
| 140 | // | 144 | // |
| 141 | $zoomtema = "sim"; | 145 | $zoomtema = "sim"; |
| 142 | - if (($ct != 1) && ($oLayer->getmetadata("extencao") == "")) | 146 | + if (($ct != 1) && ($oLayer->getmetadata("extensao") == "")) |
| 143 | {$zoomtema = "nao";} | 147 | {$zoomtema = "nao";} |
| 144 | // | 148 | // |
| 145 | //verifica se existe restrição de escala | 149 | //verifica se existe restrição de escala |
| @@ -179,7 +183,10 @@ Include: | @@ -179,7 +183,10 @@ Include: | ||
| 179 | */ | 183 | */ |
| 180 | function redesenhaCorpo($locsistemas,$locidentifica,$tipoimagem,$utilizacgi,$locmapserv) | 184 | function redesenhaCorpo($locsistemas,$locidentifica,$tipoimagem,$utilizacgi,$locmapserv) |
| 181 | { | 185 | { |
| 182 | - require_once("classe_imagem.php"); | 186 | + if(file_exists($this->locaplic."/classe_imagem.php")) |
| 187 | + require_once($this->locaplic."/classe_imagem.php"); | ||
| 188 | + else | ||
| 189 | + require_once("classe_imagem.php"); | ||
| 183 | $nomer = ""; | 190 | $nomer = ""; |
| 184 | $qy = file_exists(($this->arquivo)."qy"); | 191 | $qy = file_exists(($this->arquivo)."qy"); |
| 185 | $legenda = $this->mapa->legend; | 192 | $legenda = $this->mapa->legend; |
| @@ -878,6 +885,9 @@ Include: | @@ -878,6 +885,9 @@ Include: | ||
| 878 | */ | 885 | */ |
| 879 | function adicionatemawms($tema,$servico,$nome,$proj,$formato,$locaplic,$tipo,$versao,$nomecamada,$dir_tmp,$imgdir,$imgurl,$tiporep,$suportasld,$formatosinfo="text/plain") | 886 | function adicionatemawms($tema,$servico,$nome,$proj,$formato,$locaplic,$tipo,$versao,$nomecamada,$dir_tmp,$imgdir,$imgurl,$tiporep,$suportasld,$formatosinfo="text/plain") |
| 880 | { | 887 | { |
| 888 | + if(file_exists($this->locaplic."/wmswfs.php")) | ||
| 889 | + require_once($this->locaplic."/wmswfs.php"); | ||
| 890 | + else | ||
| 881 | require_once("wmswfs.php"); | 891 | require_once("wmswfs.php"); |
| 882 | //limpa selecao | 892 | //limpa selecao |
| 883 | if (file_exists(($this->arquivo)."qy")) | 893 | if (file_exists(($this->arquivo)."qy")) |
| @@ -1093,7 +1103,10 @@ $canal - Identificador do canal (ordem em que está no RSS) | @@ -1093,7 +1103,10 @@ $canal - Identificador do canal (ordem em que está no RSS) | ||
| 1093 | if (count($resultado) > 0) | 1103 | if (count($resultado) > 0) |
| 1094 | { | 1104 | { |
| 1095 | //para manipular dbf | 1105 | //para manipular dbf |
| 1096 | - require_once "../pacotes/phpxbase/api_conversion.php"; | 1106 | + if (file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) |
| 1107 | + require_once ($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1108 | + else | ||
| 1109 | + require_once ("../pacotes/phpxbase/api_conversion.php"); | ||
| 1097 | $diretorio = dirname($this->arquivo); | 1110 | $diretorio = dirname($this->arquivo); |
| 1098 | $tipol = MS_SHP_POLYGON; | 1111 | $tipol = MS_SHP_POLYGON; |
| 1099 | if ($tipog != "envelope"){$tipol = MS_SHP_POINT;} | 1112 | if ($tipog != "envelope"){$tipol = MS_SHP_POINT;} |
classesphp/classe_navegacao.php
| @@ -56,9 +56,12 @@ Cria um objeto avegacao | @@ -56,9 +56,12 @@ Cria um objeto avegacao | ||
| 56 | parameters: | 56 | parameters: |
| 57 | $map_file - string $map_file Endereço do mapfile no servidor. | 57 | $map_file - string $map_file Endereço do mapfile no servidor. |
| 58 | */ | 58 | */ |
| 59 | - function __construct($map_file) | 59 | + function __construct($map_file,$locaplic="") |
| 60 | { | 60 | { |
| 61 | //error_reporting(E_ALL); | 61 | //error_reporting(E_ALL); |
| 62 | + if(file_exists($locaplic."/funcoes_gerais.php")) | ||
| 63 | + require_once($locaplic."/funcoes_gerais.php"); | ||
| 64 | + else | ||
| 62 | require_once("funcoes_gerais.php"); | 65 | require_once("funcoes_gerais.php"); |
| 63 | $this->mapa = ms_newMapObj($map_file); | 66 | $this->mapa = ms_newMapObj($map_file); |
| 64 | $this->arquivo = $map_file; | 67 | $this->arquivo = $map_file; |
classesphp/classe_shp.php
| @@ -68,9 +68,10 @@ $map_file - Endereço do mapfile no servidor. | @@ -68,9 +68,10 @@ $map_file - Endereço do mapfile no servidor. | ||
| 68 | 68 | ||
| 69 | $tema - nome do tema | 69 | $tema - nome do tema |
| 70 | */ | 70 | */ |
| 71 | - function __construct($map_file,$tema="") | 71 | + function __construct($map_file,$tema="",$locaplic="") |
| 72 | { | 72 | { |
| 73 | //error_reporting(E_ALL); | 73 | //error_reporting(E_ALL); |
| 74 | + $this->locaplic = $locaplic; | ||
| 74 | $this->mapa = ms_newMapObj($map_file); | 75 | $this->mapa = ms_newMapObj($map_file); |
| 75 | $this->arquivo = $map_file; | 76 | $this->arquivo = $map_file; |
| 76 | $this->tema = $tema; | 77 | $this->tema = $tema; |
| @@ -100,6 +101,9 @@ Nome do tema criado. | @@ -100,6 +101,9 @@ Nome do tema criado. | ||
| 100 | */ | 101 | */ |
| 101 | function criaSHPvazio() | 102 | function criaSHPvazio() |
| 102 | { | 103 | { |
| 104 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 105 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 106 | + else | ||
| 103 | require_once "../pacotes/phpxbase/api_conversion.php"; | 107 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 104 | $diretorio = dirname($this->arquivo); | 108 | $diretorio = dirname($this->arquivo); |
| 105 | $tipol = MS_SHP_POINT; | 109 | $tipol = MS_SHP_POINT; |
| @@ -140,6 +144,9 @@ $projecao - código epsg da projeção das coordenadas | @@ -140,6 +144,9 @@ $projecao - código epsg da projeção das coordenadas | ||
| 140 | */ | 144 | */ |
| 141 | function insereSHP($xy,$projecao) | 145 | function insereSHP($xy,$projecao) |
| 142 | { | 146 | { |
| 147 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 148 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 149 | + else | ||
| 143 | require_once "../pacotes/phpxbase/api_conversion.php"; | 150 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 144 | $xy = explode(" ",$xy); | 151 | $xy = explode(" ",$xy); |
| 145 | $data = $this->layer->data; | 152 | $data = $this->layer->data; |
| @@ -295,6 +302,9 @@ $para - linha|poligono | @@ -295,6 +302,9 @@ $para - linha|poligono | ||
| 295 | function shpPT2shp($locaplic,$para) | 302 | function shpPT2shp($locaplic,$para) |
| 296 | { | 303 | { |
| 297 | //para manipular dbf | 304 | //para manipular dbf |
| 305 | + if(file_exists($this->locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 306 | + require_once($this->locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 307 | + else | ||
| 298 | require_once "../pacotes/phpxbase/api_conversion.php"; | 308 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 299 | $this->layer->set("template","none.htm"); | 309 | $this->layer->set("template","none.htm"); |
| 300 | $diretorio = dirname($this->arquivo); | 310 | $diretorio = dirname($this->arquivo); |
classesphp/classe_temas.php
| @@ -343,7 +343,7 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | @@ -343,7 +343,7 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa extensão. | ||
| 343 | $prjMapa = $this->mapa->getProjection(); | 343 | $prjMapa = $this->mapa->getProjection(); |
| 344 | $prjTema = $this->layer->getProjection(); | 344 | $prjTema = $this->layer->getProjection(); |
| 345 | $extatual = $this->mapa->extent; | 345 | $extatual = $this->mapa->extent; |
| 346 | - $ret = $this->layer->getmetadata("extencao"); | 346 | + $ret = $this->layer->getmetadata("extensao"); |
| 347 | if ($ret == "") | 347 | if ($ret == "") |
| 348 | { | 348 | { |
| 349 | $ret = $this->layer->getextent(); | 349 | $ret = $this->layer->getextent(); |
classesphp/classe_toponimia.php
| @@ -72,9 +72,12 @@ $map_file - Endereço do mapfile no servidor. | @@ -72,9 +72,12 @@ $map_file - Endereço do mapfile no servidor. | ||
| 72 | 72 | ||
| 73 | $tema - nome do tema que será processado | 73 | $tema - nome do tema que será processado |
| 74 | */ | 74 | */ |
| 75 | - function __construct($map_file,$tema="") | 75 | + function __construct($map_file,$tema="",$locaplic="") |
| 76 | { | 76 | { |
| 77 | //error_reporting(E_ALL); | 77 | //error_reporting(E_ALL); |
| 78 | + if(file_exists($locaplic."/funcoes_gerais.php")) | ||
| 79 | + require_once($locaplic."/funcoes_gerais.php"); | ||
| 80 | + else | ||
| 78 | require_once("funcoes_gerais.php"); | 81 | require_once("funcoes_gerais.php"); |
| 79 | $this->mapa = ms_newMapObj($map_file); | 82 | $this->mapa = ms_newMapObj($map_file); |
| 80 | $this->arquivo = $map_file; | 83 | $this->arquivo = $map_file; |
classesphp/funcoes_gerais.php
| @@ -1480,6 +1480,9 @@ $dir_tmp - Diretório temporário | @@ -1480,6 +1480,9 @@ $dir_tmp - Diretório temporário | ||
| 1480 | function criaSHP($tema,$map_file,$locaplic,$dir_tmp) | 1480 | function criaSHP($tema,$map_file,$locaplic,$dir_tmp) |
| 1481 | { | 1481 | { |
| 1482 | //para manipular dbf | 1482 | //para manipular dbf |
| 1483 | + if(file_exists($locaplic."/pacotes/phpxbase/api_conversion.php")) | ||
| 1484 | + require_once($locaplic."/pacotes/phpxbase/api_conversion.php"); | ||
| 1485 | + else | ||
| 1483 | require_once "../pacotes/phpxbase/api_conversion.php"; | 1486 | require_once "../pacotes/phpxbase/api_conversion.php"; |
| 1484 | $map = @ms_newMapObj($map_file); | 1487 | $map = @ms_newMapObj($map_file); |
| 1485 | $layer = $map->getlayerbyname($tema); | 1488 | $layer = $map->getlayerbyname($tema); |
| @@ -1589,6 +1592,9 @@ function downloadTema($map_file,$tema,$locaplic,$dir_tmp) | @@ -1589,6 +1592,9 @@ function downloadTema($map_file,$tema,$locaplic,$dir_tmp) | ||
| 1589 | ini_set("max_execution_time","1800"); | 1592 | ini_set("max_execution_time","1800"); |
| 1590 | if (!@ms_newMapObj($map_file)) //a funcao foi chamada do aplicativo datadownload | 1593 | if (!@ms_newMapObj($map_file)) //a funcao foi chamada do aplicativo datadownload |
| 1591 | { | 1594 | { |
| 1595 | + if(file_exists($locaplic."/ms_configura.php")) | ||
| 1596 | + require_once($locaplic."/ms_configura.php"); | ||
| 1597 | + else | ||
| 1592 | require_once("../ms_configura.php"); | 1598 | require_once("../ms_configura.php"); |
| 1593 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | 1599 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) |
| 1594 | {$map_tmp = ms_newMapObj($locaplic."/aplicmap/geral1windows.map");} | 1600 | {$map_tmp = ms_newMapObj($locaplic."/aplicmap/geral1windows.map");} |
classesphp/mapa_inicia.php
| @@ -161,7 +161,7 @@ function iniciaMapa() | @@ -161,7 +161,7 @@ function iniciaMapa() | ||
| 161 | //verifica se o tema pode receber a operação de zoom para o tema | 161 | //verifica se o tema pode receber a operação de zoom para o tema |
| 162 | // | 162 | // |
| 163 | $zoomtema = "sim"; | 163 | $zoomtema = "sim"; |
| 164 | - if (($ct != 1) && ($oLayer->getmetadata("extecao") == "")) | 164 | + if (($ct != 1) && ($oLayer->getmetadata("extensao") == "")) |
| 165 | {$zoomtema = "nao";} | 165 | {$zoomtema = "nao";} |
| 166 | // | 166 | // |
| 167 | //verifica se existe restrição de escala | 167 | //verifica se existe restrição de escala |