Commit d5eb227667a38d5c1bb3683e38f966cab9d03063

Authored by Edmar Moretti
1 parent 6dc875fc
Exists in master

formulario para a ferramenta animagif

ferramentas/animagif/dependencias.php 0 → 100755
... ... @@ -0,0 +1,30 @@
  1 +<?php
  2 +/**
  3 + * Carrega os programas javascript necessarios para a ferramenta
  4 + * Esse programa e usado na tag <script> ou com a funcao scripttag do i3Geo
  5 + * Alem de carregar os scripts, carrega tambem o template no formato MUSTACHE, definindo a variavel
  6 + * javascript i3GEOF.animagif.MUSTACHE
  7 + * O template e substituido pelos valores definidos em index.js no momento da inicializacao da ferramenta
  8 + */
  9 +if(extension_loaded('zlib')){
  10 + ob_start('ob_gzhandler');
  11 +}
  12 +header("Content-type: text/javascript");
  13 +include("index.js");
  14 +include("dicionario.js");
  15 +echo "\n";
  16 +/**
  17 + * Inclui o template mustache do HTML usado para criar o conteudo da janela
  18 + */
  19 +echo 'i3GEOF.animagif.MUSTACHE = "';
  20 +$texto = file_get_contents("template_mst.html");
  21 +$texto = str_replace("\n", "", $texto);
  22 +$texto = str_replace("\r", "", $texto);
  23 +$texto = str_replace("\t", "", $texto);
  24 +$texto = str_replace('"', "'", $texto);
  25 +echo $texto;
  26 +echo '";';
  27 +if(extension_loaded('zlib')){
  28 + ob_end_flush();
  29 +}
  30 +?>
0 31 \ No newline at end of file
... ...
ferramentas/animagif/dicionario.js 0 → 100755
... ... @@ -0,0 +1,93 @@
  1 +//+$trad(1,i3GEOF.animagif.dicionario)+
  2 +i3GEOF.animagif.dicionario = {
  3 + 'ativaAoAdic' : [ {
  4 + pt : "Abre a ferramenta quando a camada &eacute; adicionada ao mapa, permitindo que o usu&aacute;rio escolha os par&acirc;metros",
  5 + en : "",
  6 + es : ""
  7 + } ],
  8 + 'execAoAdic' : [ {
  9 + pt : "Gera a animação quando o usuário adiciona a camada ao mapa",
  10 + en : "",
  11 + es : ""
  12 + } ],
  13 + 'colunat' : [ {
  14 + pt : "Coluna que ser&aacute; utilizada para obter a lista de datas e que receber&aacute; o filtro de data para cada quadro da anima&ccedil;&atilde;o",
  15 + en : "",
  16 + es : ""
  17 + } ],
  18 + 'tempo' : [ {
  19 + pt : "Tempo em milisegundos entre cada quadro",
  20 + en : "",
  21 + es : ""
  22 + } ],
  23 + 'w' : [ {
  24 + pt : "Largura da imagem gif que ser&aacute; gerada",
  25 + en : "",
  26 + es : ""
  27 + } ],
  28 + 'cache' : [ {
  29 + pt : "Reaproveita o arquivo gif em cache",
  30 + en : "",
  31 + es : ""
  32 + } ],
  33 + 'extensao' : [ {
  34 + pt : "Extens&atilde;o geogr&aacute;fica (xmin, ymin, xmax, ymax)",
  35 + en : "",
  36 + es : ""
  37 + } ],
  38 + 'legenda' : [ {
  39 + pt : "Mostra a legenda",
  40 + en : "",
  41 + es : ""
  42 + } ],
  43 + 'transparencia' : [ {
  44 + pt : "Cada quadro ser&aacute; transparente",
  45 + en : "",
  46 + es : ""
  47 + } ],
  48 + 'tipocolunat' : [ {
  49 + pt : "Tipo da coluna com os valores",
  50 + en : "",
  51 + es : ""
  52 + } ],
  53 + 'nulos' : [ {
  54 + pt : "Lista de valores, separados por v&iacute;rgula, que ser&atilde;o exclu&iacute;dos no processo de obten&ccedil;&atilde;o da lista de datas",
  55 + en : "",
  56 + es : ""
  57 + } ],
  58 + 'operador' : [ {
  59 + pt : "Operador de liga&ccedil;&atilde;o entre a coluna e o valor da data, por default utiliza-se '=', mas pode ser definido tamb&eacute;m 'lt' (menor que) ou gt (maior que)",
  60 + en : "",
  61 + es : ""
  62 + } ],
  63 + 'geragif' : [{
  64 + pt : "Cria o gif animado",
  65 + en : "",
  66 + es : ""
  67 + }],
  68 + 'numerico' : [{
  69 + pt : "Num&eacute;rico",
  70 + en : "",
  71 + es : ""
  72 + }],
  73 + 'texto' : [{
  74 + pt : "Texto",
  75 + en : "",
  76 + es : ""
  77 + }],
  78 + 'sim' : [{
  79 + pt : "Sim",
  80 + en : "",
  81 + es : ""
  82 + }],
  83 + 'nao' : [{
  84 + pt : "N&atilde;o",
  85 + en : "",
  86 + es : ""
  87 + }],
  88 + 'selecionaCol' : [{
  89 + pt : "Selecione uma coluna",
  90 + en : "",
  91 + es : ""
  92 + }]
  93 +};
... ...
ferramentas/animagif/exec.php
... ... @@ -38,6 +38,12 @@ if($cache == &quot;nao&quot;){
38 38 if(empty($tempo)){
39 39 $tempo = 40;
40 40 }
  41 +if(empty($w)){
  42 + $w = 500;
  43 +}
  44 +if(empty($h)){
  45 + $h = 500;
  46 +}
41 47 if(empty($nulos)){
42 48 $nulos = "";
43 49 }
... ... @@ -106,6 +112,7 @@ else{
106 112 $base = $locaplic."/aplicmap/".$base;
107 113 }
108 114 }
  115 +
109 116 //desenv /var/www/html/i3geo/i3geo/sage/camadas/base_linux.map
110 117 $mapa = ms_newMapObj($base);
111 118  
... ... @@ -192,9 +199,12 @@ if($legenda == &quot;sim&quot;){
192 199 $leg->set("status",MS_EMBED);
193 200 $cor = $leg->imagecolor;
194 201 $cor->setrgb(250,250,250);
  202 +
195 203 $labelleg = $leg->label;
196   - $labelleg->set("type",MS_TRUETYPE);
  204 +
  205 + $labelleg->updatefromstring("LABEL TYPE TRUETYPE END");
197 206 $labelleg->set("font","arial");
  207 +
198 208 $labelleg->set("size",12);
199 209 $leg->set("keyspacingy",0);
200 210 $leg->set("keysizey",20);
... ... @@ -219,6 +229,7 @@ if($transparente == &quot;sim&quot;){
219 229  
220 230 $mapa->save($arqtemp.".map");
221 231 $mapa = ms_newMapObj($arqtemp.".map");
  232 +
222 233 /*
223 234 if(validaAcessoTemas($arqtemp.".map",false) == true){
224 235 echo "Existem temas restritos";exit;
... ... @@ -243,11 +254,11 @@ foreach($lista as $l){
243 254 $layer = $mapa->getlayerbyname($tema);
244 255  
245 256 $copyright = $mapa->getlayerbyname("copyright");
246   -$classe = ms_newClassObj($copyright);
247   -
248   -$classet = ms_newClassObj($copyright);
249   -$classet->title = " ";
250   -
  257 +if($copyright != ""){
  258 + $classe = ms_newClassObj($copyright);
  259 + $classet = ms_newClassObj($copyright);
  260 + $classet->title = " ";
  261 +}
251 262 $mapa->moveLayerdown(0);
252 263  
253 264 if($copyright != ""){
... ... @@ -265,7 +276,6 @@ if($copyright != &quot;&quot;){
265 276 $imagens = array();
266 277 $duracao = array();
267 278 $objImagem = "";
268   -
269 279 foreach($listaunica as $d){
270 280 if(strtoupper($colunat) == $colunat){
271 281 $filtro = "(('[$colunat]' $operador '$d'))";
... ... @@ -280,6 +290,7 @@ foreach($listaunica as $d){
280 290 }
281 291 }
282 292 $layer->setfilter($filtro);
  293 +
283 294 $nomec = $arqtemp.$d.".png";
284 295  
285 296 if($copyright != "" && $vi >= 60300){
... ... @@ -289,12 +300,17 @@ foreach($listaunica as $d){
289 300 else{
290 301 $classe->title = $d;
291 302 }
  303 + //$mapa->save($arqtemp."teste.map");
292 304 if(!file_exists($nomec)){
293 305 if($objImagem == ""){
  306 + //$mapa->save($arqtemp.".map");
  307 + //echo $arqtemp.".map";
294 308 $objImagem = $mapa->draw();
295 309 $objImagem->saveImage($nomec);
296 310 }
297 311 else{
  312 + //$mapa->save($arqtemp.".map");
  313 + //echo $arqtemp.".map";
298 314 $i = $mapa->draw();
299 315 $objImagem->pasteImage($i,-1);
300 316 $objImagem->saveImage($nomec);
... ... @@ -303,6 +319,7 @@ foreach($listaunica as $d){
303 319 $imagens[] = $nomec;
304 320 $duracao[] = $tempo;
305 321 }
  322 +
306 323 //junta as imagens no gif
307 324  
308 325 include("../../pacotes/gifcreator/GifCreator.php");
... ... @@ -312,6 +329,7 @@ $gc-&gt;create($imagens, $duracao, 0);
312 329 $gifBinary = $gc->getGif();
313 330 file_put_contents($arqtemp.".gif", $gifBinary);
314 331 //retorna o gif para o navegador
  332 +ob_clean();
315 333 header('Content-type: image/gif');
316 334 header('Content-Disposition: filename="'.$tema.'.gif"');
317 335 echo $gifBinary;
... ...
ferramentas/animagif/index.js 0 → 100755
... ... @@ -0,0 +1,389 @@
  1 +/*
  2 +Title: animagif
  3 +
  4 +Cria um arquivo gif que mostra superposição de imagens do mapa atual
  5 +
  6 +<i3GEO.tema.dialogo.animagif>
  7 +
  8 +Arquivo:
  9 +
  10 +i3geo/ferramentas/animagif/index.js.php
  11 +
  12 +Licenca:
  13 +
  14 +GPL2
  15 +
  16 +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
  17 +
  18 +Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente Brasil
  19 +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
  20 +
  21 +Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo
  22 +e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral
  23 +GNU conforme publicada pela Free Software Foundation;
  24 +
  25 +Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,
  26 +por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita
  27 +de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.
  28 +Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.
  29 +Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do
  30 +GNU junto com este programa; se n&atilde;o, escreva para a
  31 +Free Software Foundation, Inc., no endere&ccedil;o
  32 +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  33 + */
  34 +if (typeof (i3GEOF) === 'undefined') {
  35 + var i3GEOF = {};
  36 +}
  37 +
  38 +/*
  39 + * Classe: i3GEOF.animagif
  40 + *
  41 + * Camadas podem ter as definicoes default de parametros armazenadas no metadata animagif Esse metadata e mantido no objeto
  42 + * i3GEO.arvoreDeCamadas.CAMADAS
  43 + *
  44 + * Os campos definidos pelo usuario podem ser salvos no mapfile caso o usuario esteja logado
  45 + *
  46 + * Veja tambem i3geo/ferramentas/atalhosedicao
  47 + */
  48 +i3GEOF.animagif =
  49 +{
  50 + /*
  51 + * Variavel: tema
  52 + *
  53 + * Tema que ser&aacute; utilizado
  54 + *
  55 + * Type: {string}
  56 + */
  57 + tema : i3GEO.temaAtivo,
  58 + /*
  59 + * Variavel: aguarde
  60 + *
  61 + * Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.
  62 + */
  63 + aguarde : "",
  64 + /*
  65 + * Para efeitos de compatibilidade antes da vers&atilde;o 4.7 que n&atilde;o tinha dicion&aacute;rio
  66 + */
  67 + criaJanelaFlutuante : function() {
  68 + i3GEOF.animagif.iniciaDicionario();
  69 + },
  70 + /**
  71 + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php
  72 + */
  73 + MUSTACHE : "",
  74 + /**
  75 + * Susbtitutos para o template
  76 + */
  77 + mustacheHash : function() {
  78 + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.animagif.dicionario);
  79 + return dicionario;
  80 + },
  81 + /*
  82 + * Function: iniciaDicionario
  83 + *
  84 + * Carrega o dicion&aacute;rio e chama a fun&ccedil;&atilde;o que inicia a ferramenta
  85 + *
  86 + * O Javascript &eacute; carregado com o id i3GEOF.nomedaferramenta.dicionario_script
  87 + */
  88 + iniciaDicionario : function() {
  89 + if (typeof (i3GEOF.animagif.dicionario) === 'undefined') {
  90 + i3GEO.util.scriptTag(
  91 + i3GEO.configura.locaplic + "/ferramentas/animagif/dicionario.js",
  92 + "i3GEOF.animagif.iniciaJanelaFlutuante()",
  93 + "i3GEOF.animagif.dicionario_script");
  94 + } else {
  95 + i3GEOF.animagif.iniciaJanelaFlutuante();
  96 + }
  97 + },
  98 + /*
  99 + * Function: inicia
  100 + *
  101 + * Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante
  102 + *
  103 + * Parametro:
  104 + *
  105 + * iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta
  106 + */
  107 + inicia : function(iddiv) {
  108 + var camada = "", temp;
  109 + i3GEO.janela.comboCabecalhoTemas("i3GEOFanimagifComboCabeca", "i3GEOFanimagifComboCabecaSel", "animagif", "ligadosComTabela");
  110 + if(i3GEOF.animagif.tema === ""){
  111 + return;
  112 + }
  113 + $i(iddiv).innerHTML = i3GEOF.animagif.html();
  114 + i3GEOF.animagif.rodape();
  115 + //
  116 + // verifica se a camada possui definicao dos parametros
  117 + //
  118 + if (i3GEO.arvoreDeCamadas) {
  119 + camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.animagif.tema);
  120 + if (camada != "" && camada.ferramentas.animagif) {
  121 + if(camada.ferramentas.animagif.auto === "sim"){
  122 + $i("ativaAoAdic").checked = true;
  123 + }
  124 + if(camada.ferramentas.animagif.exec === "sim"){
  125 + $i("execAoAdic").checked = true;
  126 + }
  127 + temp = $i("i3GEOANIMAGIFtipocolunat").getElementsByTagName("select")[0];
  128 + temp.value = camada.ferramentas.animagif.tipocolunat;
  129 + temp = $i("i3GEOANIMAGIFtempo");
  130 + temp.value = camada.ferramentas.animagif.tempo;
  131 + temp = $i("i3GEOANIMAGIFw");
  132 + temp.value = camada.ferramentas.animagif.w;
  133 + temp = $i("i3GEOANIMAGIFh");
  134 + temp.value = camada.ferramentas.animagif.h;
  135 + temp = $i("i3GEOANIMAGIFcache").getElementsByTagName("select")[0];
  136 + temp.value = camada.ferramentas.animagif.cache;
  137 + temp = $i("i3GEOANIMAGIFextensao");
  138 + temp.value = camada.ferramentas.animagif.extensao;
  139 + temp = $i("i3GEOANIMAGIFlegenda").getElementsByTagName("select")[0];
  140 + temp.value = camada.ferramentas.animagif.legenda;
  141 + temp = $i("i3GEOANIMAGIFtransparencia").getElementsByTagName("select")[0];
  142 + temp.value = camada.ferramentas.animagif.transparencia;
  143 + temp = $i("i3GEOANIMAGIFoperador").getElementsByTagName("select")[0];
  144 + temp.value = camada.ferramentas.animagif.operador;
  145 + temp = $i("i3GEOANIMAGIFnulos");
  146 + temp.value = camada.ferramentas.animagif.nulos;
  147 + // combo para escolher a coluna com as datas
  148 + i3GEO.util.comboItens("i3GEOanimagifcolunat", i3GEOF.animagif.tema, function(retorno) {
  149 + $i("i3GEOANIMAGIFcolunatSel").innerHTML = retorno.dados;
  150 + temp = $i("i3GEOANIMAGIFcolunat").getElementsByTagName("select")[0];
  151 + temp.value = camada.ferramentas.animagif.colunat;
  152 + }, "i3GEOanimagifcolunatSel");
  153 + } else if (camada != "") {
  154 + i3GEO.util.comboItens("i3GEOanimagifcolunat", i3GEOF.animagif.tema, function(retorno) {
  155 + $i("i3GEOANIMAGIFcolunatSel").innerHTML = retorno.dados;
  156 + }, "i3GEOanimagifcolunatSel");
  157 + $i("i3GEOANIMAGIFextensao").value = i3GEO.parametros.mapexten;
  158 + }
  159 + } else{
  160 + i3GEO.util.comboItens("i3GEOanimagifcolunat", i3GEOF.animagif.tema, function(retorno) {
  161 + $i("i3GEOANIMAGIFcolunatSel").innerHTML = retorno.dados;
  162 + }, "i3GEOanimagifcolunatSel");
  163 + $i("i3GEOANIMAGIFextensao").value = i3GEO.parametros.mapexten;
  164 + }
  165 + i3GEOF.animagif.ativaFoco();
  166 + },
  167 + rodape : function() {
  168 + var ins =
  169 + '<input class="paragrafo" id="i3GEOanimagifbotao1" type="button" value="' + $trad('geragif', i3GEOF.animagif.dicionario)
  170 + + '" style="cursor:pointer;color:blue"/>';
  171 + if (i3GEO.login.verificaCookieLogin() === true) {
  172 + ins +=
  173 + '<input class="paragrafo" style="margin-top:3px;" id="i3GEOanimagifbotaoSalva" type="button" value="' + $trad(
  174 + 'salvaParametros',
  175 + i3GEOF.animagif.dicionario)
  176 + + '" style="cursor:pointer;color:blue"/>';
  177 + ins +=
  178 + '<input class="paragrafo" style="margin-top:3px;" id="i3GEOanimagifbotaoRemove" type="button" value="' + $trad(
  179 + 'removeParametros',
  180 + i3GEOF.animagif.dicionario)
  181 + + '" style="cursor:pointer;color:blue"/>';
  182 + }
  183 + YAHOO.i3GEO.janela.manager.find("i3GEOF.animagif").setFooter(ins);
  184 +
  185 + var b = new YAHOO.widget.Button("i3GEOanimagifbotao1", {
  186 + onclick : {
  187 + fn : i3GEOF.animagif.ativa
  188 + }
  189 + });
  190 + b.addClass("rodar");
  191 + $i("i3GEOanimagifbotao1-button").style.width = "350px";
  192 + if (i3GEO.login.verificaCookieLogin() === true && i3GEO.parametros.editor === "sim") {
  193 + $i("parametrosComLogin").style.display = 'block';
  194 + b = new YAHOO.widget.Button("i3GEOanimagifbotaoSalva", {
  195 + onclick : {
  196 + fn : i3GEOF.animagif.salvaParametros
  197 + }
  198 + });
  199 + b.addClass("rodar");
  200 + $i("i3GEOanimagifbotaoSalva-button").style.width = "350px";
  201 +
  202 + b = new YAHOO.widget.Button("i3GEOanimagifbotaoRemove", {
  203 + onclick : {
  204 + fn : i3GEOF.animagif.removeParametros
  205 + }
  206 + });
  207 + b.addClass("rodar");
  208 + $i("i3GEOanimagifbotaoRemove-button").style.width = "350px";
  209 + }
  210 + },
  211 + /*
  212 + * Function: html
  213 + *
  214 + * Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta
  215 + *
  216 + * Retorno:
  217 + *
  218 + * String com o c&oacute;digo html
  219 + */
  220 + html : function() {
  221 + var ins = Mustache.render(i3GEOF.animagif.MUSTACHE, i3GEOF.animagif.mustacheHash());
  222 + return ins;
  223 + },
  224 + /*
  225 + * Function: iniciaJanelaFlutuante
  226 + *
  227 + * Cria a janela flutuante para controle da ferramenta.
  228 + */
  229 + iniciaJanelaFlutuante : function(tema) {
  230 + i3GEOF.animagif.tema = tema;
  231 + var minimiza, cabecalho, janela, divid, temp, titulo;
  232 + if ($i("i3GEOF.animagif")) {
  233 + i3GEOF.animagif.inicia("i3GEOF.animagif_corpo");
  234 + return;
  235 + }
  236 + cabecalho = function() {
  237 + i3GEOF.animagif.ativaFoco();
  238 + };
  239 + minimiza = function() {
  240 + i3GEO.janela.minimiza("i3GEOF.animagif");
  241 + };
  242 + // cria a janela flutuante
  243 + titulo =
  244 + "<span class='i3GEOiconeFerramenta i3GEOiconeanimagif'></span>" + "<div id='i3GEOFanimagifComboCabeca' class='comboTemasCabecalho'> ------</div>"
  245 + + "<div class='i3GeoTituloJanela'>animagif </span><a class=ajuda_usuario target=_blank href='"
  246 + + i3GEO.configura.locaplic
  247 + + "/ajuda_usuario.php?idcategoria=5&idajuda=108' ><b> </b></a></div>";
  248 + janela = i3GEO.janela.cria("380px", "320px", "", "", "", titulo, "i3GEOF.animagif", false, "hd", cabecalho, minimiza, "", true);
  249 + divid = janela[2].id;
  250 + i3GEOF.animagif.aguarde = $i("i3GEOF.animagif_imagemCabecalho").style;
  251 + $i("i3GEOF.animagif_corpo").style.backgroundColor = "white";
  252 + i3GEOF.animagif.inicia(divid);
  253 + temp = function() {
  254 + i3GEO.eventos.removeEventos(
  255 + "ATUALIZAARVORECAMADAS",
  256 + [
  257 + 'i3GEO.janela.comboCabecalhoTemas("i3GEOFanimagifComboCabeca","i3GEOFanimagifComboCabecaSel","animagif","ligadosComTabela")'
  258 + ]
  259 + );
  260 + };
  261 + YAHOO.util.Event.addListener(janela[0].close, "click", temp);
  262 + },
  263 + /*
  264 + * Function: ativaFoco
  265 + *
  266 + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado
  267 + */
  268 + ativaFoco : function() {
  269 + var i = $i("i3GEOF.animagif_c").style;
  270 + i3GEO.janela.ULTIMOZINDEX++;
  271 + i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX;
  272 + },
  273 + salvaParametros: function(){
  274 + //monta a string JSON que sera enviada para gravacao
  275 + //'{"titulo":"População","colnome":"CNTRY_NAME","colsdata":["POP_CNTRY"],"lmax":"100000","amax":"2000000","auto":"sim","exec":"sim"}'
  276 + var j, colsdata = i3GEOF.animagif.pegaItensMarcados(), auto = "nao", exec = "nao";
  277 + if($i("ativaAoAdic").checked === true){
  278 + auto = "sim";
  279 + }
  280 + if($i("execAoAdic").checked === true){
  281 + exec = "sim";
  282 + }
  283 +
  284 + j = '{"titulo":"'
  285 + + $i("i3GEOanimagiftitulo").value
  286 + + '","colnome":"'
  287 + + $i("i3GEOanimagifregioes").value
  288 + + '","colsdata":['
  289 + + '"' + colsdata.join('","') + '"'
  290 + + '],"lmax":"'
  291 + + $i("i3GEOanimagifmaxHeight").value
  292 + + '","amax":"'
  293 + + $i("i3GEOanimagifbarSize").value
  294 + + '","outlinecolor":"'
  295 + + $i("i3GEOanimagifoutlinecolor").value
  296 + + '","numvertices":"'
  297 + + $i("i3GEOanimagifnumvertices").value
  298 + + '","auto":"'
  299 + + auto
  300 + + '","exec":"'
  301 + + exec
  302 + + '"}';
  303 +
  304 + i3GEO.janela.confirma($trad("incluiPar", i3GEOF.animagif.dicionario), 300, $trad("x14"),
  305 + "", function() {
  306 + p = i3GEO.configura.locaplic + "/ferramentas/animagif/manutencao.php";
  307 + par = "&g_sid=" + i3GEO.configura.sid
  308 + + "&tema=" + i3GEOF.animagif.tema
  309 + + "&animagif=" + i3GEO.util.base64encode(j)
  310 + + "&funcao=incluianimagif";
  311 +
  312 + retorno =
  313 + function(retorno) {
  314 + i3GEO.janela.fechaAguarde("animagif");
  315 + };
  316 + i3GEO.janela.abreAguarde("animagif", $trad("o1"));
  317 + cpJSON.call(p, "foo", retorno, par);
  318 + });
  319 +
  320 + },
  321 + removeParametros: function(){
  322 + i3GEO.janela.confirma($trad("removePar", i3GEOF.animagif.dicionario), 300, $trad("x14"),
  323 + "", function() {
  324 + p = i3GEO.configura.locaplic + "/ferramentas/animagif/manutencao.php";
  325 + par = "&g_sid=" + i3GEO.configura.sid
  326 + + "&tema=" + i3GEOF.animagif.tema
  327 + + "&funcao=removeanimagif";
  328 +
  329 + retorno =
  330 + function(retorno) {
  331 + i3GEO.janela.fechaAguarde("animagif");
  332 + };
  333 + i3GEO.janela.abreAguarde("animagif", $trad("o1"));
  334 + cpJSON.call(p, "foo", retorno, par);
  335 + });
  336 + },
  337 + /*
  338 + * Function: ativa
  339 + *
  340 + * Cria o arquivo gif com os itens marcados
  341 + *
  342 + */
  343 + ativa : function() {
  344 + var par = "", temp;
  345 + temp = $i("i3GEOANIMAGIFcolunatSel").getElementsByTagName("select")[0];
  346 + if (temp.value === "") {
  347 + i3GEO.janela.tempoMsg($trad('selecionaCol', i3GEOF.animagif.dicionario));
  348 + return;
  349 + }
  350 + par = "colunat=" + temp.value;
  351 + temp = $i("i3GEOANIMAGIFtipocolunat");
  352 + par += "&tipocolunat=" + temp.value;
  353 + temp = $i("i3GEOANIMAGIFtempo");
  354 + par += "&tempo=" + temp.value;
  355 + temp = $i("i3GEOANIMAGIFw");
  356 + par += "&w=" + temp.value;
  357 + temp = $i("i3GEOANIMAGIFh");
  358 + par += "&h=" + temp.value;
  359 + temp = $i("i3GEOANIMAGIFcache").getElementsByTagName("select")[0];
  360 + par += "&cache=" + temp.value;
  361 + temp = $i("i3GEOANIMAGIFextensao");
  362 + par += "&extensao=" + temp.value;
  363 + temp = $i("i3GEOANIMAGIFlegenda").getElementsByTagName("select")[0];
  364 + par += "&legenda=" + temp.value;
  365 + temp = $i("i3GEOANIMAGIFtransparencia").getElementsByTagName("select")[0];
  366 + par += "&transparencia=" + temp.value;
  367 + temp = $i("i3GEOANIMAGIFoperador").getElementsByTagName("select")[0];
  368 + par += "&operador=" + temp.value;
  369 + temp = $i("i3GEOANIMAGIFnulos");
  370 + par += "&nulos=" + temp.value;
  371 +
  372 + i3GEO.janela.cria(
  373 + (parseInt($i("i3GEOANIMAGIFw").value,10) + 50) + "px",
  374 + (parseInt($i("i3GEOANIMAGIFh").value,10) + 50) + "px",
  375 + i3GEO.configura.locaplic+"/ferramentas/animagif/index.php?" + par + "&tema=" + i3GEOF.animagif.tema,
  376 + "",
  377 + "",
  378 + "GIF",
  379 + "i3GEOF.animagifGif",
  380 + false,
  381 + "hd",
  382 + "",
  383 + "",
  384 + "",
  385 + true
  386 + );
  387 + $i("i3GEOF.animagif_corpo").style.backgroundColor = "white";
  388 + }
  389 +};
... ...
ferramentas/animagif/index.php
... ... @@ -3,18 +3,16 @@ $url = strip_tags(&quot;./exec.php?&quot;.$_SERVER[&quot;QUERY_STRING&quot;]);
3 3 ?>
4 4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6   -
7 6 <head>
8 7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9 8 <script type="text/javascript" src="../../pacotes/libgifjs/libgif.js"></script>
10   - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  9 + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
11 10 <style>
12 11 body {
13 12 font-family: Verdana, Arial, Helvetica, sans-serif;
14 13 }
15 14 </style>
16 15 </head>
17   -
18 16 <body>
19 17 <center>
20 18 <img id="anima" src="<?php echo $url; ?>" rel:animated_src="<?php echo $url; ?>" rel:auto_play="1" width="<?php echo $_GET["w"]?>" height="<?php echo $_GET["h"]?>" />
... ...
ferramentas/animagif/manutencao.php 0 → 100755
... ... @@ -0,0 +1,125 @@
  1 +<?php
  2 +include_once(dirname(__FILE__)."/../inicia.php");
  3 +include_once(dirname(__FILE__)."/../../admin/php/login.php");
  4 +$funcoesEdicao = array(
  5 + "REMOVE",
  6 + "INCLUI"
  7 +);
  8 +if(in_array(strtoupper($funcao),$funcoesEdicao)){
  9 + if(verificaOperacaoSessao("admin/html/editormapfile") == false){
  10 + retornaJSON("Vc nao pode realizar essa operacao. Tente fazer login novamente.");exit;
  11 + }
  12 +}
  13 +error_reporting(0);
  14 +//
  15 +//faz a busca da fun&ccedil;&atilde;o que deve ser executada
  16 +//
  17 +$retorno = ""; //string que ser&aacute; retornada ao browser via JSON
  18 +switch (strtoupper($funcao))
  19 +{
  20 + case "REMOVE":
  21 + $mapa = ms_newMapObj($map_file);
  22 + $l = $mapa->getlayerbyname($tema);
  23 + if($l != ""){
  24 + $l->setmetadata("tme","");
  25 + $mapa->save($map_file);
  26 + }
  27 + $arq = $locaplic."/temas/".$tema.".map";
  28 + if(file_exists($arq)){
  29 + $mapa = ms_newMapObj($arq);
  30 + $l = $mapa->getlayerbyname($tema);
  31 + if($l != ""){
  32 + $l->setmetadata("animagif","");
  33 + $mapa->save($arq);
  34 + removeCabecalho($arq);
  35 + }
  36 + }
  37 + $retorno = "ok";
  38 + break;
  39 + case "INCLUI":
  40 + $mapa = ms_newMapObj($map_file);
  41 + $l = $mapa->getlayerbyname($tema);
  42 + if($l != ""){
  43 + $l->setmetadata("animagif",base64_decode($animagif));
  44 + $mapa->save($map_file);
  45 + }
  46 + $arq = $locaplic."/temas/".$tema.".map";
  47 + if(file_exists($arq)){
  48 + $mapa = ms_newMapObj($arq);
  49 + $l = $mapa->getlayerbyname($tema);
  50 + if($l != ""){
  51 + $l->setmetadata("animagif",base64_decode($animagif));
  52 + $mapa->save($arq);
  53 + removeCabecalho($arq);
  54 + }
  55 + }
  56 + $retorno = "ok";
  57 + break;
  58 +}
  59 +cpjson($retorno);
  60 +//TODO colocar essa funcao em algum lugar que permita reaproveitamento
  61 +function removeCabecalho($arq,$symbolset=true)
  62 +{
  63 + $handle = fopen($arq, "r");
  64 + if ($handle)
  65 + {
  66 + $cabeca = array();
  67 + if($symbolset)
  68 + {
  69 + $cabeca[] = "MAP\n";
  70 + }
  71 + $grava = false;
  72 + while (!feof($handle))
  73 + {
  74 + $linha = fgets($handle);
  75 + if($symbolset)
  76 + {
  77 + if(strpos(strtoupper($linha),"SYMBOLSET") !== false)
  78 + {
  79 + $cabeca[] = $linha;
  80 + }
  81 + if(strpos(strtoupper($linha),"FONTSET") !== false)
  82 + {
  83 + $cabeca[] = $linha;
  84 + }
  85 + }
  86 + if(strtoupper(trim($linha)) == "LAYER")
  87 + {
  88 + $grava = true;
  89 + }
  90 + if($grava)
  91 + {
  92 + $final[] = rtrim($linha, "\r\n") . PHP_EOL;
  93 + }
  94 + }
  95 + fclose($handle);
  96 + }
  97 + $final = array_merge($cabeca,$final);
  98 + $handle = fopen($arq, "w+");
  99 + foreach ($final as $f)
  100 + {
  101 + //
  102 + //remove resultados em branco
  103 + //e grava a linha
  104 + //
  105 + $teste = strtoupper($f);
  106 + $teste = trim($teste);
  107 + $teste = str_replace(" ","",$teste);
  108 + $teste = str_replace("'","",$teste);
  109 + $teste = str_replace('"',"",$teste);
  110 + $teste = preg_replace('/[\n\r\t ]*/', '', $teste);
  111 + $testar = array("KEYIMAGE","TILEINDEX","TILEITEM","SYMBOL","LABELITEM","FILTERITEM","GROUP","ENCODING","TIP","CLASSE","ITENSDESC","CLASSESNOME","ITENSLINK","ESCALA","CLASSESSIMBOLO","MENSAGEM","EXTENSAO","CLASSESITEM","ESCONDIDO","CLASSESCOR","DOWNLOAD","CLASSESTAMANHO","ITENS","TEMA","APLICAEXTENSAO","IDENTIFICA");
  112 + $passou = true;
  113 + foreach ($testar as $t)
  114 + {
  115 + if($teste == $t){
  116 + $passou = false;
  117 + }
  118 + }
  119 + if($passou)
  120 + fwrite($handle,$f);
  121 + }
  122 + fclose($handle);
  123 + chmod($arq, 0666);
  124 +}
  125 +?>
0 126 \ No newline at end of file
... ...
ferramentas/animagif/template_mst.html 0 → 100755
... ... @@ -0,0 +1,76 @@
  1 +<div style='text-align: left; background: yellow;'
  2 + id='i3GEOANIMAGIFresultado'></div>
  3 +<div style='display: none;' id='parametrosComLogin'>
  4 + <p class='paragrafo'>
  5 + <input type='checkbox' id='ativaAoAdic' /><label>{{{ativaAoAdic}}}</label>
  6 + <p class='paragrafo'>
  7 + <input type='checkbox' id='execAoAdic' /><label>{{{execAoAdic}}}</label>
  8 +</div>
  9 +<p class='paragrafo'>{{{colunat}}}
  10 +<div id='i3GEOANIMAGIFcolunatSel' class='styled-select'></div>
  11 +<br>
  12 +<p class='paragrafo'>{{{tipocolunat}}}
  13 +<div id='i3GEOANIMAGIFtipocolunat' class='styled-select'>
  14 + <select>
  15 + <option value='numero'>{{{numerico}}}</option>
  16 + <option value='string'>{{{texto}}}</option>
  17 + </select>
  18 +</div>
  19 +<br>
  20 +<p class='paragrafo'>{{{tempo}}}
  21 +<div class='i3geoForm i3geoFormIconeNumero'>
  22 + <input type='number' value='40' id='i3GEOANIMAGIFtempo' />
  23 +</div>
  24 +<br>
  25 +<p class='paragrafo'>{{{w}}}
  26 +<div class='i3geoForm i3geoFormIconeNumero'>
  27 + <input type='number' value='500' id='i3GEOANIMAGIFw' />
  28 +</div>
  29 +<br>
  30 +<p class='paragrafo'>{{{h}}}
  31 +<div class='i3geoForm i3geoFormIconeNumero'>
  32 + <input type='number' value='500' id='i3GEOANIMAGIFh' />
  33 +</div>
  34 +<br>
  35 +<p class='paragrafo'>{{{cache}}}
  36 +<div id='i3GEOANIMAGIFcache' class='styled-select'>
  37 + <select>
  38 + <option value='sim'>{{{sim}}}</option>
  39 + <option value='nao'>{{{nao}}}</option>
  40 + </select>
  41 +</div>
  42 +<br>
  43 +<p class='paragrafo'>{{{extensao}}}
  44 +<div class='i3geoForm i3geoFormIconeEdita'>
  45 + <input type='text' value='' id='i3GEOANIMAGIFextensao' />
  46 +</div>
  47 +<br>
  48 +<p class='paragrafo'>{{{legenda}}}
  49 +<div id='i3GEOANIMAGIFlegenda' class='styled-select'>
  50 + <select>
  51 + <option value='sim'>{{{sim}}}</option>
  52 + <option value='nao'>{{{nao}}}</option>
  53 + </select>
  54 +</div>
  55 +<br>
  56 +<p class='paragrafo'>{{{transparencia}}}
  57 +<div id='i3GEOANIMAGIFtransparencia' class='styled-select'>
  58 + <select>
  59 + <option value='sim'>{{{sim}}}</option>
  60 + <option value='nao'>{{{nao}}}</option>
  61 + </select>
  62 +</div>
  63 +<br>
  64 +<p class='paragrafo'>{{{operador}}}
  65 +<div class='styled-select' id='i3GEOANIMAGIFoperador'>
  66 + <select >
  67 + <option value=''>=</option>
  68 + <option value='lt'>lt</option>
  69 + <option value='gt'>gt</option>
  70 + </select>
  71 +</div>
  72 +<br>
  73 +<p class='paragrafo'>{{{nulos}}}
  74 +<div class='i3geoForm i3geoFormIconeEdita'>
  75 + <input type='text' value='' id='i3GEOANIMAGIFnulos' />
  76 +</div>
... ...