From a2547eabcc8f484c69f256f10e802b971a1a9f4b Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 18 Sep 2007 19:42:44 +0000 Subject: [PATCH] Incluida opção de navegação pelos diretórios do servidor para acesso direto a arquivos shp e tif. Apenas usuários cadastrados no ms_configura podem utilizar essa opção. --- classesjs/ferramentas.js | 7 +++++++ classesjs/ferramentas_compacto.js | 1 + classesjs/funcoes.js | 5 +++++ classesjs/funcoes_compacto.js | 3 ++- classesjs/i3geo_tudo_compacto.js | 6 ++++-- classesjs/iniciamma.js | 8 ++++++++ classesjs/iniciamma_compacto.js | 2 +- classesphp/classe_mapa.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ classesphp/funcoes_gerais.php | 17 +++++++++++++++++ classesphp/mapa_controle.php | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- classesphp/mapa_inicia.php | 10 +++++++--- ferramentas/navegacaodir/index.htm | 21 +++++++++++++++++++++ ferramentas/navegacaodir/index.js | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ imagens/desktop.png | Bin 0 -> 467 bytes imagens/desktop.svg | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ms_configura.php | 12 +++++++++++- ms_criamapa.php | 5 +++++ 17 files changed, 471 insertions(+), 10 deletions(-) create mode 100644 ferramentas/navegacaodir/index.htm create mode 100644 ferramentas/navegacaodir/index.js create mode 100644 imagens/desktop.png create mode 100644 imagens/desktop.svg diff --git a/classesjs/ferramentas.js b/classesjs/ferramentas.js index 0488010..45bb388 100644 --- a/classesjs/ferramentas.js +++ b/classesjs/ferramentas.js @@ -489,6 +489,13 @@ function editaLegenda(idtema) Section: adição de temas */ /* +Function: navegacaoDir + +Adiciona temas navegando pelos diretórios do servidor +*/ +function navegacaoDir() +{wdocaf("550px","350px",g_locaplic+"/ferramentas/navegacaodir/index.htm","","","");} +/* Function: conectarwms Adiciona temas tendo como fonte um web service do tipo wms diff --git a/classesjs/ferramentas_compacto.js b/classesjs/ferramentas_compacto.js index 34dc675..28790c3 100644 --- a/classesjs/ferramentas_compacto.js +++ b/classesjs/ferramentas_compacto.js @@ -43,6 +43,7 @@ function etiquetas(idtema){wdocaf("400px","300px",g_locaplic+"/ferramentas/etiqu function opcoesLegenda(){wdocaf("300px","280px",g_locaplic+"/ferramentas/opcoes_legenda/index.htm","","","Legenda");} function abreCor(janela,elemento){wdocaf2("385px","280px",g_locaplic+"/ferramentas/colorpicker/index.htm?doc="+janela+"&elemento="+elemento,"","","Cor");} function editaLegenda(idtema){wdocaf("490px","340px",g_locaplic+"/ferramentas/legenda/index.htm?tema="+idtema,"","","Legenda");} +function navegacaoDir(){wdocaf("550px","350px",g_locaplic+"/ferramentas/navegacaodir/index.htm","","","");} function conectarwms(){wdocaf("400px","300px",g_locaplic+"/ferramentas/conectarwms/index.htm","","","WMS");} function conectarwfs(){wdocaf("400px","300px",g_locaplic+"/ferramentas/conectarwfs/index.htm","","","WFS");} function conectargeorss(){wdocaf("400px","300px",g_locaplic+"/ferramentas/conectargeorss/index.htm","","","GeoRSS");} diff --git a/classesjs/funcoes.js b/classesjs/funcoes.js index cc6b3cd..0b67239 100644 --- a/classesjs/funcoes.js +++ b/classesjs/funcoes.js @@ -2372,6 +2372,11 @@ function processaGrupos(retorno) if (g_conectargeorss == "sim") {upload += "
 Conectar com GeoRss
";} $i(objmapa.guiaMenu+"obj").innerHTML += upload; + if (objmapa.navegacaoDir == "sim") + { + var temp = "
 Acesso aos arquivos do servidor
"; + $i(objmapa.guiaMenu+"obj").innerHTML += temp; + } //arvore MMA mytreeview2 = new Object(); mytreeview2 = treeviewNew("mytreeview2", "default", objmapa.guiaMenu+"obj", null); diff --git a/classesjs/funcoes_compacto.js b/classesjs/funcoes_compacto.js index 241d305..ed9bc8f 100644 --- a/classesjs/funcoes_compacto.js +++ b/classesjs/funcoes_compacto.js @@ -255,7 +255,8 @@ function processaGrupos(retorno){ if((retorno.data !="erro")&&(retorno.data !=un if(g_downloadbase=="sim"){upload+="
 Download de dados
";} if(g_conectarwms=="sim"){upload+="
 Conectar com servidor WMS
";} if(g_conectargeorss=="sim"){upload+="
 Conectar com GeoRss
";} - $i(objmapa.guiaMenu+"obj").innerHTML+=upload; mytreeview2=new Object(); mytreeview2=treeviewNew("mytreeview2", "default", objmapa.guiaMenu+"obj", null); mytreeview2.createItem("item1", "Temas", g_locaplic+"/imagens/visual/"+g_visual+"/temas.png", true, true, true, null); mytreeview2.itemExpand=expandeGrupo; for(i=0;i"+ngSgrupo[sg].nome+""; else var nomeSgrupo=""+ngSgrupo[sg].nome+""; mytreeview2.createItem("sgrupo_"+i+"_"+sg, nomeSgrupo, imgBranco, true, true, false, "grupo"+i); if(cor=="rgb(230,230,230)"){var cor="rgb(255,255,255)";} + $i(objmapa.guiaMenu+"obj").innerHTML+=upload; if(objmapa.navegacaoDir=="sim"){ var temp="
 Acesso aos arquivos do servidor
"; $i(objmapa.guiaMenu+"obj").innerHTML+=temp;} + mytreeview2=new Object(); mytreeview2=treeviewNew("mytreeview2", "default", objmapa.guiaMenu+"obj", null); mytreeview2.createItem("item1", "Temas", g_locaplic+"/imagens/visual/"+g_visual+"/temas.png", true, true, true, null); mytreeview2.itemExpand=expandeGrupo; for(i=0;i"+ngSgrupo[sg].nome+""; else var nomeSgrupo=""+ngSgrupo[sg].nome+""; mytreeview2.createItem("sgrupo_"+i+"_"+sg, nomeSgrupo, imgBranco, true, true, false, "grupo"+i); if(cor=="rgb(230,230,230)"){var cor="rgb(255,255,255)";} else{var cor="rgb(230,230,230)";}} var ngtSgrupo=retorno.data.grupos[i].temasgrupo; for(sgt=0;sgt fonte";} var tid=no.tid; var inp=""; if(navm) nomeTema=" "+inp+nome+lk; else nomeTema=""+inp+nome+lk+""; mytreeview2.createItem("sgrupo_"+i+"_"+sg+"_"+sgt, nomeTema, imgBranco, false, true, false, "grupo"+i);}} diff --git a/classesjs/i3geo_tudo_compacto.js b/classesjs/i3geo_tudo_compacto.js index ed63efd..2864870 100644 --- a/classesjs/i3geo_tudo_compacto.js +++ b/classesjs/i3geo_tudo_compacto.js @@ -1015,7 +1015,8 @@ function processaGrupos(retorno){ if((retorno.data !="erro")&&(retorno.data !=un if(g_downloadbase=="sim"){upload+="
 Download de dados
";} if(g_conectarwms=="sim"){upload+="
 Conectar com servidor WMS
";} if(g_conectargeorss=="sim"){upload+="
 Conectar com GeoRss
";} - $i(objmapa.guiaMenu+"obj").innerHTML+=upload; mytreeview2=new Object(); mytreeview2=treeviewNew("mytreeview2", "default", objmapa.guiaMenu+"obj", null); mytreeview2.createItem("item1", "Temas", g_locaplic+"/imagens/visual/"+g_visual+"/temas.png", true, true, true, null); mytreeview2.itemExpand=expandeGrupo; for(i=0;i"+ngSgrupo[sg].nome+""; else var nomeSgrupo=""+ngSgrupo[sg].nome+""; mytreeview2.createItem("sgrupo_"+i+"_"+sg, nomeSgrupo, imgBranco, true, true, false, "grupo"+i); if(cor=="rgb(230,230,230)"){var cor="rgb(255,255,255)";} + $i(objmapa.guiaMenu+"obj").innerHTML+=upload; if(objmapa.navegacaoDir=="sim"){ var temp="
 Acesso aos arquivos do servidor
"; $i(objmapa.guiaMenu+"obj").innerHTML+=temp;} + mytreeview2=new Object(); mytreeview2=treeviewNew("mytreeview2", "default", objmapa.guiaMenu+"obj", null); mytreeview2.createItem("item1", "Temas", g_locaplic+"/imagens/visual/"+g_visual+"/temas.png", true, true, true, null); mytreeview2.itemExpand=expandeGrupo; for(i=0;i"+ngSgrupo[sg].nome+""; else var nomeSgrupo=""+ngSgrupo[sg].nome+""; mytreeview2.createItem("sgrupo_"+i+"_"+sg, nomeSgrupo, imgBranco, true, true, false, "grupo"+i); if(cor=="rgb(230,230,230)"){var cor="rgb(255,255,255)";} else{var cor="rgb(230,230,230)";}} var ngtSgrupo=retorno.data.grupos[i].temasgrupo; for(sgt=0;sgt fonte";} var tid=no.tid; var inp=""; if(navm) nomeTema=" "+inp+nome+lk; else nomeTema=""+inp+nome+lk+""; mytreeview2.createItem("sgrupo_"+i+"_"+sg+"_"+sgt, nomeTema, imgBranco, false, true, false, "grupo"+i);}} @@ -1175,6 +1176,7 @@ function etiquetas(idtema){wdocaf("400px","300px",g_locaplic+"/ferramentas/etiqu function opcoesLegenda(){wdocaf("300px","280px",g_locaplic+"/ferramentas/opcoes_legenda/index.htm","","","Legenda");} function abreCor(janela,elemento){wdocaf2("385px","280px",g_locaplic+"/ferramentas/colorpicker/index.htm?doc="+janela+"&elemento="+elemento,"","","Cor");} function editaLegenda(idtema){wdocaf("490px","340px",g_locaplic+"/ferramentas/legenda/index.htm?tema="+idtema,"","","Legenda");} +function navegacaoDir(){wdocaf("550px","350px",g_locaplic+"/ferramentas/navegacaodir/index.htm","","","");} function conectarwms(){wdocaf("400px","300px",g_locaplic+"/ferramentas/conectarwms/index.htm","","","WMS");} function conectarwfs(){wdocaf("400px","300px",g_locaplic+"/ferramentas/conectarwfs/index.htm","","","WFS");} function conectargeorss(){wdocaf("400px","300px",g_locaplic+"/ferramentas/conectargeorss/index.htm","","","GeoRSS");} @@ -1265,7 +1267,7 @@ function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor document.body.style.width=novow; document.body.style.height=novoh; this.w=parseInt(document.body.style.width)-menos-diminuix; this.h=parseInt(document.body.style.height)-diminuiy; if(document.getElementById("corpoMapa")){ if(document.getElementById("corpoMapa").style.width){ this.w=parseInt(document.getElementById("corpoMapa").style.width); this.h=parseInt(document.getElementById("corpoMapa").style.height);}}} else{ this.w=document.body.offsetWidth-parseInt($i("contemFerramentas").style.width)-diminuix; this.h=document.body.offsetHeight-diminuiy;} if($i("openlayers")){ $i("openlayers").style.width=this.w; $i("openlayers").style.height=this.h;} - this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!window.testafuncoes){alert("funcoes.js com problemas");} + this.navegacaoDir="nao"; this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!window.testafuncoes){alert("funcoes.js com problemas");} if(!window.testamenususpenso){alert("menususpenso.js com problemas");} if(!window.testaferramentas){alert("ferramentas.js com problemas");} if(!window.testaajax){alert("redesenho.js com problemas");} diff --git a/classesjs/iniciamma.js b/classesjs/iniciamma.js index 770885f..d93855d 100644 --- a/classesjs/iniciamma.js +++ b/classesjs/iniciamma.js @@ -577,6 +577,14 @@ function Mapa(e,m) $i("openlayers").style.height = this.h; } /* + Variable: objmapa.navegacaoDir + + Indica se deve ser incluida a opção de navegação nos diretórios do servidor. + + A indicação sim|nao é obtida na inicialização do i3geo, e é definido no ms_configura.php + */ + this.navegacaoDir = "nao"; + /* Variable: objmapa.listavisual String com a lista de visuais disponíveis no i3geo. diff --git a/classesjs/iniciamma_compacto.js b/classesjs/iniciamma_compacto.js index a696592..2147548 100644 --- a/classesjs/iniciamma_compacto.js +++ b/classesjs/iniciamma_compacto.js @@ -10,7 +10,7 @@ function Mapa(e,m){ objaguarde=new aguarde(); objposicaocursor=new posicaocursor document.body.style.width=novow; document.body.style.height=novoh; this.w=parseInt(document.body.style.width)-menos-diminuix; this.h=parseInt(document.body.style.height)-diminuiy; if(document.getElementById("corpoMapa")){ if(document.getElementById("corpoMapa").style.width){ this.w=parseInt(document.getElementById("corpoMapa").style.width); this.h=parseInt(document.getElementById("corpoMapa").style.height);}}} else{ this.w=document.body.offsetWidth-parseInt($i("contemFerramentas").style.width)-diminuix; this.h=document.body.offsetHeight-diminuiy;} if($i("openlayers")){ $i("openlayers").style.width=this.w; $i("openlayers").style.height=this.h;} - this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!window.testafuncoes){alert("funcoes.js com problemas");} + this.navegacaoDir="nao"; this.listavisual=""; this.visualatual="default"; this.funcoesClickMapa=new Array(); this.objtips=new Array(); this.tempo=""; this.tempoRedesenho=""; this.contaTempoRedesenho=""; this.temaAtivo=""; this.pinmarca="marca"; this.pintamanho="5"; this.scale=50000; this.temas=""; this.legenda=""; this.finaliza=""; this.guiaTemas="guia1"; this.guiaMenu="guia2"; this.guiaLegenda="guia4"; this.guiaListaMapas="guia5"; this.inicializa=function(){ if(!window.testafuncoes){alert("funcoes.js com problemas");} if(!window.testamenususpenso){alert("menususpenso.js com problemas");} if(!window.testaferramentas){alert("ferramentas.js com problemas");} if(!window.testaajax){alert("redesenho.js com problemas");} diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index b92e0df..0ffade7 100644 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -1057,5 +1057,53 @@ $canal - Identificador do canal (ordem em que está no RSS) } return("erro"); } +/* +Method: adicionaTemaSHP + +Adiciona um tema a partir de um arquivo shape file armazenado no servidor de arquivos. + +Parameters: +$arq - Nome do shape file. +*/ + function adicionaTemaSHP($arq) + { + if (file_exists($arq)) + { + $s = ms_newShapefileObj($arq,-1); + $shape = $s->getShape(0); + $t = $shape->type; + $tipo = MS_LAYER_POLYGON; + if ($t == 0) + {$tipo = MS_LAYER_POINT;} + if ($t == 1) + {$tipo = MS_LAYER_LINE;} + $layer = criaLayer($this->mapa,$tipo,MS_DEFAULT,basename($arq),"SIM"); + $layer->set("data",$arq); + $layer->set("name",basename($arq)); + $layer->setmetadata("DOWNLOAD","nao"); + $layer->setmetadata("TEMALOCAL","NAO"); + } + return("ok"); + } +/* +Method: adicionaTemaIMG + +Adiciona um tema a partir de um arquivo imagem armazenado no servidor de arquivos. + +Parameters: +$arq - Nome do arquivo. +*/ + function adicionaTemaIMG($arq) + { + if (file_exists($arq)) + { + $layer = criaLayer($this->mapa,MS_LAYER_RASTER,MS_DEFAULT,basename($arq),"SIM"); + $layer->set("data",$arq); + $layer->set("name",basename($arq)); + $layer->setmetadata("DOWNLOAD","nao"); + $layer->setmetadata("TEMALOCAL","NAO"); + } + return("ok"); + } } ?> \ No newline at end of file diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index 5e7553f..31d17c7 100644 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -1408,4 +1408,21 @@ function downloadTema($map_file,$tema,$locaplic,$dir_tmp) } return(implode(",",$resultado)); } +/* +Section: Outros +*/ +/* +function: pegaIPcliente + +Pega o IP do cliente +*/ +function pegaIPcliente() +{ + $ip = "UNKNOWN"; + if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); + else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); + else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); + else $ip = "UNKNOWN"; + return $ip; +} ?> \ No newline at end of file diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index f8cfc49..d48bc34 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -119,8 +119,8 @@ if (!isset($map_file)) exit; } require_once("classe_vermultilayer.php"); -require_once ("classe_estatistica.php"); -require_once ("funcoes_gerais.php"); +require_once("classe_estatistica.php"); +require_once("funcoes_gerais.php"); // //copia o map_file atual com outro nome para restaurar caso ocorra algum problema @@ -474,6 +474,46 @@ Include: } break; /* +Property: adicionaTemaSHP + +Adiciona um tema baseado em um arquivo shape file. + +Include: + +*/ + case "adicionaTemaSHP": + include("classe_mapa.php"); + $m = new Mapa($map_file); + $retorno = $m->adicionaTemaSHP($arq); + $cp->set_data($retorno); + if ($retorno != "erro") + {$m->salva();redesenhaMapa();} + else + { + $cp->set_data("erro.Nenhum dado espacializado foi encontrado."); + } + break; +/* +Property: adicionaTemaIMG + +Adiciona um tema baseado em um arquivo de imagem. + +Include: + +*/ + case "adicionaTemaIMG": + include("classe_mapa.php"); + $m = new Mapa($map_file); + $retorno = $m->adicionaTemaIMG($arq); + $cp->set_data($retorno); + if ($retorno != "erro") + {$m->salva();redesenhaMapa();} + else + { + $cp->set_data("erro.Nenhum dado espacializado foi encontrado."); + } + break; +/* Property: listatemas Lista os temas existentes em um mapa. @@ -608,6 +648,29 @@ Section: Temas Processa os layers do mapa. */ + +/* +Property: listaDrives + +Pega a lista de drives registrados para o usuário atual. + +A lista de drives é definida no ms_configura e permite que o usuário navegue pelos arquivos do servidor. + +Include: + +*/ + case "listaDrives": + include("../ms_configura.php"); + //verifica se está cadastrado + $ipcliente = pegaIPcliente(); + $retorno = array(); + foreach ($navegadoresLocais as $n) + { + if (gethostbyname($n["ip"]) == $ipcliente) + {$retorno[] = $n["drives"];} + } + $cp->set_data($retorno); + break; /* Property: alterarepresentacao diff --git a/classesphp/mapa_inicia.php b/classesphp/mapa_inicia.php index 8401cc1..7a7c743 100644 --- a/classesphp/mapa_inicia.php +++ b/classesphp/mapa_inicia.php @@ -37,6 +37,8 @@ Inicia um mapa, pegando os parâmetros necessários. Parameters: +navegadoresLocais - array que indica quais usuários podem navegar no servidor + cp - Objeto CPAINT. embedLegenda - inclui a legenda no corpo do mapa sim|nao @@ -57,7 +59,7 @@ R_path - Variável definida no arquivo ms_configura.php que indica se o software locmapas - Variável definida no arquivo ms_configura.php que indica se a guia de mapas deve ser mostrada. -locmapserve - Variável definida no arquivo ms_configura.php que indica nome do mapserver cgi. +locmapserv - Variável definida no arquivo ms_configura.php que indica nome do mapserver cgi. postgis_con - Variável definida no arquivo ms_configura.php que indica qual conexão postgis deve ser utilizada (algumas funções de análise utilizam essa conexão, se existir) @@ -83,7 +85,7 @@ Essa string é recuperada no lado do javascript com eval(). */ function iniciaMapa() { - global $locaplic,$cp,$embedLegenda,$map_file,$mapext,$w,$h,$locsistemas,$locidentifica,$R_path,$locmapas,$locmapserv,$postgis_con; + global $navegadoresLocais,$locaplic,$cp,$embedLegenda,$map_file,$mapext,$w,$h,$locsistemas,$locidentifica,$R_path,$locmapas,$locmapserv,$postgis_con; if (!file_exists($locaplic)) {$cp->set_data("erro. $locaplic nao existe (variavel locaplic - corrija o ms_configura.php)");return;} if (!file_exists($map_file)) @@ -174,7 +176,9 @@ function iniciaMapa() $visual = ""; if (file_exists($locaplic."/imagens/visual")) {$visual = implode(",",listaDiretorios($locaplic."/imagens/visual"));} - $res .= ";objmapa.listavisual='".$visual."';"; + $res .= ";objmapa.listavisual='".$visual."'"; + //pega os usuários navegadores + $res .= ";objmapa.navegacaoDir='".$navegadoresLocais."';"; if (function_exists("mb_convert_encoding")) {$res = mb_convert_encoding($res,"UTF-8","ISO-8859-1");} // diff --git a/ferramentas/navegacaodir/index.htm b/ferramentas/navegacaodir/index.htm new file mode 100644 index 0000000..e441ff1 --- /dev/null +++ b/ferramentas/navegacaodir/index.htm @@ -0,0 +1,21 @@ + + + + + + + + +
+
arquivos
+ + + + + + + + + + + diff --git a/ferramentas/navegacaodir/index.js b/ferramentas/navegacaodir/index.js new file mode 100644 index 0000000..12bf89e --- /dev/null +++ b/ferramentas/navegacaodir/index.js @@ -0,0 +1,90 @@ +parametrosURL() +mytreeview2 = new Object(); +listaDrives(); +function listaDrives() +{ + var montaListaDrives = function(retorno) + { + retorno = retorno.data[0]; + if ((retorno != "erro") && (retorno != undefined)) + { + mytreeview2 = treeviewNew("mytreeview2", "default", "arvoreL", null); + mytreeview2.createItem("drives", "Drives", g_locaplic+"/imagens/temas.png", true, true, true, null); + mytreeview2.itemExpand = expandeItem; + for (ig=0;ig"+retorno.data[ig]+"" + mytreeview2.createItem(id, nome, g_locaplic+"/imagens/folder-s.gif", true, true, true, itemID); + } + } + listaarquivos(itemID) + } + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listaDiretorios&diretorio="+itemID; + var cp = new cpaint(); + //cp.set_debug(2) + cp.set_response_type("JSON"); + cp.call(p,"listaDrives",montaLista); +} +function listaarquivos(id) +{ + var montaLista = function(retorno) + { + var ins = ""+id+"

" + if ((retorno.data != "erro") && (retorno.data != undefined)) + { + var cor = "rgb(240,240,240)" + for (ig=0;ig"+retorno.data.arquivos[ig]+"
" + if (cor == "rgb(240,240,240)") + {var cor = "white"} + else + {cor = "rgb(240,240,240)"} + } + } + + } + $i("arquivosL").innerHTML = ins; + } + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listaArquivos&diretorio="+id; + var cp = new cpaint(); + //cp.set_debug(2) + cp.set_response_type("JSON"); + cp.call(p,"listaDrives",montaLista); +} +function incluir(path) +{ + var temp = path.split(".") + if ((temp[1] == "SHP") || (temp[1] == "shp")) + {var f = "adicionaTemaSHP";} + else + {var f = "adicionaTemaIMG";} + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao="+f+"&arq="+path; + var cp = new cpaint(); + //cp.set_debug(2) + cp.set_response_type("JSON"); + cp.call(p,f,window.parent.ajaxredesenha); +} diff --git a/imagens/desktop.png b/imagens/desktop.png new file mode 100644 index 0000000..546b8d2 Binary files /dev/null and b/imagens/desktop.png differ diff --git a/imagens/desktop.svg b/imagens/desktop.svg new file mode 100644 index 0000000..b27bca3 --- /dev/null +++ b/imagens/desktop.svg @@ -0,0 +1,179 @@ + + + + + + + Clipart by Nicu Buculei - antenna + + + + hash + + hardware + computer + + + + + Nicu Buculei + + + + + Nicu Buculei + + + + + Nicu Buculei + + + + image/svg+xml + + + en + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ms_configura.php b/ms_configura.php index 4ef2cf8..532640c 100644 --- a/ms_configura.php +++ b/ms_configura.php @@ -61,7 +61,17 @@ postgis_mapa - string de conexão com o banco de dados para substituição do CONNE $mensagemInicia = "I3Geo versão 3.7"; if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { - //ip dos usuarios que podem administrar via navegador + //ip dos usuarios que podem navegar no servidor para acessar arquivos de dados geográficos + $navegadoresLocais = array( + array( + "ip"=>"127.0.0.1", + "drives"=>array( + array("caminho"=>"c:/","nome"=>"c"), + array("caminho"=>"d:/","nome"=>"d") + ) + ) + ); + //ip dos usuarios que podem administrar via navegador. Separe os ips por vírgula $editores = array("127.0.0.1"); //caminho completo do diretório temporário utilizado pelo mapserver $dir_tmp = "c:/ms4w/tmp/ms_tmp"; diff --git a/ms_criamapa.php b/ms_criamapa.php index 4cc341b..6fc1eab 100644 --- a/ms_criamapa.php +++ b/ms_criamapa.php @@ -101,6 +101,10 @@ $debug_ = $debug; $ler_extensoes_ = $ler_extensoes; $postgis_mapa_ = $postgis_mapa; $perfil_ = $perfil; +if ((isset($navegadoresLocais)) && ($navegadoresLocais != "")) +$navegadoresLocais_ = "sim"; +else +$navegadoresLocais_ = "nao"; // //inicia a sessão // @@ -131,6 +135,7 @@ $_SESSION["debug"] = $debug_; $_SESSION["ler_extensoes"] = $ler_extensoes_; $_SESSION["postgis_mapa"] = $postgis_mapa_; $_SESSION["perfil"] = $perfil_; +$_SESSION["navegadoresLocais"] = $navegadoresLocais_; // //pega todas as variáveis da sessão // -- libgit2 0.21.2