Commit db0f74660593059572f06400828ee6fa4b1575e2
1 parent
6eed942d
Exists in
master
and in
7 other branches
Correções no editor de mapfiles
Showing
2 changed files
with
21 additions
and
12 deletions
Show diff stats
admin/js/editormapfile.js
| @@ -774,7 +774,7 @@ function montaEditorConexao(dados) | @@ -774,7 +774,7 @@ function montaEditorConexao(dados) | ||
| 774 | new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); | 774 | new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); |
| 775 | 775 | ||
| 776 | var temp = function() | 776 | var temp = function() |
| 777 | - {salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,true)} | 777 | + {salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,"","",true)} |
| 778 | new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); | 778 | new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); |
| 779 | } | 779 | } |
| 780 | function montaEditorMetadados(dados) | 780 | function montaEditorMetadados(dados) |
| @@ -930,7 +930,7 @@ function montaEditorGeral(dados) | @@ -930,7 +930,7 @@ function montaEditorGeral(dados) | ||
| 930 | new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); | 930 | new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); |
| 931 | 931 | ||
| 932 | var temp = function() | 932 | var temp = function() |
| 933 | - {salvarDadosEditor('geral',dados.codigoMap,dados.codigoLayer,true)} | 933 | + {salvarDadosEditor('geral',dados.codigoMap,dados.codigoLayer,"","",true)} |
| 934 | new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); | 934 | new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); |
| 935 | 935 | ||
| 936 | } | 936 | } |
| @@ -1114,12 +1114,14 @@ function montaEditorEstilo(dados) | @@ -1114,12 +1114,14 @@ function montaEditorEstilo(dados) | ||
| 1114 | ins += core_geraLinhas(param) | 1114 | ins += core_geraLinhas(param) |
| 1115 | ins += "<br><br><br>" | 1115 | ins += "<br><br><br>" |
| 1116 | $i("editor_bd").innerHTML = ins | 1116 | $i("editor_bd").innerHTML = ins |
| 1117 | + | ||
| 1117 | var temp = function() | 1118 | var temp = function() |
| 1118 | {salvarDadosEditor('estilo',dados.codigoMap,dados.codigoLayer,dados.indiceClasse,dados.indiceEstilo)} | 1119 | {salvarDadosEditor('estilo',dados.codigoMap,dados.codigoLayer,dados.indiceClasse,dados.indiceEstilo)} |
| 1119 | new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); | 1120 | new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); |
| 1120 | } | 1121 | } |
| 1121 | function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,testar) | 1122 | function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,testar) |
| 1122 | { | 1123 | { |
| 1124 | + //alert(arguments.length) | ||
| 1123 | if(arguments.length < 6){var testar = false;} | 1125 | if(arguments.length < 6){var testar = false;} |
| 1124 | 1126 | ||
| 1125 | if(tipo == "conexao") | 1127 | if(tipo == "conexao") |
admin/php/editormapfile.php
| @@ -148,7 +148,7 @@ switch ($funcao) | @@ -148,7 +148,7 @@ switch ($funcao) | ||
| 148 | if(verificaEditores($editores) == "nao") | 148 | if(verificaEditores($editores) == "nao") |
| 149 | {echo "Vc nao e um editor cadastrado. Apenas os editores definidos em i3geo/ms_configura.php podem acessar o sistema de administracao.";exit;} | 149 | {echo "Vc nao e um editor cadastrado. Apenas os editores definidos em i3geo/ms_configura.php podem acessar o sistema de administracao.";exit;} |
| 150 | $retorno = alterarConexao(); | 150 | $retorno = alterarConexao(); |
| 151 | - if($testar == false) | 151 | + if($testar == "false") |
| 152 | retornaJSON(pegaConexao()); | 152 | retornaJSON(pegaConexao()); |
| 153 | else | 153 | else |
| 154 | retornaJSON(array("url"=>$retorno)); | 154 | retornaJSON(array("url"=>$retorno)); |
| @@ -172,10 +172,14 @@ switch ($funcao) | @@ -172,10 +172,14 @@ switch ($funcao) | ||
| 172 | case "alterarGeral": | 172 | case "alterarGeral": |
| 173 | if(verificaEditores($editores) == "nao") | 173 | if(verificaEditores($editores) == "nao") |
| 174 | {echo "Vc nao e um editor cadastrado. Apenas os editores definidos em i3geo/ms_configura.php podem acessar o sistema de administracao.";exit;} | 174 | {echo "Vc nao e um editor cadastrado. Apenas os editores definidos em i3geo/ms_configura.php podem acessar o sistema de administracao.";exit;} |
| 175 | + | ||
| 175 | $retorno = alterarGeral(); | 176 | $retorno = alterarGeral(); |
| 176 | 177 | ||
| 177 | - if($testar == false) | ||
| 178 | - retornaJSON(pegaGeral()); | 178 | + if($testar == "false") |
| 179 | + { | ||
| 180 | + $codigoLayer = $name; | ||
| 181 | + retornaJSON(pegaGeral()); | ||
| 182 | + } | ||
| 179 | else | 183 | else |
| 180 | retornaJSON(array("url"=>$retorno)); | 184 | retornaJSON(array("url"=>$retorno)); |
| 181 | exit; | 185 | exit; |
| @@ -309,7 +313,7 @@ function autoClassesLayer() | @@ -309,7 +313,7 @@ function autoClassesLayer() | ||
| 309 | global $codigoMap,$codigoLayer,$item,$locaplic,$dir_tmp; | 313 | global $codigoMap,$codigoLayer,$item,$locaplic,$dir_tmp; |
| 310 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; | 314 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; |
| 311 | include_once("../../classesphp/classe_alteraclasse.php"); | 315 | include_once("../../classesphp/classe_alteraclasse.php"); |
| 312 | - error_reporting(E_ALL); | 316 | + error_reporting(0); |
| 313 | $nometemp = $dir_tmp."/".nomerandomico().".map"; | 317 | $nometemp = $dir_tmp."/".nomerandomico().".map"; |
| 314 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | 318 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) |
| 315 | {$geral = $locaplic."/aplicmap/geral1windows.map";} | 319 | {$geral = $locaplic."/aplicmap/geral1windows.map";} |
| @@ -484,7 +488,7 @@ function alterarConexao() | @@ -484,7 +488,7 @@ function alterarConexao() | ||
| 484 | $layer->set("data",$data); | 488 | $layer->set("data",$data); |
| 485 | $layer->set("tileitem",$tileitem); | 489 | $layer->set("tileitem",$tileitem); |
| 486 | $layer->set("tileindex",$tileindex); | 490 | $layer->set("tileindex",$tileindex); |
| 487 | - if($testar == true) | 491 | + if($testar == "true") |
| 488 | { | 492 | { |
| 489 | $nome = $dir_tmp."/".$codigoMap.".map"; | 493 | $nome = $dir_tmp."/".$codigoMap.".map"; |
| 490 | $mapa->save($nome); | 494 | $mapa->save($nome); |
| @@ -600,6 +604,7 @@ function alterarGeral() | @@ -600,6 +604,7 @@ function alterarGeral() | ||
| 600 | error_reporting(E_ALL); | 604 | error_reporting(E_ALL); |
| 601 | $v = versao(); | 605 | $v = versao(); |
| 602 | $dados = array(); | 606 | $dados = array(); |
| 607 | + | ||
| 603 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; | 608 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; |
| 604 | $mapa = ms_newMapObj($mapfile); | 609 | $mapa = ms_newMapObj($mapfile); |
| 605 | $layer = $mapa->getlayerbyname($codigoLayer); | 610 | $layer = $mapa->getlayerbyname($codigoLayer); |
| @@ -637,17 +642,19 @@ function alterarGeral() | @@ -637,17 +642,19 @@ function alterarGeral() | ||
| 637 | if($layer->getprojection() == MS_FALSE && $projection != "") | 642 | if($layer->getprojection() == MS_FALSE && $projection != "") |
| 638 | $layer->setprojection($projection); | 643 | $layer->setprojection($projection); |
| 639 | 644 | ||
| 640 | - if($testar == true) | 645 | + if($testar == "true") |
| 641 | { | 646 | { |
| 642 | $nome = $dir_tmp."/".$codigoMap.".map"; | 647 | $nome = $dir_tmp."/".$codigoMap.".map"; |
| 643 | $mapa->save($nome); | 648 | $mapa->save($nome); |
| 644 | removeCabecalho($nome,false); | 649 | removeCabecalho($nome,false); |
| 645 | return $nome; | 650 | return $nome; |
| 646 | } | 651 | } |
| 647 | - | ||
| 648 | - $mapa->save($mapfile); | ||
| 649 | - removeCabecalho($mapfile); | ||
| 650 | - return "ok"; | 652 | + else |
| 653 | + { | ||
| 654 | + $mapa->save($mapfile); | ||
| 655 | + removeCabecalho($mapfile); | ||
| 656 | + return "ok"; | ||
| 657 | + } | ||
| 651 | } | 658 | } |
| 652 | function pegaClasseGeral() | 659 | function pegaClasseGeral() |
| 653 | { | 660 | { |