From cfb09f845a7952d48b8727c8d555ac6a86846db5 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 17 Jan 2011 14:05:58 +0000 Subject: [PATCH] Inclusão de bookmark na árvore de temas e ícone indicando qd um tema está ativo como etiqueta (ferramenta identifica) --- classesjs/classe_arvoredetemas.js | 16 +++++++++++++--- classesjs/classe_barradebotoes.js | 8 +++++--- classesjs/classe_interface.js | 2 +- classesphp/classe_atributos.php | 46 +++++++++------------------------------------- ferramentas/comentarios/index.php | 3 ++- ferramentas/identifica/index.js.php | 12 ++++++++---- imagens/tips.png | Bin 0 -> 436 bytes interface/openlayers.htm | 2 +- pacotes/openid/login.php | 1 + 9 files changed, 40 insertions(+), 50 deletions(-) create mode 100644 imagens/tips.png diff --git a/classesjs/classe_arvoredetemas.js b/classesjs/classe_arvoredetemas.js index 74317ff..e0d6131 100644 --- a/classesjs/classe_arvoredetemas.js +++ b/classesjs/classe_arvoredetemas.js @@ -85,7 +85,9 @@ i3GEO.arvoreDeTemas = { uploadgpx: true, - comentarios: true + comentarios: true, + + bookmark: true } Tipo: @@ -111,7 +113,8 @@ i3GEO.arvoreDeTemas = { refresh: true, carousel: true, uploadgpx: true, - comentarios: true + comentarios: true, + bookmark: true }, /* Propriedade: FATORESTRELA @@ -1077,7 +1080,8 @@ i3GEO.arvoreDeTemas = { idtema:temas[i].tid, fonte:temas[i].link, ogc:temas[i].ogc, - kmz:temas[i].kmz + kmz:temas[i].kmz, + bookmark:"sim" }, node, false, @@ -1272,6 +1276,12 @@ i3GEO.arvoreDeTemas = { tempNode.enableHighlight = false; tempNode.isLeaf = true; } + if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.bookmark === true){ + html = i3GEO.util.bookmark(i3GEO.configura.locaplic+"/ms_criamapa.php?layers="+node.data.idtema); + tempNode = new YAHOO.widget.HTMLNode({html:html}, node, false,true); + tempNode.enableHighlight = false; + tempNode.isLeaf = true; + } node.loadComplete(); }, /* diff --git a/classesjs/classe_barradebotoes.js b/classesjs/classe_barradebotoes.js index 83afc5a..5ffe571 100644 --- a/classesjs/classe_barradebotoes.js +++ b/classesjs/classe_barradebotoes.js @@ -610,7 +610,9 @@ i3GEO.barraDeBotoes = { {i3GEO.util.mudaCursor(i3GEO.configura.cursores,"contexto",idconteudonovo,i3GEO.configura.locaplic);} //copia os botoes do HTML para a janela ticone = 28; - alturadisponivel = i3GEO.parametros.h - i3GEO.Interface.BARRABOTOESTOP - ticone - 18; + alturadisponivel = i3GEO.parametros.h - i3GEO.Interface.BARRABOTOESTOP - ticone - 18 - 28; + if(i3GEO.barraDeBotoes.AUTOALTURA === true) + {alturadisponivel += 28;} numerobotoes = parseInt(alturadisponivel / ticone,10); falta = alturadisponivel - (ticone * numerobotoes); if($i(idconteudo)) @@ -649,9 +651,9 @@ i3GEO.barraDeBotoes = { } YAHOO.namespace("janelaBotoes.xp"); if(i3GEO.barraDeBotoes.AUTOALTURA === false || barraZoom === true || (elementos.length > numerobotoes)) - {YAHOO.janelaBotoes.xp.panel = new YAHOO.widget.Panel(idconteudonovo, {width:wj, fixedcenter: false, constraintoviewport: false, underlay:"none", close:i3GEO.barraDeBotoes.PERMITEFECHAR, visible:true, draggable:i3GEO.barraDeBotoes.PERMITEDESLOCAR, modal:false,iframe:false } );} + {YAHOO.janelaBotoes.xp.panel = new YAHOO.widget.Panel(idconteudonovo, {zIndex:20000,width:wj, fixedcenter: false, constraintoviewport: false, underlay:"none", close:i3GEO.barraDeBotoes.PERMITEFECHAR, visible:true, draggable:i3GEO.barraDeBotoes.PERMITEDESLOCAR, modal:false,iframe:false } );} else - {YAHOO.janelaBotoes.xp.panel = new YAHOO.widget.Panel(idconteudonovo, {height:i3GEO.parametros.h - 4,width:wj, fixedcenter: false, constraintoviewport: false, underlay:"none", close:i3GEO.barraDeBotoes.PERMITEFECHAR, visible:true, draggable:i3GEO.barraDeBotoes.PERMITEDESLOCAR, modal:false,iframe:false } );} + {YAHOO.janelaBotoes.xp.panel = new YAHOO.widget.Panel(idconteudonovo, {zIndex:20000,height:i3GEO.parametros.h - 4,width:wj, fixedcenter: false, constraintoviewport: false, underlay:"none", close:i3GEO.barraDeBotoes.PERMITEFECHAR, visible:true, draggable:i3GEO.barraDeBotoes.PERMITEDESLOCAR, modal:false,iframe:false } );} if(i3GEO.barraDeBotoes.SOICONES === true){ temp = $i("i3geo_barra2"); diff --git a/classesjs/classe_interface.js b/classesjs/classe_interface.js index 4277982..42c649b 100644 --- a/classesjs/classe_interface.js +++ b/classesjs/classe_interface.js @@ -868,7 +868,7 @@ i3GEO.Interface = { if(i3geoOL.getLayersByName(camada.name).length == 0){ urllayer = url+"&layer="+camada.name; try{ - if(camada.escondido === "sim" || camada.connectiontype === 10 || camada.type === 4 || camada.type === 8 ) + if(camada.escondido === "sim" || camada.connectiontype === 10 || camada.type === 0 || camada.type === 4 || camada.type === 8 ) {opcoes.singleTile = true;} else{ if(camada.type === 3) //raster diff --git a/classesphp/classe_atributos.php b/classesphp/classe_atributos.php index 1314cdc..fa6eb42 100644 --- a/classesphp/classe_atributos.php +++ b/classesphp/classe_atributos.php @@ -1144,7 +1144,6 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado $mapa = desligatemas($mapa); $mapa = desligamargem($mapa); $imgo = $mapa->draw(); - //$formatoinfo = "MIME"; $formatosinfo = $layer->getmetadata("formatosinfo"); if ($formatosinfo != "") @@ -1164,42 +1163,12 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado {$formatoinfo = $layer->getmetadata("wms_feature_info_mime_type");} if($formatoinfo == "") {$formatoinfo = "text/plain";} - } - /* - $srs = $layer->getmetadata("wms_srs"); - $srss = explode(" ",$srs); - $srs = "EPSG:4326"; - foreach ($srss as $s) - { - if(strtoupper($s) == "EPSG:4291") - {$srs = "EPSG:4291";} } - $res .= "&SRS=".$srs; - $resposta = file($res."&FORMAT=".$formatoinfo); - */ $res = $layer->getWMSFeatureInfoURL($ptimg->x, $ptimg->y, 1,$formatoinfo); $res = str_replace("INFOFORMAT","INFO_FORMAT",$res); $res2 = $layer->getWMSFeatureInfoURL($ptimg->x, $ptimg->y, 1,"MIME"); $res2 = str_replace("INFOFORMAT","INFO_FORMAT",$res2); $resposta = file($res); - /* - $resposta = str_ireplace('',"",$resposta); - $resposta = str_ireplace('',"",$resposta); - $resposta = str_ireplace("","",$resposta); - $resposta = str_ireplace('","zzzzzzzzzz",$resposta); - if (stristr(implode(" ",$resposta),"msWMSLoadGetMapParams")) - { - $resposta = file($res); - $resposta = str_ireplace('',"",$resposta); - $resposta = str_ireplace('',"",$resposta); - $resposta = str_ireplace("","",$resposta); - $resposta = str_ireplace('","zzzzzzzzzz",$resposta); - } - */ $n = array(); if(strtoupper($formatoinfo) == "TEXT/HTML") { @@ -1269,9 +1238,7 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado $locimg = $layer->getmetadata("IMGLOC"); //indica o local onde estão os ícones $tips = $layer->getmetadata("TIP"); $itensLayer = pegaItens($layer); - $nitens = count($itensLayer); - if($itens == "") {$itens = $itensLayer;} else @@ -1296,6 +1263,8 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado {$locimg = array_fill(0, $nitens-1,'');} else {$locimg = explode(",",$locimg);} + $tips = str_replace(" ",",",$tips); + $tips = explode(",",$tips); //o retorno deve ser do tipo TIP if($etip == true) { @@ -1308,7 +1277,6 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado $lks = array(); $itemimg = array(); $locimg = array(); - $tips = explode(",",$tips); foreach($tips as $t) { $itens[] = $t; @@ -1343,13 +1311,17 @@ $listaDeTemas - (opcional) Lista com os códigos dos temas que serão identificado {$img = "";} else if($itemimg[$conta] != "") - {$img = "";} - + {$img = "";} + //indica se o item é tbm uma etiqueta + $etiqueta = "nao"; + if(in_array($it,$tips)) + {$etiqueta = "sim";} $arraytemp = array( "alias"=>$this->converte($itensdesc[$conta]), "valor"=>$this->converte($val), "link"=>$link, - "img"=>$img + "img"=>$img, + "tip"=>$etiqueta ); if($etip==false) {$valori[] = $arraytemp;} diff --git a/ferramentas/comentarios/index.php b/ferramentas/comentarios/index.php index 2303b45..7cbff01 100644 --- a/ferramentas/comentarios/index.php +++ b/ferramentas/comentarios/index.php @@ -24,6 +24,7 @@ if(!empty($parametrosURL["limpalogin"])) session_name("openid"); session_start(); $_SESSION["g_sid"] = $parametrosURL["g_sid"]; + $_SESSION["locaplic"] = $parametrosURL["locaplic"]; } if(!empty($parametrosURL["tema"])) {$_SESSION["tema"] = $parametrosURL["tema"];} @@ -52,7 +53,7 @@ function linkOpenId() function formularioInsere() { echo "

Adicione um comentário:

"; - $url = $_SESSION["locaplic"]."/ferramentas/comentarios/index.php?g_sid=".$_SESSION["g_sid"]."&tema=".$_SESSION["tema"]; + $url = $_SESSION["locaplic"]."/ferramentas/comentarios/index.php?g_sid=".$_SESSION["g_sid"]."&tema=".$_SESSION["tema"]."&locaplic=".$_SESSION["locaplic"]; echo "
"; echo "
"; echo " "; diff --git a/ferramentas/identifica/index.js.php b/ferramentas/identifica/index.js.php index 9a8c0f1..395cc1a 100644 --- a/ferramentas/identifica/index.js.php +++ b/ferramentas/identifica/index.js.php @@ -145,12 +145,12 @@ i3GEOF.identifica = { i3GEO.guias.mostraGuiaFerramenta("i3GEOidentificaguia4","i3GEOidentificaguia"); new YAHOO.widget.Button("i3GEOidentificabotao1",{onclick:{fn: function(){ if(i3GEO.temaAtivo !== ""){ - var ltema = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo); if(ltema.identifica == "nao" || ltema.identifica == "NAO") {alert("Esse tema não permite etiquetas");} else {i3GEO.tema.dialogo.etiquetas(i3GEO.temaAtivo);} + $i("i3GEOidentificaocorrencia").innerHTML = ""; } else {alert("Nenhum tema definido");} @@ -583,7 +583,7 @@ i3GEOF.identifica = { retorno {JSON} - objeto JSON com os dados */ mostraDadosTema: function(retorno){ - var res="",div0,ntemas,i,resultados,nres,cor,j,itens,nitens,k,atualN = "todas",inicio=0,numResultados; + var res="",div0,ntemas,i,resultados,nres,cor,j,itens,nitens,k,atualN = "todas",inicio=0,numResultados,tip; if($i("i3GEOFidentificaNocorrencias")) {atualN = $i("i3GEOFidentificaNocorrencias").value;} $i("i3GEOF.identifica_corpo").scrollTop = 0; @@ -614,10 +614,14 @@ i3GEOF.identifica = { { nitens = resultados[j].length; for(k=0;k"; + } if(resultados[j][k].link === "") - {res += "
  "+resultados[j][k].alias+": "+resultados[j][k].valor+"
";} + {res += "
"+tip+resultados[j][k].alias+": "+resultados[j][k].valor+"
";} else - {res += "
  "+resultados[j][k].alias+": "+resultados[j][k].valor+"
";} + {res += "
"+tip+resultados[j][k].alias+": "+resultados[j][k].valor+"
";} if(resultados[j][k].img !== "") {res += "
"+resultados[j][k].img+"
";} if (cor === "RGB(250,250,250)"){cor = "beige";} diff --git a/imagens/tips.png b/imagens/tips.png new file mode 100644 index 0000000..8405428 Binary files /dev/null and b/imagens/tips.png differ diff --git a/interface/openlayers.htm b/interface/openlayers.htm index f16afd8..3692ba0 100644 --- a/interface/openlayers.htm +++ b/interface/openlayers.htm @@ -183,7 +183,7 @@ i3GEO.Interface.openlayers.GADGETS = { ScaleLine:true, OverviewMap:false }; -i3GEO.Interface.openlayers.TILES = false; +i3GEO.Interface.openlayers.TILES = true; /* Após a criação, é criado o objeto i3geoOL que corresponde ao objeto map da API do OpenLayers. Vc pode usar i3geoOL para aplicar os métodos e verificar as propriedades da API do OpenLayers diff --git a/pacotes/openid/login.php b/pacotes/openid/login.php index d0c4072..dae6799 100644 --- a/pacotes/openid/login.php +++ b/pacotes/openid/login.php @@ -136,5 +136,6 @@ function submete(quem){ } } catch(ErrorException $e) { echo $e->getMessage(); + echo "
O nome de usuario pode estar errado."; } ?> \ No newline at end of file -- libgit2 0.21.2