From badb489f26006e366b442a1c137c1730865198fe Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Sun, 23 Oct 2011 22:30:50 +0000 Subject: [PATCH] --- admin/js/editormapfile.js | 304 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------- admin/php/editormapfile.php | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------- 2 files changed, 250 insertions(+), 271 deletions(-) diff --git a/admin/js/editormapfile.js b/admin/js/editormapfile.js index 6425ac4..90816ee 100644 --- a/admin/js/editormapfile.js +++ b/admin/js/editormapfile.js @@ -370,6 +370,14 @@ function montaParametrosTemas(no,dados,redesenha) var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); tempNode.isLeaf = true; } + if(!tree.getNodeByProperty("etiquetaComport",id)) + { + conteudo = " Comportamento no mapa" + var d = {tipo:"etiquetaComport",etiquetaComport:id,html:conteudo} + var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); + tempNode.isLeaf = true; + } + if(!tree.getNodeByProperty("etiquetaDispo",id)) { conteudo = " Disponibilidade (download, wms,...)" @@ -380,18 +388,11 @@ function montaParametrosTemas(no,dados,redesenha) //rever if(!tree.getNodeByProperty("etiquetaMetadados",id)) { - conteudo = " Editar metaparâmetros" + conteudo = " Miscelânea" var d = {tipo:"etiquetaMetadados",etiquetaMetadados:id,html:conteudo} var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); tempNode.isLeaf = true; } - if(!tree.getNodeByProperty("etiquetaGeral",id)) - { - conteudo = " Editar características gerais" - var d = {tipo:"etiquetaGeral",etiquetaGeral:id,html:conteudo} - var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); - tempNode.isLeaf = true; - } var tempNodeR = no; if(!tree.getNodeByProperty("etiquetaClasses",id)) { @@ -1062,6 +1063,20 @@ function editorDados(codigoMap,codigoLayer) core_pegaDados("Obtendo dados...",sUrl,"montaEditorDados") } /* +Function: editorComport + +Abre o editor das opções que controlam o comportamento do layer no mapa + + +*/ +function editorComport(codigoMap,codigoLayer) +{ + core_montaEditor("","450px","650px") + var sUrl = "../php/editormapfile.php?funcao=pegaComport&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + core_pegaDados("Obtendo dados...",sUrl,"montaEditorComport") +} + +/* Function: editorTitulo Abre o editor de título e descrição @@ -1155,6 +1170,111 @@ function editorEstilo(codigoMap,codigoLayer,indiceClasse,indiceEstilo) var sUrl = "../php/editormapfile.php?funcao=pegaEstilo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse+"&indiceEstilo="+indiceEstilo; core_pegaDados("Obtendo dados...",sUrl,"montaEditorEstilo") } +function montaEditorComport(dados) +{ + var param = { + "linhas":[ + {ajuda:"Sets the current status of the layer. Often modified by MapServer itself. Default turns the layer on permanently", + titulo:"Status",id:"",value:dados.status,tipo:"text",div:"
"}, + {ajuda:"Indica se o tema irá ser mostrado na ferramenta de identificação", + titulo:"Identifica (IDENTIFICA)",id:"",value:dados.identifica,tipo:"text",div:"
"}, + {ajuda:"Sets the opacity level (or the inability to see through the layer) of all classed pixels for a given layer. The value can either be an integer in the range (0-100) or the named symbol 'ALPHA'. A value of 100 is opaque and 0 is fully transparent. Implemented in MapServer 5.0, to replace the deprecated TRANSPARENCY parameter.The 'ALPHA' symbol directs the MapServer rendering code to honor the indexed or alpha transparency of pixmap symbols used to style a layer. This is only needed in the case of RGB output formats, and should be used only when necessary as it is expensive to render transparent pixmap symbols onto an RGB map image.", + titulo:"Opacity",id:"opacity",value:dados.opacity,tipo:"text"}, + {ajuda:"Indica se a extensão geográfica do mapa deve ser alterada quando o tema for adicionado ao mapa", + titulo:"Aplica extensao (APLICAEXTENSAO)",id:"",value:dados.aplicaextensao,tipo:"text",div:"
"}, + {ajuda:"Indica se o usuário pode incluir comentários no tema", + titulo:"Permite comentar (PERMITECOMENTARIO)",id:"",value:dados.permitecomentario,tipo:"text",div:"
"}, + {ajuda:"Temporizador (em segundos) para atualização automática da camada. A camada será redesenhada continuamente a cada intervalo de tempo definido", + titulo:"Temporizador em segundos (METADATA: TEMPORIZADOR)",id:"temporizador",value:dados.temporizador,tipo:"text"}, + {ajuda:"Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM. ", + titulo:"Classe (CLASSE)",id:"",value:dados.classe,tipo:"text",div:"
"}, + {ajuda:"URL de uma imagem que será utilizada em substituição à geração normal da legenda ", + titulo:"URL da legenda (opcional) (LEGENDAIMG)",id:"legendaimg",value:dados.legendaimg,tipo:"text"}, + {ajuda:"Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'", + titulo:"Escondido (ESCONDIDO)",id:"",value:dados.escondido,tipo:"text",div:"
"}, + {ajuda:"Aplica efeitos de transição nas operações de zoom e pan na interface Openlayers", + titulo:"Efeitos de transição zoom (TRANSITIONEFFECT)",id:"",value:dados.transitioneffect,tipo:"text",div:"
"}, + {ajuda:"Sets the color index to treat as transparent for raster layers.", + titulo:"Offsite (R,G,B) (utilize -1,-1,-1 para anular o valor)",id:"offsite",value:dados.offsite,tipo:"text"}, + {ajuda:"Maximum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", + titulo:"Maxscale (utilize -1 para anular o valor)",id:"maxscale",value:dados.maxscale,tipo:"text"}, + {ajuda:"Minimum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", + titulo:"Minscale (utilize -1 para anular o valor)",id:"minscale",value:dados.minscale,tipo:"text"}, + {ajuda:"Item name in attribute table to use for class annotation (i.e. labeling).", + titulo:"Labelitem",id:"labelitem",value:dados.labelitem,tipo:"text"}, + {ajuda:"Maximum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", + titulo:"Labelmaxscale (utilize -1 para anular o valor)",id:"labelmaxscale",value:dados.labelmaxscale,tipo:"text"}, + {ajuda:"Minimum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", + titulo:"Labelminscale (utilize -1 para anular o valor)",id:"labelminscale",value:dados.labelminscale,tipo:"text"}, + {ajuda:"The scale at which symbols and/or text appear full size. This allows for dynamic scaling of objects based on the scale of the map. If not set then this layer will always appear at the same size. Scaling only takes place within the limits of MINSIZE and MAXSIZE as described above. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", + titulo:"Symbolscale (utilize -1 para anular o valor)",id:"symbolscale",value:dados.symbolscale,tipo:"text"}, + {ajuda:"Sensitivity for point based queries (i.e. via mouse and/or map coordinates). Given in TOLERANCEUNITS. If the layer is a POINT or a LINE, the default is 3. For all other layer types, the default is 0. To restrict polygon searches so that the point must occur in the polygon set the tolerance to zero.", + titulo:"Tolerance",id:"tolerance",value:dados.tolerance,tipo:"text"}, + {ajuda:" ", + titulo:"Tolerance units",id:"",value:dados.toleranceunits,tipo:"text",div:"
"}, + {ajuda:"Sets the unit of CLASS object SIZE values (default is pixels). Useful for simulating buffering", + titulo:"Sizeunits",id:"",value:dados.sizeunits,tipo:"text",div:"
"} + ] + } + var ins = "" + ins += core_geraLinhas(param) + ins += "


" + $i("editor_bd").innerHTML = ins + + if($i("cAplicaextensao")){ + temp = "" + $i("cAplicaextensao").innerHTML = temp + } + if($i("cPermitecomentario")){ + temp = "" + $i("cPermitecomentario").innerHTML = temp + } + if($i("cClasse")){ + temp = "

" + $i("cClasse").innerHTML = temp + } + if($i("cEscondido")){ + temp = "" + $i("cEscondido").innerHTML = temp + } + if($i("cIdentifica")){ + temp = "" + $i("cIdentifica").innerHTML = temp + } + if($i("cTransitioneffect")){ + temp = "" + $i("cTransitioneffect").innerHTML = temp + } + temp = "" + $i("cStatus").innerHTML = temp + + temp = "" + $i("cSizeunits").innerHTML = temp + temp = "" + $i("cToleranceunits").innerHTML = temp + + var temp = function() + {salvarDadosEditor('comport',dados.codigoMap,dados.codigoLayer,false)} + new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); +} function montaEditorTitulo(dados) { @@ -1162,16 +1282,18 @@ function montaEditorTitulo(dados) "linhas":[ {ajuda:"Elemento 'NAME'. Não confunda com o nome que aparece no mapa ou na árvore de temas. Normalmente o código recebe o mesmo nome do arquivo mapfile, sem a extensão '.map'", titulo:"Código do layer",id:"name",value:dados.name,tipo:"text"}, + {ajuda:"Name of a group that this layer belongs to. The group name can then be reference as a regular layer name in the template files, allowing to do things like turning on and off a group of layers at once.", + titulo:"Group",id:"group",value:dados.group,tipo:"text"}, {ajuda:"Nome que será utilizado na legenda do mapa e na guia 'Temas'", titulo:"Título (METADATA: TEMA)",id:"tema",value:dados.tema,tipo:"text"}, - {ajuda:"Ícone que será mostrado na árvore de camadas. A imagem deve existir na web e deve ser incluído o caminho completo ou relativo em relação ao local da interface HTML do mapa.", - titulo:"Ícone (METADATA: ICONETEMA)",id:"iconetema",value:dados.iconetema,tipo:"text"}, - {ajuda:"Mensagem que será mostrada no rodapé do mapa quando o tema estiver visível. É útil para apresentar ao usuário observações especiais sobre o uso daquele tema.", - titulo:"Mensagem (MENSAGEM)",id:"mensagem",value:dados.mensagem,tipo:"text"}, {ajuda:"Denominador da escala da fonte dos dados utilizado pelo tema. É utilizado para apresentar a indicação de compatibilidade entre a escala do tema e a escala do mapa que está sendo visto.", titulo:"Escala (ESCALA)",id:"escala",value:dados.escala,tipo:"text"}, {ajuda:"Extensão geográfica máxima do tema, no formato xmin ymin xmax ymax. É utilizado na opção de 'zoom para o tema'. Quando o tema é baseado em shapefile, esse metadata não é necessário, pois o mapserver consegue calcular a extensão. Já em outros tipos de dados, como Postgis, o parâmetro é necessário. Nesse caso, se não for indicado, o botão de zoom para o tema não será visível para o usuário", - titulo:"Extensao (EXTENSAO)",id:"extensao",value:dados.extensao,tipo:"text"} + titulo:"Extensao (EXTENSAO)",id:"extensao",value:dados.extensao,tipo:"text"}, + {ajuda:"Ícone que será mostrado na árvore de camadas. A imagem deve existir na web e deve ser incluído o caminho completo ou relativo em relação ao local da interface HTML do mapa.", + titulo:"Ícone (METADATA: ICONETEMA)",id:"iconetema",value:dados.iconetema,tipo:"text"}, + {ajuda:"Mensagem que será mostrada no rodapé do mapa quando o tema estiver visível. É útil para apresentar ao usuário observações especiais sobre o uso daquele tema.", + titulo:"Mensagem (MENSAGEM)",id:"mensagem",value:dados.mensagem,tipo:"text"} ] } var ins = "" @@ -1223,6 +1345,8 @@ function montaEditorDados(dados) titulo:"Data",id:"data",value:dados.data,tipo:"text"}, {ajuda:"Specifies how the data should be drawn. Need not be the same as the shapefile type. For example, a polygon shapefile may be drawn as a point layer, but a point shapefile may not be drawn as a polygon layer. Common sense rules. Annotation means that a label point will be calculated for the features, but the feature itself will not be drawn although a marker symbol can be optionally drawn. this allows for advanced labeling like numbered highway shields. Points are labeled at that point. Polygons are labeled first using a centroid, and if that doesn't fall in the polygon a scanline approach is used to guarantee the label falls within the feature. Lines are labeled at the middle of the longest arc in the visible portion of the line. Query only means the layer can be queried but not drawn.In order to differentiate between POLYGONs and POLYLINEs (which do not exist as a type), simply respectively use or ommit the COLOR keyword when classifying. If you use it, it's a polygon with a fill color, otherwise it's a polyline with only an OUTLINECOLOR.For CHART layers, see the Dynamic Charting howto.A circle must be defined by a a minimum bounding rectangle. That is, 2 points that define the smallest square that can contain it. These 2 points are the two opposite corners of said box", titulo:"Type",id:"",value:dados.type,tipo:"text",div:"

"}, + {ajuda:"Ativa ou não a manutenção de um cache para armazenar as imagens geradas para montar o mapa. Essa opção afeta apenas as interfaces do i3Geo que utilizam o modo TILE (como a interface OpenLayers). O cache é mantido no diretório temporário utilizado pelo i3Geo, na pasta chamada cache. Para cada camada é criada uma sub-pasta. Para limpar o cache, utilize a opção existente junto ao nó principal desse mapfile", + titulo:"Cache de mapas. Camadas WMS são acessadas diretamente do servidor de origem quando o cache estiver inativo. (CACHE)",id:"",value:dados.cache,tipo:"text",div:"
"}, {ajuda:"Projeção", titulo:"Projection",id:"projection",value:dados.projection,tipo:"text"}, {ajuda:"This parameter allows for data specific attribute filtering that is done at the same time spatial filtering is done, but before any CLASS expressions are evaluated. For OGR and shapefiles the string is simply a mapserver regular expression. For spatial databases the string is a SQL WHERE clause that is valid with respect to the underlying database.For example: FILTER type='road' and size <2", @@ -1254,7 +1378,12 @@ function montaEditorDados(dados) ins += core_geraLinhas(param) ins += "


" $i("editor_bd").innerHTML = ins - + if($i("cCache")){ + temp = "" + $i("cCache").innerHTML = temp + } if($i("cTipooriginal")){ temp = "" - temp += core_combosimnao(dados.aplicaextensao) - temp += "" - $i("cAplicaextensao").innerHTML = temp - } - if($i("cCache")){ - temp = "" - $i("cCache").innerHTML = temp - } if($i("cEditorsql")){ temp = "" $i("cEditorsql").innerHTML = temp } - if($i("cPermitecomentario")){ - temp = "" - $i("cPermitecomentario").innerHTML = temp - } - if($i("cClasse")){ - temp = "

" - $i("cClasse").innerHTML = temp - } - if($i("cEscondido")){ - temp = "" - $i("cEscondido").innerHTML = temp - } - if($i("cIdentifica")){ - temp = "" - $i("cIdentifica").innerHTML = temp - } - if($i("cTransitioneffect")){ - temp = "" - $i("cTransitioneffect").innerHTML = temp - } var temp = function() {salvarDadosEditor('metadados',dados.codigoMap,dados.codigoLayer)} new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); } -function montaEditorGeral(dados) -{ - var param = { - "linhas":[ - {ajuda:"Name of a group that this layer belongs to. The group name can then be reference as a regular layer name in the template files, allowing to do things like turning on and off a group of layers at once.", - titulo:"Group",id:"group",value:dados.group,tipo:"text"}, - {ajuda:"Sets the current status of the layer. Often modified by MapServer itself. Default turns the layer on permanently", - titulo:"Status",id:"",value:dados.status,tipo:"text",div:"

"}, - {ajuda:"Sets the color index to treat as transparent for raster layers.", - titulo:"Offsite (R,G,B) (utilize -1,-1,-1 para anular o valor)",id:"offsite",value:dados.offsite,tipo:"text"}, - {ajuda:"Sets the opacity level (or the inability to see through the layer) of all classed pixels for a given layer. The value can either be an integer in the range (0-100) or the named symbol 'ALPHA'. A value of 100 is opaque and 0 is fully transparent. Implemented in MapServer 5.0, to replace the deprecated TRANSPARENCY parameter.The 'ALPHA' symbol directs the MapServer rendering code to honor the indexed or alpha transparency of pixmap symbols used to style a layer. This is only needed in the case of RGB output formats, and should be used only when necessary as it is expensive to render transparent pixmap symbols onto an RGB map image.", - titulo:"Opacity",id:"opacity",value:dados.opacity,tipo:"text"}, - {ajuda:"Maximum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", - titulo:"Maxscale (utilize -1 para anular o valor)",id:"maxscale",value:dados.maxscale,tipo:"text"}, - {ajuda:"Minimum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", - titulo:"Minscale (utilize -1 para anular o valor)",id:"minscale",value:dados.minscale,tipo:"text"}, - {ajuda:"Item name in attribute table to use for class annotation (i.e. labeling).", - titulo:"Labelitem",id:"labelitem",value:dados.labelitem,tipo:"text"}, - {ajuda:"Maximum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", - titulo:"Labelmaxscale (utilize -1 para anular o valor)",id:"labelmaxscale",value:dados.labelmaxscale,tipo:"text"}, - {ajuda:"Minimum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", - titulo:"Labelminscale (utilize -1 para anular o valor)",id:"labelminscale",value:dados.labelminscale,tipo:"text"}, - {ajuda:"The scale at which symbols and/or text appear full size. This allows for dynamic scaling of objects based on the scale of the map. If not set then this layer will always appear at the same size. Scaling only takes place within the limits of MINSIZE and MAXSIZE as described above. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", - titulo:"Symbolscale (utilize -1 para anular o valor)",id:"symbolscale",value:dados.symbolscale,tipo:"text"}, - {ajuda:"Sensitivity for point based queries (i.e. via mouse and/or map coordinates). Given in TOLERANCEUNITS. If the layer is a POINT or a LINE, the default is 3. For all other layer types, the default is 0. To restrict polygon searches so that the point must occur in the polygon set the tolerance to zero.", - titulo:"Tolerance",id:"tolerance",value:dados.tolerance,tipo:"text"}, - {ajuda:" ", - titulo:"Tolerance units",id:"",value:dados.toleranceunits,tipo:"text",div:"
"}, - {ajuda:"Sets the unit of CLASS object SIZE values (default is pixels). Useful for simulating buffering", - titulo:"Sizeunits",id:"",value:dados.sizeunits,tipo:"text",div:"
"} - ] - } - var ins = "" - ins += "" - if(dados.colunas != "") - { - ins += "

O layer possuí as seguintes colunas na tabela de atributos: "; - ins += dados.colunas+"

" - } - - ins += core_geraLinhas(param) - ins += "


" - $i("editor_bd").innerHTML = ins - - temp = "" - $i("cStatus").innerHTML = temp - - temp = "" - $i("cSizeunits").innerHTML = temp - temp = "" - $i("cToleranceunits").innerHTML = temp - var temp = function() - {salvarDadosEditor('geral',dados.codigoMap,dados.codigoLayer,false)} - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }}); - - var temp = function() - {salvarDadosEditor('geral',dados.codigoMap,dados.codigoLayer,"","",true)} - new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }}); -} + function montaEditorClasseGeral(dados) { var re = /C_/g; @@ -1801,6 +1807,12 @@ Altera um mapfile conforme o editor específico de uma característica function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,testar) { if(arguments.length < 6){var testar = false;} + if(tipo == "comport") + { + var campos = new Array("aplicaextensao","permitecomentario","temporizador","classe","legendaimg","escondido","identifica","transitioneffect","status","offsite","opacity","maxscale","minscale","labelitem","labelmaxscale","labelminscale","symbolscale","tolerance","toleranceunits","sizeunits"); + var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + var prog = "../php/editormapfile.php?funcao=alterarComport"; + } if(tipo == "dispo") { var campos = new Array("download","arquivodownload","arquivokmz"); @@ -1830,28 +1842,22 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, {alert("Valor de escala incorreto");return;} } - var campos = new Array("name","tema","iconetema","mensagem","escala","extensao"); + var campos = new Array("name","tema","iconetema","mensagem","escala","extensao","group"); var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; var prog = "../php/editormapfile.php?funcao=alterarTitulo" } if(tipo == "conexao") { - var campos = new Array("projection","type","connection","data","connectiontype","tileitem","tileindex","filteritem","filter","tipooriginal") + var campos = new Array("cache","projection","type","connection","data","connectiontype","tileitem","tileindex","filteritem","filter","tipooriginal") var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer var prog = "../php/editormapfile.php?funcao=alterarConexao" } if(tipo == "metadados") { - var campos = new Array("legendaimg","wms_srs","wms_name","wms_server_version","wms_format","wms_auth_username","wms_auth_password","wms_auth_type","wms_connectiontimeout","wms_latlonboundingbox","wms_proxy_auth_type","wms_proxy_host","wms_proxy_port","wms_proxy_type","wms_proxy_username","wms_proxy_password","wms_sld_body","wms_sld_url","wms_style","wms_bgcolor","wms_transparent","wms_time","permitecomentario","itembuscarapida","cache","ltempoformatodata","ltempoiteminicio","ltempoitemfim","ltempoitemtitulo","ltempoitemdescricao","ltempoitemtip","ltempoitemimagem","ltempoitemicone","ltempoitemlink","editorsql","description_template","palletefile","palletestep","temporizador","aplicaextensao","classestamanho","classessimbolo","classescor","classesnome","classesitem","identifica","transitioneffect","extensao","escondido","classe","tip","itenslink","itens","itensdesc") + var campos = new Array("legendaimg","wms_srs","wms_name","wms_server_version","wms_format","wms_auth_username","wms_auth_password","wms_auth_type","wms_connectiontimeout","wms_latlonboundingbox","wms_proxy_auth_type","wms_proxy_host","wms_proxy_port","wms_proxy_type","wms_proxy_username","wms_proxy_password","wms_sld_body","wms_sld_url","wms_style","wms_bgcolor","wms_transparent","wms_time","itembuscarapida","ltempoformatodata","ltempoiteminicio","ltempoitemfim","ltempoitemtitulo","ltempoitemdescricao","ltempoitemtip","ltempoitemimagem","ltempoitemicone","ltempoitemlink","editorsql","description_template","palletefile","palletestep","classestamanho","classessimbolo","classescor","classesnome","classesitem","identifica","transitioneffect","extensao","escondido","classe","tip","itenslink","itens","itensdesc") var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer var prog = "../php/editormapfile.php?funcao=alterarMetadados" } - if(tipo == "geral") - { - var campos = new Array("sizeunits","status","toleranceunits","tolerance","symbolscale","opacity","offsite","minscale","maxscale","labelminscale","labelmaxscale","labelitem","group") - var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer - var prog = "../php/editormapfile.php?funcao=alterarGeral" - } if(tipo == "classeGeral") { var campos = new Array("status","minscale","maxscale","name","title","keyimage") diff --git a/admin/php/editormapfile.php b/admin/php/editormapfile.php index 70c5ae8..100474d 100644 --- a/admin/php/editormapfile.php +++ b/admin/php/editormapfile.php @@ -670,6 +670,18 @@ switch (strtoupper($funcao)) retornaJSON(pegaDispo()); exit; break; + case "PEGACOMPORT": + retornaJSON(pegaComport()); + exit; + break; + case "ALTERARCOMPORT": + if(verificaEditores($editores) == "nao") + {echo "Vc nao e um editor cadastrado. Apenas os editores definidos em i3geo/ms_configura.php podem acessar o sistema de administracao.";exit;} + alterarComport(); + retornaJSON(pegaComport()); + exit; + break; + /* Valor: ALTERARMETADADOS @@ -1310,6 +1322,79 @@ function excluirEstilo() removeCabecalho($mapfile); return "ok"; } +function pegaComport() +{ + global $codigoMap,$codigoLayer,$locaplic,$postgis_mapa; + $dados = array(); + $mapfile = $locaplic."/temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $v = versao(); + $dados["aplicaextensao"] = $layer->getmetadata("aplicaextensao"); + $dados["permitecomentario"] = $layer->getmetadata("permitecomentario"); + $dados["temporizador"] = $layer->getmetadata("temporizador"); + $dados["classe"] = $layer->getmetadata("classe"); + $dados["legendaimg"] = $layer->getmetadata("legendaimg"); + $dados["escondido"] = $layer->getmetadata("escondido"); + $dados["identifica"] = $layer->getmetadata("identifica"); + $dados["transitioneffect"] = $layer->getmetadata("transitioneffect"); + $dados["status"] = $layer->status; + $dados["offsite"] = $layer->offsite->red.",".$layer->offsite->green.",".$layer->offsite->blue; + $v["principal"] == "4" ? $dados["opacity"] = $layer->transparency : $dados["opacity"] = $layer->opacity; + $dados["maxscale"] = $layer->maxscaledenom; + $dados["minscale"] = $layer->minscaledenom; + $dados["labelitem"] = $layer->labelitem; + $dados["labelmaxscale"] = $layer->labelmaxscaledenom; + $dados["labelminscale"] = $layer->labelminscaledenom; + $dados["symbolscale"] = $layer->symbolscaledenom; + $dados["tolerance"] = $layer->tolerance; + $dados["toleranceunits"] = $layer->toleranceunits; + $dados["sizeunits"] = $layer->sizeunits; + + $dados["codigoMap"] = $codigoMap; + $dados["codigoLayer"] = $codigoLayer; + return $dados; +} +function alterarComport() +{ + global $dir_tmp,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$permitecomentario,$temporizador,$classe,$legendaimg,$escondido,$identifica,$transitioneffect,$status,$offsite,$opacity,$maxscale,$minscale,$labelitem,$labelmaxscale,$labelminscale,$symbolscale,$tolerance,$toleranceunits,$sizeunits; + $v = versao(); + $mapfile = $locaplic."/temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $layer->setmetadata("aplicaextensao",$aplicaextensao); + $layer->setmetadata("permitecomentario",$permitecomentario); + $layer->setmetadata("temporizador",$temporizador); + $layer->setmetadata("classe",$classe); + $layer->setmetadata("legendaimg",$legendaimg); + $layer->setmetadata("escondido",$escondido); + $layer->setmetadata("identifica",$identifica); + $layer->setmetadata("transitioneffect",$transitioneffect); + $layer->set("status",$status); + if($offsite == -1 || $offsite == "null") + {$offsite = "-1,-1,-1";} + $cor = $layer->offsite; + $c = explode(",",$offsite); + if(count($c) < 3) + $c = explode(" ",$offsite); + $cor->setrgb($c[0],$c[1],$c[2]); + $layer->offsite->red.",".$layer->offsite->green.",".$layer->offsite->blue; + $v["principal"] == "4" ? $layer->set("transparency",$opacity) : $layer->set("opacity",$opacity); + $layer->set("maxscaledenom",$maxscale); + $layer->set("minscaledenom",$minscale); + $layer->set("labelitem",$labelitem); + $layer->set("labelmaxscaledenom",$labelmaxscale); + $layer->set("labelminscaledenom",$labelminscale); + $layer->set("symbolscaledenom",$symbolscale); + $layer->set("tolerance",$tolerance); + $layer->set("toleranceunits",$toleranceunits); + $layer->set("sizeunits",$sizeunits); + + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} + function pegaTitulo() { global $codigoMap,$codigoLayer,$locaplic,$postgis_mapa; @@ -1323,6 +1408,7 @@ function pegaTitulo() $dados["mensagem"] = mb_convert_encoding($layer->getmetadata("mensagem"),"UTF-8","ISO-8859-1");//$layer->getmetadata("mensagem"); $dados["escala"] = $layer->getmetadata("escala"); $dados["extensao"] = $layer->getmetadata("extensao"); + $dados["group"] = $layer->group; $dados["codigoMap"] = $codigoMap; $dados["codigoLayer"] = $codigoLayer; return $dados; @@ -1339,11 +1425,11 @@ function alterarTitulo() $layer->setmetadata("mensagem",$mensagem); $layer->setmetadata("escala",$escala); $layer->setmetadata("extensao",$extensao); + $layer->set("group",$group); $mapa->save($mapfile); removeCabecalho($mapfile); return "ok"; } - function pegaDispo() { global $codigoMap,$codigoLayer,$locaplic,$postgis_mapa; @@ -1371,7 +1457,6 @@ function alterarDispo() removeCabecalho($mapfile); return "ok"; } - function pegaConexao() { global $codigoMap,$codigoLayer,$locaplic,$postgis_mapa; @@ -1384,6 +1469,7 @@ function pegaConexao() $dados["data"] = $layer->data; $dados["tileindex"] = $layer->tileindex; $dados["tileitem"] = $layer->tileitem; + $dados["cache"] = $layer->getmetadata("cache"); if($dados["tileindex"] == ""){$dados["tileitem"] = "";} if(is_array($postgis_mapa)) $dados["postgis_mapa"] = array_keys($postgis_mapa); @@ -1396,6 +1482,10 @@ function pegaConexao() if($dados["filter"]== ""){$dados["filter"] = "";} $dados["filteritem"] = $layer->filteritem; $dados["projection"] = $layer->getProjection(); + if($dados["projection"] == "null") + {$dados["projection"] = "";} + $dados["projection"] = str_replace("+i","i",$dados["projection"]); + $dados["colunas"] = implode(" ,",pegaItens($layer)); if($layer->connectiontype == 7 || $layer->connectiontype == 9){ $dados["tipooriginal"] = $layer->getmetadata("tipooriginal"); @@ -1404,7 +1494,7 @@ function pegaConexao() } function alterarConexao() { - global $tipooriginal,$filteritem,$filter,$projection,$type,$dir_tmp,$testar,$codigoMap,$codigoLayer,$locaplic,$connection,$connectiontype,$data,$tileitem,$tileindex; + global $cache,$tipooriginal,$filteritem,$filter,$projection,$type,$dir_tmp,$testar,$codigoMap,$codigoLayer,$locaplic,$connection,$connectiontype,$data,$tileitem,$tileindex; $mapfile = $locaplic."/temas/".$codigoMap.".map"; $mapa = ms_newMapObj($mapfile); $layer = $mapa->getlayerbyname($codigoLayer); @@ -1426,6 +1516,7 @@ function alterarConexao() if($layer->connectiontype == 7 || $layer->connectiontype== 9){ $layer->setmetadata("tipooriginal",$tipooriginal); } + $layer->setmetadata("cache",$cache); if($testar == "true") { $nome = $dir_tmp."/".$codigoMap.".map"; @@ -1454,29 +1545,15 @@ function pegaMetadados() $dados["itensdesc"] = mb_convert_encoding($layer->getmetadata("itensdesc"),"UTF-8","ISO-8859-1"); //$layer->getmetadata("itensdesc"); $dados["itenslink"] = $layer->getmetadata("itenslink"); $dados["tip"] = $layer->getmetadata("tip"); - - $dados["classe"] = $layer->getmetadata("classe"); - - - $dados["escondido"] = $layer->getmetadata("escondido"); - - $dados["identifica"] = $layer->getmetadata("identifica"); - $dados["transitioneffect"] = $layer->getmetadata("transitioneffect"); - $dados["classesitem"] = $layer->getmetadata("classesitem"); $dados["classesnome"] = $layer->getmetadata("classesnome"); $dados["classescor"] = $layer->getmetadata("classescor"); $dados["classessimbolo"] = $layer->getmetadata("classessimbolo"); $dados["classestamanho"] = $layer->getmetadata("classestamanho"); - $dados["aplicaextensao"] = $layer->getmetadata("aplicaextensao"); - - $dados["temporizador"] = $layer->getmetadata("temporizador"); - $dados["palletefile"] = $layer->getmetadata("palletefile"); $dados["palletestep"] = $layer->getmetadata("palletestep"); $dados["description_template"] = $layer->getmetadata("description_template"); $dados["editorsql"] = $layer->getmetadata("editorsql"); - $dados["cache"] = $layer->getmetadata("cache"); $dados["codigoMap"] = $codigoMap; $dados["codigoLayer"] = $codigoLayer; $dados["colunas"] = implode(" ,",pegaItens($layer)); @@ -1490,9 +1567,7 @@ function pegaMetadados() $dados["ltempoitemicone"] = $layer->getmetadata("ltempoitemicone"); $dados["ltempoitemlink"] = $layer->getmetadata("ltempoitemlink"); - $dados["permitecomentario"] = $layer->getmetadata("permitecomentario"); $dados["itembuscarapida"] = $layer->getmetadata("itembuscarapida"); - $dados["legendaimg"] = $layer->getmetadata("legendaimg"); if($layer->connectiontype == 7 || $layer->connectiontype == 9){ $dados["wms_srs"] = $layer->getmetadata("wms_srs"); $dados["wms_name"] = $layer->getmetadata("wms_name"); @@ -1521,7 +1596,7 @@ function pegaMetadados() } function alterarMetadados() { - global $tipooriginal,$legendaimg,$wms_srs,$wms_name,$wms_server_version,$wms_format,$wms_auth_username,$wms_auth_password,$wms_auth_type,$wms_connectiontimeout,$wms_latlonboundingbox,$wms_proxy_auth_type,$wms_proxy_host,$wms_proxy_port,$wms_proxy_type,$wms_proxy_username,$wms_proxy_password,$wms_sld_body,$wms_sld_url,$wms_style,$wms_bgcolor,$wms_transparent,$wms_time,$permitecomentario,$itembuscarapida,$iconetema,$ltempoformatodata,$ltempoiteminicio,$ltempoitemfim,$ltempoitemtitulo,$ltempoitemdescricao,$ltempoitemtip,$ltempoitemimagem,$ltempoitemicone,$ltempoitemlink,$description_template,$palletestep,$palletefile,$temporizador,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$identifica,$transitioneffect,$extensao,$escondido,$classe,$tip,$itenslink,$itens,$itensdesc,$editorsql,$cache; + global $tipooriginal,$wms_srs,$wms_name,$wms_server_version,$wms_format,$wms_auth_username,$wms_auth_password,$wms_auth_type,$wms_connectiontimeout,$wms_latlonboundingbox,$wms_proxy_auth_type,$wms_proxy_host,$wms_proxy_port,$wms_proxy_type,$wms_proxy_username,$wms_proxy_password,$wms_sld_body,$wms_sld_url,$wms_style,$wms_bgcolor,$wms_transparent,$wms_time,$itembuscarapida,$iconetema,$ltempoformatodata,$ltempoiteminicio,$ltempoitemfim,$ltempoitemtitulo,$ltempoitemdescricao,$ltempoitemtip,$ltempoitemimagem,$ltempoitemicone,$ltempoitemlink,$description_template,$palletestep,$palletefile,$codigoMap,$codigoLayer,$locaplic,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$extensao,$tip,$itenslink,$itens,$itensdesc,$editorsql; $dados = array(); $mapfile = $locaplic."/temas/".$codigoMap.".map"; $mapa = ms_newMapObj($mapfile); @@ -1530,30 +1605,15 @@ function alterarMetadados() $layer->setmetadata("itensdesc",$itensdesc); $layer->setmetadata("itenslink",$itenslink); $layer->setmetadata("tip",$tip); - - $layer->setmetadata("classe",$classe); - - - $layer->setmetadata("escondido",$escondido); - - $layer->setmetadata("identifica",$identifica); - $layer->setmetadata("transitioneffect",$transitioneffect); - $layer->setmetadata("classesitem",$classesitem); $layer->setmetadata("classesnome",$classesnome); $layer->setmetadata("classescor",$classescor); $layer->setmetadata("classessimbolo",$classessimbolo); $layer->setmetadata("classestamanho",$classestamanho); - $layer->setmetadata("aplicaextensao",$aplicaextensao); - - $layer->setmetadata("temporizador",$temporizador); - $layer->setmetadata("palletefile",$palletefile); $layer->setmetadata("palletestep",$palletestep); $layer->setmetadata("description_template",$description_template); $layer->setmetadata("editorsql",$editorsql); - $layer->setmetadata("cache",$cache); - $layer->setmetadata("ltempoformatodata",$ltempoformatodata); $layer->setmetadata("ltempoiteminicio",$ltempoiteminicio); $layer->setmetadata("ltempoitemfim",$ltempoitemfim); @@ -1564,9 +1624,7 @@ function alterarMetadados() $layer->setmetadata("ltempoitemicone",$ltempoitemicone); $layer->setmetadata("ltempoitemlink",$ltempoitemlink); - $layer->setmetadata("permitecomentario",$permitecomentario); $layer->setmetadata("itembuscarapida",$itembuscarapida); - $layer->setmetadata("legendaimg",$legendaimg); if($layer->connectiontype == 7 || $layer->connectiontype== 9){ $layer->setmetadata("wms_srs",$wms_srs); $layer->setmetadata("wms_name",$wms_name); @@ -1605,91 +1663,6 @@ function alterarMetadados() removeCabecalho($mapfile); return "ok"; } -function pegaGeral() -{ - global $codigoMap,$codigoLayer,$locaplic; - $v = versao(); - $dados = array(); - $mapfile = $locaplic."/temas/".$codigoMap.".map"; - $mapa = ms_newMapObj($mapfile); - $layer = $mapa->getlayerbyname($codigoLayer); - $dados["group"] = $layer->group; - //$dados["labelangleitem"] = $layer->labelangleitem; - $dados["labelitem"] = $layer->labelitem; - $dados["labelmaxscale"] = $layer->labelmaxscaledenom; - $dados["labelmaxscale"] = $layer->labelmaxscaledenom; - $dados["labelminscale"] = $layer->labelminscaledenom; - //$dados["labelsizeitem"] = $layer->labelsizeitem; - $dados["maxscale"] = $layer->maxscaledenom; - $dados["minscale"] = $layer->minscaledenom; - $dados["offsite"] = $layer->offsite->red.",".$layer->offsite->green.",".$layer->offsite->blue; - $v["principal"] == "4" ? $dados["opacity"] = $layer->transparency : $dados["opacity"] = $layer->opacity; - $dados["symbolscale"] = $layer->symbolscaledenom; - $dados["tolerance"] = $layer->tolerance; - $dados["toleranceunits"] = $layer->toleranceunits; - $dados["status"] = $layer->status; - $dados["sizeunits"] = $layer->sizeunits; - - if($dados["projection"] == "null") - {$dados["projection"] = "";} - $dados["projection"] = str_replace("+i","i",$dados["projection"]); - $dados["codigoMap"] = $codigoMap; - $dados["codigoLayer"] = $codigoLayer; - $dados["colunas"] = implode(" ,",pegaItens($layer)); - return $dados; -} -function alterarGeral() -{ - global $dir_tmp,$testar,$codigoMap,$codigoLayer,$locaplic,$sizeunits,$status,$toleranceunits,$tolerance,$symbolscale,$opacity,$offsite,$minscale,$maxscale,$labelsizeitem,$labelminscale,$labelmaxscale,$labelitem,$group; - error_reporting(0); - $v = versao(); - $dados = array(); - - $mapfile = $locaplic."/temas/".$codigoMap.".map"; - $mapa = ms_newMapObj($mapfile); - $layer = $mapa->getlayerbyname($codigoLayer); - - if($offsite == -1 || $offsite == "null") - {$offsite = "-1,-1,-1";} - - - - $layer->set("group",$group); - //$layer->set("labelangleitem",$labelangleitem); - $layer->set("labelitem",$labelitem); - $layer->set("labelmaxscaledenom",$labelmaxscale); - $layer->set("labelminscaledenom",$labelminscale); - //$layer->set("labelsizeitem",$labelsizeitem); - $layer->set("maxscaledenom",$maxscale); - $layer->set("minscaledenom",$minscale); - $cor = $layer->offsite; - $c = explode(",",$offsite); - if(count($c) < 3) - $c = explode(" ",$offsite); - $cor->setrgb($c[0],$c[1],$c[2]); - $layer->offsite->red.",".$layer->offsite->green.",".$layer->offsite->blue; - $v["principal"] == "4" ? $layer->set("transparency",$opacity) : $layer->set("opacity",$opacity); - - $layer->set("symbolscaledenom",$symbolscale); - $layer->set("tolerance",$tolerance); - $layer->set("toleranceunits",$toleranceunits); - $layer->set("status",$status); - $layer->set("sizeunits",$sizeunits); - - if($testar == "true") - { - $nome = $dir_tmp."/".$codigoMap.".map"; - $mapa->save($nome); - removeCabecalho($nome,false); - return $nome; - } - else - { - $mapa->save($mapfile); - removeCabecalho($mapfile); - return "ok"; - } -} function pegaClasseGeral() { global $codigoMap,$codigoLayer,$indiceClasse,$locaplic; -- libgit2 0.21.2