From f31b471644c72223472b8e9641fe07ec138019d6 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 13 Aug 2009 12:00:05 +0000 Subject: [PATCH] Criação de uma nova função para a identificação de etiquetas, depreciando a função anterior --- classesjs/classe_mapa.js | 83 +++++++++++++++++++++++++++++++++++++++++++++++------------------------------------ classesjs/classe_php.js | 20 ++++++++++++++++++-- classesphp/classe_atributos.php | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ classesphp/classe_menutemas.php | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------- classesphp/mapa_controle.php | 18 ++++++++++++++++++ 5 files changed, 521 insertions(+), 123 deletions(-) diff --git a/classesjs/classe_mapa.js b/classesjs/classe_mapa.js index 59b3246..4727d0e 100644 --- a/classesjs/classe_mapa.js +++ b/classesjs/classe_mapa.js @@ -671,51 +671,62 @@ i3GEO.mapa = { var etiquetas = false; for(var j=0;j= 0){ - do{ - var titulo = temas[tema].split("@"); - if (i3GEO.configura.tipotip == "completo" || i3GEO.configura.tipotip == "balao") - {res += ""+titulo[0]+"
";} - var ocorrencias = titulo[1].split("*"); - var ocorrencia = ocorrencias.length-1; - if(ocorrencia >= 0){ - do{ - if (ocorrencias[ocorrencia] != ""){ - var pares = ocorrencias[ocorrencia].split("##"); - var paresi = pares.length; - for (var par=0;par" + valores[0] + " " + valores[1] + "
"; - var mostra = true; - } - else{ - res = res + "" + valores[1] + "
"; - var mostra = true; - } - } + var temas = retorno; + var ntemas = temas.length; + for(var j=0;j
";} + else + {var titulo = "";} + var tips = (temas[j].resultado.tips).split(","); + var ntips = tips.length; + var ins = ""; + for(var r=0;r
"; + if(img != "") + ins += img+"
"; + + var mostra = true; + } + else{ + ins += "" + valor + "
"; + var mostra = true; } } - while(ocorrencia--) } } - while(tema--) + if(ins != "") + var res = res + titulo + ins; + } + if(!mostra){ + if($i("tip")) + $i("tip").style.display="none"; + return; } - if(!mostra){$i("tip").style.display="none";return;} else{ if(i3GEO.configura.tipotip != "balao"){ var n = i3GEO.janela.tip(); @@ -733,7 +744,7 @@ i3GEO.mapa = { } } } - if($i("img")){ + if(i3GEO.interface.ATUAL=="padrao"){ var temp = "zoom"; if(i3GEO.interface.ATIVAMENUCONTEXTO) var temp = "identifica_contexto"; @@ -741,7 +752,7 @@ i3GEO.mapa = { } } catch(e){ - if($i("img")){ + if(i3GEO.interface.ATUAL=="padrao"){ var temp = "identifica"; if(i3GEO.interface.ATIVAMENUCONTEXTO) var temp = "identifica_contexto"; @@ -749,7 +760,7 @@ i3GEO.mapa = { } } }; - i3GEO.php.identifica(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5"); + i3GEO.php.identifica2(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5"); } } }; diff --git a/classesjs/classe_php.js b/classesjs/classe_php.js index ff4db07..0b4460d 100644 --- a/classesjs/classe_php.js +++ b/classesjs/classe_php.js @@ -788,7 +788,9 @@ i3GEO.php = { }, /* Function: identifica - + + Depreciado na versão 4.2 (utilize "identifica2") + PHP: classesphp/classe_atributos.php @@ -796,10 +798,24 @@ i3GEO.php = { */ identifica: function(funcao,x,y,resolucao){ i3GEO.php.verifica(); - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid; + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica2&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid; cpJSON.call(p,"identifica",funcao); }, /* + Function: identifica2 + + PHP: + classesphp/classe_atributos.php + + identifica2> + */ + identifica2: function(funcao,x,y,resolucao){ + i3GEO.php.verifica(); + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica2&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid; + cpJSON.call(p,"identifica",funcao); + }, + + /* Function: reiniciaMapa PHP: diff --git a/classesphp/classe_atributos.php b/classesphp/classe_atributos.php index 7bfe573..3ac7883 100644 --- a/classesphp/classe_atributos.php +++ b/classesphp/classe_atributos.php @@ -536,6 +536,8 @@ Include: /* function: identifica +Depreciado na versão 4.2 (utilize "identifica2") + Identifica elementos no mapa. parameters: @@ -661,8 +663,166 @@ $resolucao - Resolucao de busca. {return("");} } /* +function: identifica2 + +Identifica elementos no mapa. + +parameters: + +$opcao - Opcao tip|tema|ligados|todos. + +$xy - coordenada x e y separadas por virgulao. + +$resolucao - Resolucao de busca. +*/ + function identifica2($opcao,$xy,$resolucao) + { + $temas = $this->mapa->getalllayernames(); + foreach ($temas as $tem) + { + $vermultilayer = new vermultilayer(); + $vermultilayer->verifica($this->arquivo,$tem); + if ($vermultilayer->resultado == 1) // o tema e multi layer + { + foreach (($vermultilayer->temasvisiveis) as $tv) + { + $l = $this->mapa->getlayerbyname($tv); + if ($l->getmetadata("identifica") != "nao") + {$listatemas[] = $tv;} + } + } + else + { + $l = $this->mapa->getlayerbyname($tem); + if (($l->getmetadata("escondido") == "") && ($l->getmetadata("identifica") != "nao")) + {$listatemas[] = $tem;} + } + } + $listatemas = array_unique($listatemas); + $xyarray = explode(",",$xy); + $resultados = array(); + //pesquisa um tema + if ($opcao == "tema") + { + $listatemas = array(); + $vermultilayer = new vermultilayer(); + $vermultilayer->verifica($this->arquivo,$this->nome); + if ($vermultilayer->resultado == 1) // o tema e multi layer + {$listatemp = $vermultilayer->temasvisiveis;} + else + {$listatemp[] = $this->nome;} + foreach ($listatemp as $t) + { + $layerteste = $this->mapa->getlayerbyname($t); + $mclasse = strtoupper($layerteste->getmetadata("CLASSE")); + $mtema = strtoupper($layerteste->getmetadata("TEMA")); + $gr = $layerteste->group; + if ((!(($mclasse == "NAO") && ($mtema == "NAO"))) || ($gr != "")) + { + if (($layerteste->data != "") && ($layerteste->connectiontype != MS_WMS)) + {$listatemas[] = $t;} + } + } + $layerteste = $this->layer; + if ($layerteste->connectiontype == MS_WMS) + { + $listatemas = array(); + $listatemas[] = $this->nome; + } + foreach ($listatemas as $tema) + { + $resultados[$tema] = $this->identificaQBP($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao); + } + } + //pesquisa todos os temas acrescentados no mapa + if ($opcao == "todos") + { + foreach ($listatemas as $tema) + { + $resultados[$tema] = $this->identificaQBP($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao); + } + } + //pesquisa apenas os temas visiveis + if ($opcao == "ligados") + { + $novalista = array(); + foreach ($listatemas as $tema) + { + $l = $this->mapa->getlayerbyname($tema); + if($l->status == MS_DEFAULT) + $novalista[] = $tema; + $listatemas = $novalista; + } + foreach ($listatemas as $tema) + { + $l = $this->mapa->getlayerbyname($tema); + $resultados[$tema] = $this->identificaQBP($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao); + } + //var_dump($resultados); + } + //pesquisa apenas os temas com tip + if ($opcao == "tip") + { + $ltemp = array(); + foreach ($listatemas as $tema) + { + $tl = $this->mapa->getlayerbyname($tema); + $itemtip = $tl->getmetadata("TIP"); + if ($itemtip != "") + { + if ($tl->status == MS_DEFAULT) + { + $resultados[$tema] = array("tips"=>$itemtip,"dados"=>$this->identificaQBP2($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao,$itemtip)); + $ltemp[] = $tema; + } + } + } + $listatemas = $ltemp; + } + if (count($resultados) > 0) + { + $res = $this->retornaI2($listatemas,$resultados,$this->mapa); + return($res); + } + else + {return("");} + } +/* +function: retornaI2 + +Depreciado na versão 4.2 + +Processa o resultado da identificação de um elemento compondo um array de strings formatadas. + +parameters: +$listatemas - Lista de temas + +$resultados - Resultados de cada tema. + +$map - Objeto Map. +*/ +function retornaI2($listatemas,$resultados,$map) +{ + $final = array(); + foreach ($listatemas as $tema) + { + $layer = $map->getlayerbyname($tema); + $nometmp = $tema; + if (strtoupper($layer->getMetaData("TEMA")) != "NAO") + {$nometmp = $layer->getMetaData("TEMA");} + else if ($layer->getMetaData("ALTTEMA") != "") + {$nometmp = $layer->getMetaData("ALTTEMA");} + $nometmp = mb_convert_encoding($nometmp,"UTF-8","ISO-8859-1"); + $final[] = array("nome"=>$nometmp,"resultado"=>$resultados[$tema]); + } + return $final; +} + +/* function: retornaI +Depreciado na versão 4.2 + Processa o resultado da identificação de um elemento compondo um array de strings formatadas. parameters: @@ -703,6 +863,8 @@ function retornaI($listatemas,$resultados,$map) /* function: identificaQBP +Depreciado na versão 4.2 + Identifica um elemento utilizando querybypoint. parameters: @@ -906,5 +1068,191 @@ function identificaQBP($tema,$x,$y,$map_file,$resolucao,$item="",$tiporetorno="" {$resultado[] = " ";} return $resultado; } +/* +function: identificaQBP2 + +Identifica um elemento utilizando querybypoint. + +parameters: + +$tema - Tema que será identificado + +$x - Coordenada X. + +$y - Coordenada Y. + +$map_file - Arquivo map file. + +$resolucao - Resolução de busca. + +$item - Item único que será identificado. + +$tiporetorno - Tipo de retorno dos dados. Se for vazio, o retorno é formatado como string, se for shape, retorna o objeto shape +*/ +function identificaQBP2($tema,$x,$y,$map_file,$resolucao,$item="",$tiporetorno="") +{ + $mapa = ms_newMapObj($map_file); + $layer = $mapa->getLayerByName($tema); + $layer->set("status",MS_DEFAULT); + $layer->set("template","none.htm"); + $pt = ms_newPointObj(); + $pt->setXY($x, $y); + // + //operação especial para o caso de wms + // + if($layer->connectiontype == MS_WMS) + { + $layer->set("toleranceunits",MS_PIXELS); + $layer->set("tolerance",$resolucao); + $ptimg = xy2imagem($map_file,array($x,$y)); + $mapa = desligatemas($mapa); + $mapa = desligamargem($mapa); + $imgo = $mapa->draw(); + //$res = $layer->getWMSFeatureInfoURL($ptimg->x, $ptimg->y, 1,"MIME"); + $resultado = array(); + $res = $layer->connection; + $res .= "&request=getfeatureinfo&service=wms"; + $res .= "&version=1.1.0";//.($layer->getmetadata("wms_version")); + $res .= "&QUERY_LAYERS=".($layer->getmetadata("wms_name")); + $res .= "&LAYERS=".($layer->getmetadata("wms_name")); + $bb = $mapa->extent; + $res .= "&BBOX=".($bb->minx).",".($bb->miny).",".($bb->maxx).",".($bb->maxy); + $res .= "&X=".round($ptimg->x); + $res .= "&Y=".round($ptimg->y); + $res .= "&WIDTH=".$mapa->width; + $res .= "&HEIGHT=".$mapa->height; + $formatoinfo = "text/plain"; + $formatosinfo = $layer->getmetadata("formatosinfo"); + if ($formatosinfo != "") + { + $formatosinfo = explode(",",$formatosinfo); + if ($formatosinfo[0] != ""){$formatoinfo = $formatosinfo[0];} + foreach ($formatosinfo as $f) + { + if(strtoupper($f) == "TEXT/PLAIN") + {$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); + $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); + } + $resultado[] = $resposta; + return $resultado; + } + if(($layer->connectiontype != MS_WMS) && ($layer->type == MS_LAYER_RASTER)) + { + $layer->set("toleranceunits",MS_PIXELS); + $layer->set("tolerance",$resolucao); + $ident = @$layer->queryByPoint($pt, 0, 0); //0.01); + } + if (($layer->type == MS_LAYER_POINT) || ($layer->type == MS_LAYER_LINE)) + { + $layer->set("toleranceunits",MS_PIXELS); + $layer->set("tolerance",$resolucao); + $ident = @$layer->queryByPoint($pt, 1, 0); //0.01); + } + if ($layer->type == MS_LAYER_POLYGON) + { + $layer->set("toleranceunits",'MS_PIXEL'); + $layer->set("tolerance",1); + $ident = @$layer->queryByPoint($pt, 1, 0); + } + if ($ident == MS_SUCCESS) + { + $itens = $layer->getmetadata("ITENS"); // itens + $itensdesc = $layer->getmetadata("ITENSDESC"); // descrição dos itens + $lks = $layer->getmetadata("ITENSLINK"); // link dos itens + $itemimg = $layer->getmetadata("ITEMIMG"); //indica um item que será utilizado para colocar um ícone + $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 + {$itens = explode(",",$itens);} + + if($itensdesc == "") + {$itensdesc = array_fill(0, $nitens-1,'');} + else + {$itensdesc = explode(",",$itensdesc);} + if($lks == "") + {$lks = array_fill(0, $nitens-1,'');} + else + {$lks = explode(",",$lks);} + if($itemimg == "") + {$itemimg = array_fill(0, $nitens-1,'');} + else + {$itemimg = explode(",",$itemimg);} + if($locimg == "") + {$locimg = array_fill(0, $nitens-1,'');} + else + {$locimg = explode(",",$locimg);} + + $res_count = $layer->getNumresults(); + $sopen = $layer->open(); + if($sopen == MS_FAILURE){return "erro";} + for ($i = 0; $i < $res_count; ++$i) + { + $valori = array(); + $result = $layer->getResult($i); + $shp_index = $result->shapeindex; + $shape = $layer->getshape(-1, $shp_index); + $conta = 0; + foreach ($itens as $it) + { + $val = $shape->values[$it]; + $busca = '['.$it.']'; + $link = str_replace($busca,$val,$lks[$conta]); + + $img = ""; + if($locimg[$conta] != "" && $itemimg[$conta] != "") + {$img = "";} + else + if($itemimg[$conta] != "") + {$img = "";} + + $valori[$it] = array( + "alias"=>mb_convert_encoding($itensdesc[$conta],"UTF-8","ISO-8859-1"), + "valor"=>mb_convert_encoding($val,"UTF-8","ISO-8859-1"), + "link"=>$link, + "img"=>$img + ); + $conta = $conta + 1; + } + $resultado[] = $valori; + } + $layer->close(); + } + else + {$resultado[] = " ";} + return $resultado; +} } ?> \ No newline at end of file diff --git a/classesphp/classe_menutemas.php b/classesphp/classe_menutemas.php index cd2da28..29c564e 100644 --- a/classesphp/classe_menutemas.php +++ b/classesphp/classe_menutemas.php @@ -202,25 +202,25 @@ array { $down = "nao"; $ogc = "sim"; - $temp = ixml($temar,"DOWNLOAD"); + $temp = $this->ixml($temar,"DOWNLOAD"); if (($temp == "sim") || ($temp == "SIM")) {$down = "sim";} - $temp = ixml($temar,"OGC"); + $temp = $this->ixml($temar,"OGC"); if (($temp == "nao") || ($temp == "NAO")) {$ogc = "nao";} $link = " "; - $temp = ixml($temar,"TLINK"); + $temp = $this->ixml($temar,"TLINK"); if ($temp != "") {$link = $temp;} - $tid = ixml($temar,"TID"); - $nome = ixml($temar,"TNOME"); + $tid = $this->ixml($temar,"TID"); + $nome = $this->ixml($temar,"TNOME"); $temasraiz[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); } foreach($xml->GRUPO as $grupo) { $incluigrupo = TRUE; //filtra pelo perfil - $temp = ixml($grupo,"PERFIL"); + $temp = $this->ixml($grupo,"PERFIL"); if ($temp != "") { $incluigrupo = FALSE; @@ -237,32 +237,32 @@ array { $down = "nao"; $ogc = "sim"; - $temp = ixml($temar,"DOWNLOAD"); + $temp = $this->ixml($temar,"DOWNLOAD"); if (($temp == "sim") || ($temp == "SIM")) {$down = "sim";} - $temp = ixml($temar,"OGC"); + $temp = $this->ixml($temar,"OGC"); if (($temp == "nao") || ($temp == "NAO")) {$ogc = "nao";} $link = " "; - $temp = ixml($temar,"TLINK"); + $temp = $this->ixml($temar,"TLINK"); if ($temp != "") {$link = $temp;} - $tid = ixml($temar,"TID"); - $nome = ixml($temar,"TNOME"); + $tid = $this->ixml($temar,"TID"); + $nome = $this->ixml($temar,"TNOME"); $temas[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); } $grupodown = "nao"; - $grupoogc = "nao"; + $grupoogc = "sim"; foreach($grupo->SGRUPO as $sgrupo) { foreach($sgrupo->TEMA as $tema) { - $temp = ixml($tema,"DOWNLOAD"); + $temp = $this->ixml($tema,"DOWNLOAD"); if (($temp == "sim") || ($temp == "SIM")) {$grupodown = "sim";} - $temp = ixml($tema,"OGC"); - if (($temp == "") || ($temp == "sim") || ($temp == "SIM")) - {$grupoogc = "sim";} + $temp = $this->ixml($tema,"OGC"); + if (($temp == "nao") || ($temp == "NAO")) + {$grupoogc = "nao";} } } $subgrupos = array(); @@ -271,7 +271,7 @@ array foreach($grupo->SGRUPO as $sgrupo) { $incluisgrupo = TRUE; - $temp = ixml($sgrupo,"PERFIL"); + $temp = $this->ixml($sgrupo,"PERFIL"); if ($temp != "") { $incluisgrupo = FALSE; @@ -284,22 +284,22 @@ array { //verifica se existem temas que podem receber download $down = "nao"; - $ogc = "nao"; + $ogc = "sim"; foreach($sgrupo->TEMA as $tema) { - $temp = ixml($tema,"DOWNLOAD"); + $temp = $this->ixml($tema,"DOWNLOAD"); if (($temp == "sim") || ($temp == "SIM")) {$down = "sim";} - $temp = ixml($tema,"OGC"); - if (($temp == "") || ($temp != "sim") || ($temp != "SIM")) - {$ogc = "sim";} + $temp = $this->ixml($tema,"OGC"); + if (($temp == "nao") || ($temp == "NAO")) + {$ogc = "nao";} } - $nome = ixml($sgrupo,"SDTIPO"); + $nome = $this->ixml($sgrupo,"SDTIPO"); $subgrupos[] = array("nome"=>$nome,"download"=>$down,"ogc"=>$ogc); } } } - $nome = ixml($grupo,"GTIPO"); + $nome = $this->ixml($grupo,"GTIPO"); $grupos[] = array("nome"=>$nome,"ogc"=>$grupoogc,"download"=>$grupodown,"subgrupos"=>$subgrupos,"temasgrupo"=>$temas); } } @@ -363,7 +363,7 @@ array $subgrupos[] = array(); foreach($this->xml->GRUPO as $grupo) { - $temp = ixml($grupo,"PERFIL"); + $temp = $this->ixml($grupo,"PERFIL"); if ($conta == $codgrupo) { $incluigrupo = TRUE; @@ -382,7 +382,7 @@ array foreach($grupo->SGRUPO as $sgrupo) { $incluisgrupo = TRUE; - $temp = ixml($sgrupo,"PERFIL"); + $temp = $this->ixml($sgrupo,"PERFIL"); if ($temp != "") { $incluisgrupo = FALSE; @@ -394,17 +394,17 @@ array if (($incluisgrupo == TRUE)) { $down = "nao"; - $ogc = "nao"; + $ogc = "sim"; foreach($sgrupo->TEMA as $tema) { - $temp = ixml($tema,"DOWNLOAD"); + $temp = $this->ixml($tema,"DOWNLOAD"); if (($temp == "sim") || ($temp == "SIM")) {$down = "sim";} - $temp = ixml($tema,"OGC"); - if (($temp == "") || ($temp == "sim") || ($temp == "SIM")) - {$ogc = "sim";} + $temp = $this->ixml($tema,"OGC"); + if (($temp == "nao") || ($temp == "NAO")) + {$ogc = "nao";} } - $nome = ixml($sgrupo,"SDTIPO"); + $nome = $this->ixml($sgrupo,"SDTIPO"); $subgrupos[] = array("nome"=>$nome,"ogc"=>$ogc,"download"=>$down); } } @@ -413,19 +413,19 @@ array foreach($grupo->TEMA as $temar) { $down = "nao"; - $ogc = "nao"; - $temp = ixml($temar,"DOWNLOAD"); + $ogc = "sim"; + $temp = $this->ixml($temar,"DOWNLOAD"); if (($temp == "sim") || ($temp == "SIM")) {$down = "sim";} - $temp = ixml($temar,"OGC"); - if (($temp == "") || ($temp == "sim") || ($temp == "SIM")) - {$ogc = "sim";} + $temp = $this->ixml($temar,"OGC"); + if (($temp == "nao") || ($temp == "NAO")) + {$ogc = "nao";} $link = " "; - $temp = ixml($temar,"TLINK"); + $temp = $this->ixml($temar,"TLINK"); if ($temp != "") {$link = $temp;} - $tid = ixml($temar,"TID"); - $nome = ixml($temar,"TNOME"); + $tid = $this->ixml($temar,"TID"); + $nome = $this->ixml($temar,"TNOME"); $temas[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); } } @@ -476,10 +476,10 @@ array foreach($this->xml->GRUPO as $g) { $incluigrupo = TRUE; - if (ixml($g,"PERFIL") != "") + if ($this->ixml($g,"PERFIL") != "") { $incluigrupo = FALSE; - $temp = ixml($g,"PERFIL"); + $temp = $this->ixml($g,"PERFIL"); $perfis = str_replace(","," ",$temp); $perfis = explode(" ",$perfis); if ($this->array_in_array($this->perfil,$perfis)) @@ -493,10 +493,10 @@ array foreach ($g->SGRUPO as $s) { $incluisgrupo = TRUE; - if (ixml($s,"PERFIL") != "") + if ($this->ixml($s,"PERFIL") != "") { $incluisgrupo = FALSE; - $temp = ixml($s,"PERFIL"); + $temp = $this->ixml($s,"PERFIL"); $perfis = str_replace(","," ",$temp); $perfis = explode(" ",$perfis); if ($this->array_in_array($this->perfil,$perfis)) @@ -509,11 +509,11 @@ array foreach($s->TEMA as $tema) { $inclui = TRUE; - if (ixml($tema,"PERFIL") != "") + if ($this->ixml($tema,"PERFIL") != "") { $inclui = FALSE; - $temp = ixml($tema,"PERFIL"); + $temp = $this->ixml($tema,"PERFIL"); $perfis = str_replace(","," ",$temp); $perfis = explode(" ",$perfis); if ($this->array_in_array($this->perfil,$perfis)) @@ -529,10 +529,10 @@ array {$ogc = "nao";} $link = " "; if ($tema->TLINK != "") - {$link = ixml($tema,"TLINK");} - $tid = ixml($tema,"TID"); - $nome = ixml($tema,"TNOME"); - $temas[] = array("nacessos"=>(ixml($tema,"NACESSOS")),"tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); + {$link = $this->ixml($tema,"TLINK");} + $tid = $this->ixml($tema,"TID"); + $nome = $this->ixml($tema,"TNOME"); + $temas[] = array("nacessos"=>($this->ixml($tema,"NACESSOS")),"tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); } } } @@ -575,19 +575,19 @@ array //pega os sistemas checando os perfis foreach($this->xml->MAPA as $s) { - $ps = ixml($s,"PERFIL"); + $ps = $this->ixml($s,"PERFIL"); $perfis = str_replace(","," ",$ps); $perfis = explode(" ",$perfis); if (($this->array_in_array($this->perfil,$perfis)) || ($ps == "")) { - $n = ixml($s,"NOME"); - $i = ixml($s,"IMAGEM"); - $t = ixml($s,"TEMAS"); - $l = ixml($s,"LIGADOS"); - $e = ixml($s,"EXTENSAO"); - $o = ixml($s,"OUTROS"); - $k = ixml($s,"LINKDIRETO"); - $p = ixml($s,"PUBLICADO"); + $n = $this->ixml($s,"NOME"); + $i = $this->ixml($s,"IMAGEM"); + $t = $this->ixml($s,"TEMAS"); + $l = $this->ixml($s,"LIGADOS"); + $e = $this->ixml($s,"EXTENSAO"); + $o = $this->ixml($s,"OUTROS"); + $k = $this->ixml($s,"LINKDIRETO"); + $p = $this->ixml($s,"PUBLICADO"); $mapas[] = array("PUBLICADO"=>$p,"NOME"=>$n,"IMAGEM"=>$i,"TEMAS"=>$t,"LIGADOS"=>$l,"EXTENSAO"=>$e,"OUTROS"=>$o,"LINK"=>$k); } } @@ -614,11 +614,11 @@ Array {$xmlsistemas = simplexml_load_string(geraXmlSistemas(implode(" ",$this->perfil),$this->locaplic,$this->editores));} foreach($xmlsistemas->SISTEMA as $s) { - $publicado = ixml($s,"PUBLICADO"); + $publicado = $this->ixml($s,"PUBLICADO"); if(strtolower($publicado) != "nao" || $this->editor) { - $nomesis = ixml($s,"NOMESIS"); - $ps = ixml($s,"PERFIL"); + $nomesis = $this->ixml($s,"NOMESIS"); + $ps = $this->ixml($s,"PERFIL"); $perfis = str_replace(","," ",$ps); $perfis = explode(" ",$perfis); if (($this->array_in_array($this->perfil,$perfis)) || ($ps == "")) @@ -626,11 +626,11 @@ Array $funcoes = array(); foreach($s->FUNCAO as $f) { - $n = ixml($f,"NOMEFUNCAO"); - $a = ixml($f,"ABRIR"); - $w = ixml($f,"JANELAW"); - $h = ixml($f,"JANELAH"); - $p = ixml($f,"PERFIL"); + $n = $this->ixml($f,"NOMEFUNCAO"); + $a = $this->ixml($f,"ABRIR"); + $w = $this->ixml($f,"JANELAW"); + $h = $this->ixml($f,"JANELAH"); + $p = $this->ixml($f,"PERFIL"); if (($this->array_in_array($this->perfil,$perfis)) || ($p == "")) {$funcoes[] = array("NOME"=>$n,"ABRIR"=>$a,"W"=>$w,"H"=>$h);} } @@ -684,7 +684,7 @@ $procurar - String que será procurada. foreach($xml->GRUPO as $grupo) { $incluigrupo = TRUE; - $temp = ixml($grupo,"PERFIL"); + $temp = $this->ixml($grupo,"PERFIL"); if ($temp != "") { $incluigrupo = FALSE; @@ -700,7 +700,7 @@ $procurar - String que será procurada. $incluisgrupo = TRUE; if ($this->perfil != "") { - $temp = ixml($sgrupo,"PERFIL"); + $temp = $this->ixml($sgrupo,"PERFIL"); $perfis = str_replace(","," ",$temp); $perfis = explode(" ",$perfis); if (!$this->array_in_array($this->perfil,$perfis)) @@ -713,7 +713,7 @@ $procurar - String que será procurada. $inclui = TRUE; if ($this->perfil != "") { - $temp = ixml($tema,"PERFIL"); + $temp = $this->ixml($tema,"PERFIL"); $perfis = str_replace(","," ",$temp); $perfis = explode(" ",$perfis); if (!$this->array_in_array($this->perfil,$perfis)) @@ -722,28 +722,28 @@ $procurar - String que será procurada. if ($inclui == TRUE) { $down = "nao"; - $temp = ixml($tema,"DOWNLOAD"); + $temp = $this->ixml($tema,"DOWNLOAD"); if (($temp == "sim") || ($temp == "SIM")) {$down = "sim";} - $link = ixml($tema,"TLINK"); - $tid = ixml($tema,"TID"); + $link = $this->ixml($tema,"TLINK"); + $tid = $this->ixml($tema,"TID"); if(!isset($texto[$tid])) { - $texto[$tid] = array("tid"=>$tid,"nome"=>(ixml($tema,"TNOME")),"link"=>$link,"download"=>$down); + $texto[$tid] = array("tid"=>$tid,"nome"=>($this->ixml($tema,"TNOME")),"link"=>$link,"download"=>$down); $p1 = $this->removeAcentos($procurar); $p1 = $this->removeAcentos(htmlentities($p1)); - $pp1 = $this->removeAcentos(ixml($tema,"TNOME")); + $pp1 = $this->removeAcentos($this->ixml($tema,"TNOME")); $pp1 = $this->removeAcentos($pp1); $pp1 = $this->removeAcentos(htmlentities($pp1)); - if (stristr($pp1,$p1) || stristr(ixml($tema,"TNOME"),htmlentities($procurar))) + if (stristr($pp1,$p1) || stristr($this->ixml($tema,"TNOME"),htmlentities($procurar))) { $listadetemas[] = $texto[$tid]; } else - if(ixml($tema,"TAGS") != "") + if($this->ixml($tema,"TAGS") != "") { - $pp1 = ixml($tema,"TAGS"); + $pp1 = $this->ixml($tema,"TAGS"); $pp1 = $this->removeAcentos($pp1); if (stristr($pp1,$p1)) {$listadetemas[] = $texto[$tid];} @@ -753,7 +753,7 @@ $procurar - String que será procurada. } if (count($listadetemas) > 0) { - $subgrupo[] = array("subgrupo"=>(ixml($sgrupo,"SDTIPO")),"temas"=>$listadetemas); + $subgrupo[] = array("subgrupo"=>($this->ixml($sgrupo,"SDTIPO")),"temas"=>$listadetemas); } $listadetemas = array(); } @@ -761,7 +761,7 @@ $procurar - String que será procurada. } if (count($subgrupo) > 0) { - $resultado[] = array("grupo"=>(ixml($grupo,"GTIPO")),"subgrupos"=>$subgrupo); + $resultado[] = array("grupo"=>($this->ixml($grupo,"GTIPO")),"subgrupos"=>$subgrupo); } $subgrupo = array(); } @@ -793,7 +793,7 @@ nrss - (opcional) número de registros no rss que serão considerados foreach ( simplexml_load_file($rss)->channel->item as $item ) { if($conta < $nrss) - $noticiasRSS[] = array("desc"=>(ixml($item,"description")),"titulo"=>(ixml($item,"title")),"link"=>(ixml($item,"link"))); + $noticiasRSS[] = array("desc"=>($this->ixml($item,"description")),"titulo"=>($this->ixml($item,"title")),"link"=>($this->ixml($item,"link"))); $conta++; } } @@ -818,7 +818,7 @@ nrss - (opcional) número de registros no rss que serão considerados foreach($xml->GRUPO as $grupo) { $incluigrupo = TRUE; - $temp = ixml($grupo,"PERFIL"); + $temp = $this->ixml($grupo,"PERFIL"); if ($temp != "") { $incluigrupo = FALSE; @@ -833,7 +833,7 @@ nrss - (opcional) número de registros no rss que serão considerados $incluisgrupo = TRUE; if ($this->perfil != "") { - $temp = ixml($sgrupo,"PERFIL"); + $temp = $this->ixml($sgrupo,"PERFIL"); $perfis = str_replace(","," ",$temp); $perfis = explode(" ",$perfis); if (!$this->array_in_array($this->perfil,$perfis)) @@ -853,8 +853,8 @@ nrss - (opcional) número de registros no rss que serão considerados } if ($inclui == TRUE) { - $tid = ixml($tema,"TID"); - $tags = explode(" ",ixml($tema,"TAGS")); + $tid = $this->ixml($tema,"TID"); + $tags = explode(" ",$this->ixml($tema,"TAGS")); foreach ($tags as $tag) { if($tag != "") @@ -956,5 +956,10 @@ nrss - (opcional) número de registros no rss que serão considerados } return $editor; } + function ixml($no,$nome) + { + return mb_convert_encoding($no->$nome,"HTML-ENTITIES","auto"); + } + } ?> \ No newline at end of file diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index 40cff9b..2e56587 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -1932,6 +1932,8 @@ Include: /* Property: identifica +Depreciado na versão 4.2 (utilize "identifica2") + Identifica elementos no mapa. Include: @@ -1945,6 +1947,22 @@ Include: $cp->set_data($m->identifica($opcao,$xy,$resolucao)); break; /* +Property: identifica2 + +Identifica elementos no mapa. + +Include: + +*/ + case "identifica2": + if (!isset($tema)){$tema = "";} + if (!isset($resolucao)){$resolucao = 5;} + include_once("classe_atributos.php"); + $m = new Atributos($map_file,$tema); + $cp->set_data($m->identifica2($opcao,$xy,$resolucao)); + break; + +/* Property: identificaunico Identifica elementos no mapa retornando apenas o valor de um único item. -- libgit2 0.21.2