diff --git a/admin1/catalogo/mapfile/conexao/ogc/exec.php b/admin1/catalogo/mapfile/conexao/ogc/exec.php index d1ec075..b489994 100755 --- a/admin1/catalogo/mapfile/conexao/ogc/exec.php +++ b/admin1/catalogo/mapfile/conexao/ogc/exec.php @@ -58,18 +58,6 @@ switch ($funcao) { break; } /* - linha do tempo - - $dados["ltempoformatodata"] = $layer->getmetadata("ltempoformatodata"); - $dados["ltempoiteminicio"] = $layer->getmetadata("ltempoiteminicio"); - $dados["ltempoitemfim"] = $layer->getmetadata("ltempoitemfim"); - $dados["ltempoitemtitulo"] = $layer->getmetadata("ltempoitemtitulo"); - $dados["ltempoitemdescricao"] = $layer->getmetadata("ltempoitemdescricao"); - $dados["ltempoconvencode"] = $layer->getmetadata("ltempoconvencode"); - $dados["ltempoitemtip"] = $layer->getmetadata("ltempoitemtip"); - $dados["ltempoitemimagem"] = $layer->getmetadata("ltempoitemimagem"); - $dados["ltempoitemicone"] = $layer->getmetadata("ltempoitemicone"); - $dados["ltempoitemlink"] = $layer->getmetadata("ltempoitemlink"); outros diff --git a/classesjs/classe_analise.js b/classesjs/classe_analise.js index 368a3d7..da3a3e4 100755 --- a/classesjs/classe_analise.js +++ b/classesjs/classe_analise.js @@ -145,8 +145,8 @@ i3GEO.analise = */ linhaDoTempo : function() { i3GEO.janela.cria( + "650px", "450px", - "350px", i3GEO.configura.locaplic + "/ferramentas/linhadotempo/index.php", "", "", diff --git a/ferramentas/atalhosedicao/index.js b/ferramentas/atalhosedicao/index.js index 1ace121..aa8c19f 100755 --- a/ferramentas/atalhosedicao/index.js +++ b/ferramentas/atalhosedicao/index.js @@ -143,6 +143,16 @@ i3GEOF.atalhosedicao = }); $i("i3GEOFatalhosedicaoStorymap-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOFatalhosedicaoLinhadotempo", { + onclick : { + fn : function() { + i3GEO.temaAtivo = i3GEOF.atalhosedicao.tema; + i3GEO.analise.dialogo.linhaDoTempo() + } + } + }); + $i("i3GEOFatalhosedicaoLinhadotempo-button").style.width = "200px"; + new YAHOO.widget.Button("i3GEOFatalhosedicaoAnimagif", { onclick : { fn : function() { diff --git a/ferramentas/atalhosedicao/template_mst.html b/ferramentas/atalhosedicao/template_mst.html index 23bae13..523a97c 100755 --- a/ferramentas/atalhosedicao/template_mst.html +++ b/ferramentas/atalhosedicao/template_mst.html @@ -86,6 +86,9 @@
+
+ +
{{{plugins}}}
diff --git a/ferramentas/linhadotempo/dependencias.php b/ferramentas/linhadotempo/dependencias.php new file mode 100755 index 0000000..2f60e98 --- /dev/null +++ b/ferramentas/linhadotempo/dependencias.php @@ -0,0 +1,34 @@ + ou com a funcao scripttag do i3Geo + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel + * javascript i3GEOF.opcoesTamanho.MUSTACHE + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta + */ +if(extension_loaded('zlib')){ + ob_start('ob_gzhandler'); +} +header("Content-type: text/javascript"); +include("index.js"); +include("dicionario.js"); +echo "\n"; +/** + * Inclui o template mustache do HTML usado para criar o conteudo da janela + */ +echo 'i3GEOF.linhadotempo.MUSTACHE = "'; +$texto = file_get_contents("template_mst.html"); +$texto = str_replace("\n", "", $texto); +$texto = str_replace("\r", "", $texto); +$texto = str_replace("\t", "", $texto); +$texto = str_replace('"', "'", $texto); +echo $texto; +echo '";'; +if(extension_loaded('zlib')){ + ob_end_flush(); +} +?> \ No newline at end of file diff --git a/ferramentas/linhadotempo/dicionario.js b/ferramentas/linhadotempo/dicionario.js index a419c2c..3113930 100755 --- a/ferramentas/linhadotempo/dicionario.js +++ b/ferramentas/linhadotempo/dicionario.js @@ -1,52 +1,72 @@ //+$trad(1,i3GEOF.linhadotempo.dicionario)+ i3GEOF.linhadotempo.dicionario = { - 1 : [ { - pt : "", + "msg" : [ { + pt : "Obtendo parâmetros", en : "", es : "" } ], - 2 : [ { - pt : "", + "opt" : [ { + pt : "Opções linha do tempo", en : "", es : "" } ], - 3 : [ { - pt : "", + "ltempoformatodata" : [ { + pt : "Formato das datas existentes na tabela de atributos p.e. iso8601", en : "", es : "" } ], - 4 : [ { - pt : "", + 'ltempoiteminicio' : [ { + pt : "Item que indica a data de início de um evento", en : "", es : "" } ], - 5 : [ { - pt : "", + 'ltempoitemfim' : [ { + pt : "Item que indica a data final de um evento (opcional)", en : "", es : "" } ], - 6 : [ { - pt : "", + 'ltempoitemtitulo' : [ { + pt : "Item que contém o título de cada evento", en : "", es : "" } ], - 7 : [ { - pt : "", + 'ltempoitemdescricao' : [ { + pt : "Item com a descrição do evento (opcional)", en : "", es : "" } ], - 8 : [ { - pt : "", + 'ltempoitemtip' : [ { + pt : "Item para etiquetas do título (opcional)", en : "", es : "" } ], - 9 : [ { - pt : "", + 'ltempoitemimagem' : [ { + pt : "Item com o endereço de uma imagem que será incluída no menu popup, aberto quando o usuário clica em um evento (opcional)", en : "", es : "" } ], - 10 : [ { - pt : "", + 'ltempoitemlink' : [ { + pt : "Link para uma página que será incluído no menu popup", + en : "", + es : "" + } ], + 'ltempoitemicone' : [ { + pt : "Endereço da imagem do ícone que irá representar o evento (opcional)", + en : "", + es : "" + } ], + 'ltempoconvencode' : [ { + pt : "Aplica conversão do código de caracteres? Pode ser necessário para corrigir problemas de acentuação", + en : "", + es : "" + } ], + 'aplica' : [ { + pt : "Aplicar", + en : "", + es : "" + } ], + "colunasTxt" : [ { + pt : "Itens disponíveis", en : "", es : "" } ] diff --git a/ferramentas/linhadotempo/exec.php b/ferramentas/linhadotempo/exec.php new file mode 100755 index 0000000..2728563 --- /dev/null +++ b/ferramentas/linhadotempo/exec.php @@ -0,0 +1,58 @@ +mudaQS> +*/ + case "PARAMETROS": + $map = ms_newMapObj($map_file); + $layer = $map->getlayerbyname($tema); + $retorno = array(); + $retorno["ltempoformatodata"] = $layer->getmetadata("ltempoformatodata"); + $retorno["ltempoiteminicio"] = $layer->getmetadata("ltempoiteminicio"); + $retorno["ltempoitemfim"] = $layer->getmetadata("ltempoitemfim"); + $retorno["ltempoitemtitulo"] = $layer->getmetadata("ltempoitemtitulo"); + $retorno["ltempoitemdescricao"] = $layer->getmetadata("ltempoitemdescricao"); + $retorno["ltempoconvencode"] = $layer->getmetadata("ltempoconvencode"); + $retorno["ltempoitemtip"] = $layer->getmetadata("ltempoitemtip"); + $retorno["ltempoitemimagem"] = $layer->getmetadata("ltempoitemimagem"); + $retorno["ltempoitemicone"] = $layer->getmetadata("ltempoitemicone"); + $retorno["ltempoitemlink"] = $layer->getmetadata("ltempoitemlink"); + $sopen = $layer->open(); + if($sopen != MS_FAILURE){ + $items = $layer->getItems(); + } + else{ + $items = array(); + } + $retorno["colunas"] = implode(",",$items); + break; + case "SALVA": + $map = ms_newMapObj($map_file); + $layer = $map->getlayerbyname($tema); + $layer->setmetadata("ltempoformatodata",$_GET["ltempoformatodata"]); + $layer->setmetadata("ltempoiteminicio",$_GET["ltempoiteminicio"]); + $layer->setmetadata("ltempoitemfim",$_GET["ltempoitemfim"]); + $layer->setmetadata("ltempoitemtitulo",$_GET["ltempoitemtitulo"]); + $layer->setmetadata("ltempoitemdescricao",$_GET["ltempoitemdescricao"]); + $layer->setmetadata("ltempoconvencode",$_GET["ltempoconvencode"]); + $layer->setmetadata("ltempoitemtip",$_GET["ltempoitemtip"]); + $layer->setmetadata("ltempoitemimagem",$_GET["ltempoitemimagem"]); + $layer->setmetadata("ltempoitemicone",$_GET["ltempoitemicone"]); + $layer->setmetadata("ltempoitemlink",$_GET["ltempoitemlink"]); + $map->save($map_file); + $retorno = "ok"; + break; +} +cpjson($retorno); +?> \ No newline at end of file diff --git a/ferramentas/linhadotempo/index.js b/ferramentas/linhadotempo/index.js new file mode 100755 index 0000000..0a1ab36 --- /dev/null +++ b/ferramentas/linhadotempo/index.js @@ -0,0 +1,160 @@ + +if(typeof(i3GEOF) === 'undefined'){ + var i3GEOF = {}; +} + +i3GEOF.linhadotempo = { + /* + Variavel: aguarde + + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. + */ + aguarde: "", + /** + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php + */ + MUSTACHE : "", + /** + * Susbtitutos para o template + */ + mustacheHash : function() { + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.linhadotempo.dicionario); + return dicionario; + }, + tema : "", + iddiv: "", + /* + Function: inicia + + Inicia a ferramenta. É chamado por criaJanelaFlutuante + + Parametro: + + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta + */ + inicia: function(iddiv){ + var b,box; + if(iddiv){ + i3GEOF.linhadotempo.iddiv = iddiv; + } + try{ + $i(iddiv).innerHTML = i3GEOF.linhadotempo.html(); + b = new YAHOO.widget.Button( + "i3GEOlinhadotempobotao1", + {onclick:{fn: i3GEOF.linhadotempo.salva}} + ); + b.addClass("rodar150"); + + i3GEO.janela.tempoMsg($trad('msg',i3GEOF.linhadotempo.dicionario)); + i3GEOF.linhadotempo.parametrosAtuais(); + } + catch(erro){i3GEO.janela.tempoMsg(erro);} + }, + /* + Function: html + + Gera o código html para apresentação das opções da ferramenta + + Retorno: + + String com o código html + */ + html:function() { + var ins = Mustache.render(i3GEOF.linhadotempo.MUSTACHE, i3GEOF.linhadotempo.mustacheHash()); + return ins; + }, + /* + Function: iniciaJanelaFlutuante + + Cria a janela flutuante para controle da ferramenta. + */ + iniciaJanelaFlutuante: function(){ + var janela,divid,temp,titulo,cabecalho,minimiza; + i3GEOF.linhadotempo.tema = i3GEO.temaAtivo; + if ($i("i3GEOF.linhadotempo")) { + return; + } + cabecalho = function(){}; + minimiza = function(){ + i3GEO.janela.minimiza("i3GEOF.linhadotempo"); + }; + //cria a janela flutuante + titulo = "
{{{colunasTxt}}}:
+{{{ltempoformatodata}}}:
+{{{ltempoiteminicio}}}:
+{{{ltempoitemfim}}}:
+{{{ltempoitemtitulo}}}:
+{{{ltempoitemdescricao}}}:
+{{{ltempoconvencode}}}:
+{{{ltempoitemtip}}}:
+{{{ltempoitemimagem}}}:
+{{{ltempoitemicone}}}:
+{{{ltempoitemlink}}}:
++ +
+