Commit f564365b2c1140ff4df278158c5350cad83c4b29
1 parent
3ce37547
Exists in
master
and in
7 other branches
--no commit message
Showing
7 changed files
with
432 additions
and
4 deletions
Show diff stats
| @@ -0,0 +1,78 @@ | @@ -0,0 +1,78 @@ | ||
| 1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
| 2 | +<html> | ||
| 3 | +<head> | ||
| 4 | +<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | ||
| 5 | +<title>Shape file</title> | ||
| 6 | +<style type="text/css"> | ||
| 7 | +/*margin and padding on body element | ||
| 8 | + can introduce errors in determining | ||
| 9 | + element position and are not recommended; | ||
| 10 | + we turn them off as a foundation for YUI | ||
| 11 | + CSS treatments. */ | ||
| 12 | +body { | ||
| 13 | + margin: 0; | ||
| 14 | + padding: 0; | ||
| 15 | +} | ||
| 16 | +</style> | ||
| 17 | +<script type="text/javascript" src="../../classesjs/i3geo.js"></script> | ||
| 18 | +<script type="text/javascript" src="../../ferramentas/uploadsimbolo/index.js"></script> | ||
| 19 | +<script type="text/javascript" src="../../ferramentas/uploadsimbolo/dicionario.js"></script> | ||
| 20 | +<script type="text/javascript" src="../js/core.js"></script> | ||
| 21 | +<link rel="stylesheet" type="text/css" href="admin.css"> | ||
| 22 | +</head> | ||
| 23 | +<body class=" yui-skin-sam fundoPonto"> | ||
| 24 | + <center> | ||
| 25 | + <div class="bordaSuperior"> </div> | ||
| 26 | + <div class="mascaraPrincipal" id="divGeral"> | ||
| 27 | + <div id=cabecalhoPrincipal></div> | ||
| 28 | + <div id="formulario" style="display: none"> | ||
| 29 | + <div id="conteudo" style="width: 500px"></div> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + <br> <br> <br> <br> <br> <br> <br> | ||
| 33 | + <br> <br> <br> <br> <br> <br> <br> | ||
| 34 | + <br> <br> <br> <br> <br> <br> <br> | ||
| 35 | + </center> | ||
| 36 | + <script> | ||
| 37 | +/* | ||
| 38 | +Title: Subir simbolo | ||
| 39 | + | ||
| 40 | +Envia um arquivo de imagem para o servidor | ||
| 41 | + | ||
| 42 | +Licenca: | ||
| 43 | + | ||
| 44 | +GPL2 | ||
| 45 | + | ||
| 46 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
| 47 | + | ||
| 48 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
| 49 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
| 50 | + | ||
| 51 | +Este programa é software livre; você pode redistribuí-lo | ||
| 52 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
| 53 | +GNU conforme publicada pela Free Software Foundation; | ||
| 54 | + | ||
| 55 | +Este programa é distribuído na expectativa de que seja útil, | ||
| 56 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
| 57 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
| 58 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
| 59 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
| 60 | +GNU junto com este programa; se não, escreva para a | ||
| 61 | +Free Software Foundation, Inc., no endereço | ||
| 62 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
| 63 | + | ||
| 64 | +Arquivo: | ||
| 65 | + | ||
| 66 | +i3geo/admin/html/subirsimbolo.html | ||
| 67 | +*/ | ||
| 68 | +i3GEO.configura.locaplic = "../.."; | ||
| 69 | +i3GEO.parametros.editor = "sim"; | ||
| 70 | +i3GEO.configura.sid = ""; | ||
| 71 | +cabecalhoGeral("cabecalhoPrincipal",""); | ||
| 72 | +temp = function(){ | ||
| 73 | + document.getElementById("formulario").style.display = "block"; | ||
| 74 | + i3GEOF.uploadsimbolo.inicia("conteudo"); | ||
| 75 | +}; | ||
| 76 | +i3GEO.login.verificaOperacao("admin/html/subirshapefile",i3GEO.configura.locaplic,temp,"sessao",i3GEO.login.dialogo.abreLogin); | ||
| 77 | +</script> | ||
| 78 | +</body> |
admin/menu.html
| @@ -139,6 +139,11 @@ | @@ -139,6 +139,11 @@ | ||
| 139 | type: "text", | 139 | type: "text", |
| 140 | href: "html/estat_editor.html", | 140 | href: "html/estat_editor.html", |
| 141 | target: "principal" | 141 | target: "principal" |
| 142 | + },{ | ||
| 143 | + label: "Upload de imagem para uso como símbolo", | ||
| 144 | + type: "text", | ||
| 145 | + href: "html/subirsimbolo.html", | ||
| 146 | + target: "principal" | ||
| 142 | } | 147 | } |
| 143 | ]},{ | 148 | ]},{ |
| 144 | label: "Editor de mapfiles", | 149 | label: "Editor de mapfiles", |
| @@ -161,6 +166,11 @@ | @@ -161,6 +166,11 @@ | ||
| 161 | href: "html/arvore.html", | 166 | href: "html/arvore.html", |
| 162 | target: "principal" | 167 | target: "principal" |
| 163 | },{ | 168 | },{ |
| 169 | + label: "Upload de imagem para uso como símbolo", | ||
| 170 | + type: "text", | ||
| 171 | + href: "html/subirsimbolo.html", | ||
| 172 | + target: "principal" | ||
| 173 | + },{ | ||
| 164 | label: "Ver RSS com os grupos, subgrupos e temas", | 174 | label: "Ver RSS com os grupos, subgrupos e temas", |
| 165 | type: "text", | 175 | type: "text", |
| 166 | href: "rssgrupos.php", | 176 | href: "rssgrupos.php", |
classesjs/dicionario_ajuda.js
| @@ -968,7 +968,16 @@ g_traducao_ajuda = { | @@ -968,7 +968,16 @@ g_traducao_ajuda = { | ||
| 968 | pt:"Guarda as preferências do usuário em relação aos parâmetros que controlam a interface do mapa", | 968 | pt:"Guarda as preferências do usuário em relação aos parâmetros que controlam a interface do mapa", |
| 969 | complemento:"", | 969 | complemento:"", |
| 970 | apijs: "i3GEO.mapa.dialogo.preferencias()" | 970 | apijs: "i3GEO.mapa.dialogo.preferencias()" |
| 971 | - } | 971 | + }, |
| 972 | + "116": { | ||
| 973 | + titulo: "Upload se símbolo", | ||
| 974 | + diretorio:"i3geo/ferramentas/uploadsimbolo", | ||
| 975 | + categoria:"4", | ||
| 976 | + pt:"Envia para o servidor um arquivo de imagem que poderá ser utilizado como símbolo nas legendas das camadas", | ||
| 977 | + complemento:"", | ||
| 978 | + //tela:"ferramentas/upload/exemplo.htm", | ||
| 979 | + apijs:"" | ||
| 980 | + }, | ||
| 972 | } | 981 | } |
| 973 | }; | 982 | }; |
| 974 | 983 |
ferramentas/upload/index.js
| @@ -104,12 +104,15 @@ i3GEOF.upload = { | @@ -104,12 +104,15 @@ i3GEOF.upload = { | ||
| 104 | String com o código html | 104 | String com o código html |
| 105 | */ | 105 | */ |
| 106 | html:function(){ | 106 | html:function(){ |
| 107 | - var ins = '<form id=i3GEOuploadf target="i3GEOuploadiframe" action="'+i3GEO.configura.locaplic+'/ferramentas/upload/upload.php" method="post" ENCTYPE="multipart/form-data">' + | 107 | + var limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png", |
| 108 | + ins = '<form id=i3GEOuploadf target="i3GEOuploadiframe" action="'+i3GEO.configura.locaplic+'/ferramentas/upload/upload.php" method="post" ENCTYPE="multipart/form-data">' + | ||
| 108 | '<p class="paragrafo" >shp: <br><input type="file" size=22 name="i3GEOuploadshp" style="top:0px;left:0px;cursor:pointer;"></p>' + | 109 | '<p class="paragrafo" >shp: <br><input type="file" size=22 name="i3GEOuploadshp" style="top:0px;left:0px;cursor:pointer;"></p>' + |
| 109 | '<p class="paragrafo" >shx: <br><input type="file" size=22 name="i3GEOuploadshx" style="top:0px;left:0px;cursor:pointer;"></p>' + | 110 | '<p class="paragrafo" >shx: <br><input type="file" size=22 name="i3GEOuploadshx" style="top:0px;left:0px;cursor:pointer;"></p>' + |
| 110 | '<p class="paragrafo" >dbf: <br><input type="file" size=22 name="i3GEOuploaddbf" style="top:0px;left:0px;cursor:pointer;"></p>'; | 111 | '<p class="paragrafo" >dbf: <br><input type="file" size=22 name="i3GEOuploaddbf" style="top:0px;left:0px;cursor:pointer;"></p>'; |
| 111 | - if(i3GEO.parametros.editor === "sim") | ||
| 112 | - {ins += '<p class="paragrafo" >'+$trad(1,i3GEOF.upload.dicionario)+':<br><input class=digitar type="text" size=45 name="dirDestino" style="top:0px;left:0px;cursor:pointer;"></p>';} | 112 | + if(i3GEO.parametros.editor === "sim"){ |
| 113 | + ins += '<p class="paragrafo" >'+$trad(1,i3GEOF.upload.dicionario)+':<br><input class=digitar type="text" size=45 name="dirDestino" id="dirDestino" style="top:0px;left:0px;cursor:pointer;"></p>'; | ||
| 114 | + //ins += "<img onclick='i3GEOF.upload.selNavegador(\"dirDestino\")' src='"+limg+"' style='cursor:pointer;position :relative;top:2px'/></p>"; | ||
| 115 | + } | ||
| 113 | ins += '<p class="paragrafo" >'+$trad(2,i3GEOF.upload.dicionario)+': ' + | 116 | ins += '<p class="paragrafo" >'+$trad(2,i3GEOF.upload.dicionario)+': ' + |
| 114 | ' <select id=tipo name=tipo >' + | 117 | ' <select id=tipo name=tipo >' + |
| 115 | ' <option value="">'+$trad(3,i3GEOF.upload.dicionario)+'</option>' + | 118 | ' <option value="">'+$trad(3,i3GEOF.upload.dicionario)+'</option>' + |
| @@ -168,6 +171,9 @@ i3GEOF.upload = { | @@ -168,6 +171,9 @@ i3GEOF.upload = { | ||
| 168 | {return;} | 171 | {return;} |
| 169 | i3GEOF.upload.aguarde.visibility="visible"; | 172 | i3GEOF.upload.aguarde.visibility="visible"; |
| 170 | $i("i3GEOuploadf").submit(); | 173 | $i("i3GEOuploadf").submit(); |
| 174 | + }, | ||
| 175 | + selNavegador: function(onde){ | ||
| 176 | + i3GEO.util.navegadorDir(onde,false,false,false); | ||
| 171 | } | 177 | } |
| 172 | }; | 178 | }; |
| 173 | 179 |
| @@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
| 1 | +//+$trad(1,i3GEOF.uploadsimbolo.dicionario)+ | ||
| 2 | +i3GEOF.uploadsimbolo.dicionario = { | ||
| 3 | + 1: [{ | ||
| 4 | + pt:"pasta no servidor onde os dados<br>serão armazenados (opcional)", | ||
| 5 | + en:"", | ||
| 6 | + es:"", | ||
| 7 | + it:"" | ||
| 8 | + }], | ||
| 9 | + 8: [{ | ||
| 10 | + pt:"Enviar", | ||
| 11 | + en:"", | ||
| 12 | + es:"", | ||
| 13 | + it:"" | ||
| 14 | + }], | ||
| 15 | + 9: [{ | ||
| 16 | + pt:"Não utilize _ no nome do arquivo. Apenas letras e números são aceitos!!!", | ||
| 17 | + en:"", | ||
| 18 | + es:"", | ||
| 19 | + it:"" | ||
| 20 | + }], | ||
| 21 | + 10: [{ | ||
| 22 | + pt:"", | ||
| 23 | + en:"", | ||
| 24 | + es:"", | ||
| 25 | + it:"" | ||
| 26 | + }] | ||
| 27 | +}; |
| @@ -0,0 +1,159 @@ | @@ -0,0 +1,159 @@ | ||
| 1 | +/* | ||
| 2 | +Title: uploadsimbolo de arquivo de simbolo | ||
| 3 | + | ||
| 4 | +Envia para o servidor um arquivo shapefile local e insere como uma camada no mapa. | ||
| 5 | + | ||
| 6 | +Veja: | ||
| 7 | + | ||
| 8 | +<i3GEO.arvoreDeTemas.dialogo.uploadsimbolo> | ||
| 9 | + | ||
| 10 | +Arquivo: i3geo/ferramentas/uploadsimbolo/index.js.php | ||
| 11 | + | ||
| 12 | +About: Licença | ||
| 13 | + | ||
| 14 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
| 15 | + | ||
| 16 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
| 17 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
| 18 | + | ||
| 19 | +Este programa é software livre; você pode redistribuí-lo | ||
| 20 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
| 21 | +GNU conforme publicada pela Free Software Foundation; | ||
| 22 | + | ||
| 23 | +Este programa é distribuído na expectativa de que seja útil, | ||
| 24 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
| 25 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
| 26 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
| 27 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
| 28 | +GNU junto com este programa; se não, escreva para a | ||
| 29 | +Free Software Foundation, Inc., no endereço | ||
| 30 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
| 31 | +*/ | ||
| 32 | +if(typeof(i3GEOF) === 'undefined'){ | ||
| 33 | + var i3GEOF = {}; | ||
| 34 | +} | ||
| 35 | +/* | ||
| 36 | +Classe: i3GEOF.uploadsimbolo | ||
| 37 | +*/ | ||
| 38 | +i3GEOF.uploadsimbolo = { | ||
| 39 | + /* | ||
| 40 | + Variavel: aguarde | ||
| 41 | + | ||
| 42 | + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | ||
| 43 | + */ | ||
| 44 | + aguarde: "", | ||
| 45 | + /* | ||
| 46 | + Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | ||
| 47 | + */ | ||
| 48 | + criaJanelaFlutuante: function(){ | ||
| 49 | + i3GEOF.uploadsimbolo.iniciaDicionario(); | ||
| 50 | + }, | ||
| 51 | + /* | ||
| 52 | + Function: iniciaDicionario | ||
| 53 | + | ||
| 54 | + Carrega o dicionário e chama a função que inicia a ferramenta | ||
| 55 | + | ||
| 56 | + O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | ||
| 57 | + */ | ||
| 58 | + iniciaDicionario: function(){ | ||
| 59 | + if(typeof(i3GEOF.uploadsimbolo.dicionario) === 'undefined'){ | ||
| 60 | + i3GEO.util.scriptTag( | ||
| 61 | + i3GEO.configura.locaplic+"/ferramentas/uploadsimbolo/dicionario.js", | ||
| 62 | + "i3GEOF.uploadsimbolo.iniciaJanelaFlutuante()", | ||
| 63 | + "i3GEOF.uploadsimbolo.dicionario_script" | ||
| 64 | + ); | ||
| 65 | + } | ||
| 66 | + else{ | ||
| 67 | + i3GEOF.uploadsimbolo.iniciaJanelaFlutuante(); | ||
| 68 | + } | ||
| 69 | + }, | ||
| 70 | + /* | ||
| 71 | + Function: inicia | ||
| 72 | + | ||
| 73 | + Inicia a ferramenta. É chamado por criaJanelaFlutuante | ||
| 74 | + | ||
| 75 | + Parametro: | ||
| 76 | + | ||
| 77 | + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | ||
| 78 | + */ | ||
| 79 | + inicia: function(iddiv){ | ||
| 80 | + try{ | ||
| 81 | + $i(iddiv).innerHTML += i3GEOF.uploadsimbolo.html(); | ||
| 82 | + new YAHOO.widget.Button( | ||
| 83 | + "i3GEOuploadsimbolobotao1", | ||
| 84 | + {onclick:{fn: i3GEOF.uploadsimbolo.submete}} | ||
| 85 | + ); | ||
| 86 | + } | ||
| 87 | + catch(erro){i3GEO.janela.tempoMsg(erro);} | ||
| 88 | + }, | ||
| 89 | + /* | ||
| 90 | + Function: html | ||
| 91 | + | ||
| 92 | + Gera o código html para apresentação das opções da ferramenta | ||
| 93 | + | ||
| 94 | + Retorno: | ||
| 95 | + | ||
| 96 | + String com o código html | ||
| 97 | + */ | ||
| 98 | + html:function(){ | ||
| 99 | + var limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png", | ||
| 100 | + ins = '<form id=i3GEOuploadsimbolof target="i3GEOuploadsimboloiframe" action="'+i3GEO.configura.locaplic+'/ferramentas/uploadsimbolo/upload.php" method="post" ENCTYPE="multipart/form-data">' + | ||
| 101 | + '<p class="paragrafo" >PNG/JPG: <br><input type="file" size=22 name="i3GEOuploadsimboloarq" style="top:0px;left:0px;cursor:pointer;"></p>'; | ||
| 102 | + if(i3GEO.parametros.editor === "sim"){ | ||
| 103 | + ins += '<p class="paragrafo" >'+$trad(1,i3GEOF.uploadsimbolo.dicionario)+':<br><input class=digitar type="text" size=45 name="dirDestino" id="dirDestino" style="top:0px;left:0px;cursor:pointer;"></p>'; | ||
| 104 | + //ins += "<img onclick='i3GEOF.uploadsimbolo.selNavegador(\"dirDestino\")' src='"+limg+"' style='cursor:pointer;position :relative;top:2px'/></p>"; | ||
| 105 | + } | ||
| 106 | + ins += '<p class="paragrafo" ><input id=i3GEOuploadsimbolobotao1 type="button" value="'+$trad(8,i3GEOF.uploadsimbolo.dicionario)+'" size=12 name="submit">' + | ||
| 107 | + '<input type=hidden name=g_sid value="'+i3GEO.configura.sid+'" >' + | ||
| 108 | + '<input type="hidden" name="MAX_FILE_SIZE" value="1000000">' + | ||
| 109 | + '</form>' + | ||
| 110 | + "<p class='paragrafo' style=color:red >"+$trad(9,i3GEOF.uploadsimbolo.dicionario)+"</p>" + | ||
| 111 | + '<iframe name=i3GEOuploadsimboloiframe style="text-align:left;border:1px solid gray;" width="98%" height="60px"></iframe>'; | ||
| 112 | + return ins; | ||
| 113 | + }, | ||
| 114 | + /* | ||
| 115 | + Function: iniciaJanelaFlutuante | ||
| 116 | + | ||
| 117 | + Cria a janela flutuante para controle da ferramenta. | ||
| 118 | + */ | ||
| 119 | + iniciaJanelaFlutuante: function(){ | ||
| 120 | + var janela,divid,titulo,cabecalho,minimiza; | ||
| 121 | + cabecalho = function(){}; | ||
| 122 | + minimiza = function(){ | ||
| 123 | + i3GEO.janela.minimiza("i3GEOF.uploadsimbolo"); | ||
| 124 | + }; | ||
| 125 | + titulo = "PNG/JPG <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=4&idajuda=116' > </a>"; | ||
| 126 | + janela = i3GEO.janela.cria( | ||
| 127 | + "355px", | ||
| 128 | + "470px", | ||
| 129 | + "", | ||
| 130 | + "", | ||
| 131 | + "", | ||
| 132 | + titulo, | ||
| 133 | + "i3GEOF.uploadsimbolo", | ||
| 134 | + false, | ||
| 135 | + "hd", | ||
| 136 | + cabecalho, | ||
| 137 | + minimiza | ||
| 138 | + ); | ||
| 139 | + divid = janela[2].id; | ||
| 140 | + $i("i3GEOF.uploadsimbolo_corpo").style.backgroundColor = "white"; | ||
| 141 | + i3GEOF.uploadsimbolo.aguarde = $i("i3GEOF.uploadsimbolo_imagemCabecalho").style; | ||
| 142 | + i3GEOF.uploadsimbolo.inicia(divid); | ||
| 143 | + }, | ||
| 144 | + /* | ||
| 145 | + Function: submete | ||
| 146 | + | ||
| 147 | + Submete o arquivo ao servidor | ||
| 148 | + */ | ||
| 149 | + submete: function(){ | ||
| 150 | + if(i3GEOF.uploadsimbolo.aguarde.visibility==="visible") | ||
| 151 | + {return;} | ||
| 152 | + i3GEOF.uploadsimbolo.aguarde.visibility="visible"; | ||
| 153 | + $i("i3GEOuploadsimbolof").submit(); | ||
| 154 | + }, | ||
| 155 | + selNavegador: function(onde){ | ||
| 156 | + i3GEO.util.navegadorDir(onde,false,false,false); | ||
| 157 | + } | ||
| 158 | +}; | ||
| 159 | + |
| @@ -0,0 +1,139 @@ | @@ -0,0 +1,139 @@ | ||
| 1 | +<?php | ||
| 2 | +// | ||
| 3 | +//caso o usuário seja um administrador, ele pode enviar um nome de diretório onde os arquivos serão armazenados | ||
| 4 | +//na variável $dirDestino | ||
| 5 | +// | ||
| 6 | +require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | ||
| 7 | +require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | ||
| 8 | +include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | ||
| 9 | +error_reporting(0); | ||
| 10 | +if (ob_get_level() == 0) ob_start(); | ||
| 11 | +?> | ||
| 12 | +<html> | ||
| 13 | +<head> | ||
| 14 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | ||
| 15 | +<link rel="stylesheet" type="text/css" href="../../css/geral.css" /> | ||
| 16 | +<title></title> | ||
| 17 | +</head> | ||
| 18 | +<body bgcolor="white" style="background-color:white;text-align:left;"> | ||
| 19 | +<p> | ||
| 20 | +<?php | ||
| 21 | +if (isset($_FILES['i3GEOuploadsimboloarq']['name'])) | ||
| 22 | +{ | ||
| 23 | + require_once (dirname(__FILE__)."/../../ms_configura.php"); | ||
| 24 | + echo "<p class='paragrafo' >Carregando o arquivo...</p>"; | ||
| 25 | + ob_flush(); | ||
| 26 | + flush(); | ||
| 27 | + sleep(1); | ||
| 28 | + if(isset($dirDestino) && $dirDestino != ""){ | ||
| 29 | + $dirmap = $dirDestino; | ||
| 30 | + include_once(dirname(__FILE__)."/../../admin/php/login.php"); | ||
| 31 | + if(verificaOperacaoSessao("admin/php/editortexto") == false){ | ||
| 32 | + echo "Vc nao pode realizar salvar os dados no servidor em uma pasta específica";exit; | ||
| 33 | + } | ||
| 34 | + if(!file_exists($dirmap)) | ||
| 35 | + {echo "<p class='paragrafo' >Pasta não existe no servidor";paraAguarde();exit;} | ||
| 36 | + } | ||
| 37 | + else{ | ||
| 38 | + $dirmap = $locaplic."/simbolos"; | ||
| 39 | + } | ||
| 40 | + //verifica nomes | ||
| 41 | + verificaNome($_FILES['i3GEOuploadsimboloarq']['name']); | ||
| 42 | + $nomePrefixo = basename($_FILES['i3GEOuploadsimboloarq']['name']); | ||
| 43 | + //sobe arquivo | ||
| 44 | + $Arquivo = $_FILES['i3GEOuploadsimboloarq']['tmp_name']; | ||
| 45 | + if(file_exists($dirmap."/".$nomePrefixo.".shp")) | ||
| 46 | + {echo "<p class='paragrafo' >Já existe um SHP com o nome ".$dirmap."/".$nomePrefixo;paraAguarde();exit;} | ||
| 47 | + | ||
| 48 | + $status = move_uploaded_file($Arquivo,$dirmap."/".$nomePrefixo.".shp"); | ||
| 49 | + if($status != 1) | ||
| 50 | + {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo SHP. Pode ser uma limitação quanto ao tamanho do arquivo.";paraAguarde();exit;} | ||
| 51 | + $Arquivo = $_FILES['i3GEOuploadshx']['tmp_name']; | ||
| 52 | + $status = move_uploaded_file($Arquivo,$dirmap."/".$nomePrefixo.".shx"); | ||
| 53 | + if($status != 1) | ||
| 54 | + {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo SHX";paraAguarde();exit;} | ||
| 55 | + $Arquivo = $_FILES['i3GEOuploaddbf']['tmp_name']; | ||
| 56 | + $status = move_uploaded_file($Arquivo,$dirmap."/".$nomePrefixo.".dbf"); | ||
| 57 | + if($status != 1) | ||
| 58 | + {echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo DBF";paraAguarde();exit;} | ||
| 59 | + | ||
| 60 | + if(!file_exists($dirmap."/".$nomePrefixo.".shp")) | ||
| 61 | + {echo "<p class='paragrafo' >Ocorreu algum problema no envio do arquivo ".$dirmap."/".$nomePrefixo;paraAguarde();exit;} | ||
| 62 | + | ||
| 63 | + echo "<p class='paragrafo' >Arquivo enviado.</p>"; | ||
| 64 | + echo "<p class='paragrafo'>Nome: ".$dirmap."/".$nomePrefixo.".shp </p>"; | ||
| 65 | + if(isset($map_file)){ | ||
| 66 | + echo "<p class='paragrafo' >Adicionando tema...</p>"; | ||
| 67 | + ob_flush(); | ||
| 68 | + flush(); | ||
| 69 | + sleep(1); | ||
| 70 | + $novolayer = ms_newLayerObj($mapa); | ||
| 71 | + $novolayer->set("data",$dirmap."/".$nomePrefixo.".shp"); | ||
| 72 | + $novolayer->set("name",$nomePrefixo.".shp"); | ||
| 73 | + $novolayer->setmetadata("TEMA",$nomePrefixo.".shp"); | ||
| 74 | + $novolayer->setmetadata("DOWNLOAD","SIM"); | ||
| 75 | + $sfileObj = ms_newShapefileObj($dirmap."/".$nomePrefixo.".shp", -1); | ||
| 76 | + if(!isset($tipo) || $tipo == "") | ||
| 77 | + {$tipo = $sfileObj->type;} | ||
| 78 | + if ($tipo == 1){$novolayer->set("type",MS_LAYER_POINT);} // ponto | ||
| 79 | + if ($tipo == 3){$novolayer->set("type",MS_LAYER_LINE);} | ||
| 80 | + if ($tipo == 5){$novolayer->set("type",MS_LAYER_POLYGON);} | ||
| 81 | + $novolayer->setmetadata("TEMALOCAL","SIM"); | ||
| 82 | + $novolayer->setmetadata("CLASSE","SIM"); | ||
| 83 | + $novolayer->setmetadata("TEXTO","NAO"); | ||
| 84 | + //if (($tipo != 3) and ($tipo != 8 )){$novolayer->set("type",0);} | ||
| 85 | + $novolayer->setfilter(""); | ||
| 86 | + $classe = ms_newClassObj($novolayer); | ||
| 87 | + $classe->set("name",""); | ||
| 88 | + $estilo = ms_newStyleObj($classe); | ||
| 89 | + if ($tipo == 1) | ||
| 90 | + { | ||
| 91 | + $estilo->set("symbolname","ponto"); | ||
| 92 | + $estilo->set("size",6); | ||
| 93 | + } | ||
| 94 | + $estilo->color->setrgb(200,50,0); | ||
| 95 | + $estilo->outlinecolor->setrgb(0,0,0); | ||
| 96 | + // le os itens | ||
| 97 | + $novolayer->set("status",MS_DEFAULT); | ||
| 98 | + $abriu = $novolayer->open(); | ||
| 99 | + $items = $novolayer->getItems(); | ||
| 100 | + $fechou = $novolayer->close(); | ||
| 101 | + if ($items != "") | ||
| 102 | + { | ||
| 103 | + $its = implode(",",$items); | ||
| 104 | + $novolayer->setmetadata("ITENS",$its); | ||
| 105 | + $novolayer->setmetadata("ITENSDESC",$its); | ||
| 106 | + $novolayer->set("template","none.htm"); | ||
| 107 | + } | ||
| 108 | + if(isset($uploadEPSG) && $uploadEPSG != "") | ||
| 109 | + {$novolayer->setProjection("init=epsg:".$uploadEPSG);} | ||
| 110 | + //$adiciona = ms_newLayerObj($mapa, $novolayer); | ||
| 111 | + $salvo = $mapa->save($map_file); | ||
| 112 | + //grava os templates de cada tema | ||
| 113 | + echo "<b><p class='paragrafo' >Tema criado!!! Redesenhando o mapa."; | ||
| 114 | + echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; | ||
| 115 | + } | ||
| 116 | +} | ||
| 117 | +else | ||
| 118 | +{ | ||
| 119 | + echo "<p class='paragrafo' >Erro ao enviar o arquivo. Talvez o tamanho do arquivo seja maior do que o permitido.</p>"; | ||
| 120 | +} | ||
| 121 | +paraAguarde(); | ||
| 122 | +function paraAguarde(){ | ||
| 123 | + echo "<script>try{window.scrollTo(0,10000);window.parent.i3GEOF.upload.aguarde.visibility='hidden';}catch(e){};</script>"; | ||
| 124 | +} | ||
| 125 | +function verificaNome($nome) | ||
| 126 | +{ | ||
| 127 | + $nome = strtolower($nome); | ||
| 128 | + $lista = explode(".",$nome); | ||
| 129 | + $extensao = $lista[count($lista) - 1]; | ||
| 130 | + if(($extensao != "dbf") && ($extensao != "shx") && ($extensao != "shp")) | ||
| 131 | + { | ||
| 132 | + echo "Nome de arquivo inválido."; | ||
| 133 | + paraAguarde(); | ||
| 134 | + exit; | ||
| 135 | + } | ||
| 136 | +} | ||
| 137 | +?> | ||
| 138 | +</body> | ||
| 139 | +</html> |