Commit f31b471644c72223472b8e9641fe07ec138019d6

Authored by Edmar Moretti
1 parent 333c250f

Criação de uma nova função para a identificação de etiquetas, depreciando a função anterior

classesjs/classe_mapa.js
@@ -671,51 +671,62 @@ i3GEO.mapa = { @@ -671,51 +671,62 @@ i3GEO.mapa = {
671 var etiquetas = false; 671 var etiquetas = false;
672 for(var j=0;j<ntemas;j++) 672 for(var j=0;j<ntemas;j++)
673 {if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas != ""){var etiquetas = true;}} 673 {if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas != ""){var etiquetas = true;}}
674 - if(etiquetas == false){return;}  
675 - if($i("img")){$i("img").style.cursor = "wait";} 674 + if(etiquetas == false){return;}
  675 +
  676 + if(i3GEO.interface.ATUAL=="padrao"){$i("img").style.cursor = "wait";}
  677 +
676 var retorna = function(retorno){ 678 var retorna = function(retorno){
677 var i = $i("i3geo_rosa"); 679 var i = $i("i3geo_rosa");
678 if(i){i.style.display="none";} 680 if(i){i.style.display="none";}
679 var mostra = false; 681 var mostra = false;
680 try{ 682 try{
681 var retorno = retorno.data; 683 var retorno = retorno.data;
682 - if ($i("img"))  
683 - {$i("img").title = "";}  
684 - if (retorno != ""){ 684 + if (retorno != "")
  685 + {
685 var res = ""; 686 var res = "";
686 - var temas = retorno.split("!");  
687 - var tema = temas.length-1;  
688 - if(tema >= 0){  
689 - do{  
690 - var titulo = temas[tema].split("@");  
691 - if (i3GEO.configura.tipotip == "completo" || i3GEO.configura.tipotip == "balao")  
692 - {res += "<span style='text-align:left;font-size:9pt'><b>"+titulo[0]+"</b></span><br>";}  
693 - var ocorrencias = titulo[1].split("*");  
694 - var ocorrencia = ocorrencias.length-1;  
695 - if(ocorrencia >= 0){  
696 - do{  
697 - if (ocorrencias[ocorrencia] != ""){  
698 - var pares = ocorrencias[ocorrencia].split("##");  
699 - var paresi = pares.length;  
700 - for (var par=0;par<paresi; par++){  
701 - var valores = pares[par].split("#");  
702 - if (i3GEO.configura.tipotip == "completo" || i3GEO.configura.tipotip == "balao"){  
703 - res = res + "<span class='tiptexto' style='text-align:left;font-size:9pt'>" + valores[0] + " <i>" + valores[1] + "</i></span><br>";  
704 - var mostra = true;  
705 - }  
706 - else{  
707 - res = res + "<span class='tiptexto' style='text-align:left;font-size:9pt'><i>" + valores[1] + "</i></span><br>";  
708 - var mostra = true;  
709 - }  
710 - } 687 + var temas = retorno;
  688 + var ntemas = temas.length;
  689 + for(var j=0;j<ntemas;j++){
  690 + var titulo = temas[j].nome;
  691 + if (i3GEO.configura.tipotip == "completo" || i3GEO.configura.tipotip == "balao")
  692 + {var titulo = "<span style='text-decoration:underline;text-align:left;font-size:9pt'><b>"+titulo+"</b></span><br>";}
  693 + else
  694 + {var titulo = "";}
  695 + var tips = (temas[j].resultado.tips).split(",");
  696 + var ntips = tips.length;
  697 + var ins = "";
  698 + for(var r=0;r<ntips;r++){
  699 + var ds = temas[j].resultado.dados;
  700 + if(ds != " "){
  701 + var nds = ds.length;
  702 + for(var s=0;s<nds;s++){
  703 + eval("var alias = ds[s]."+tips[r]+".alias");
  704 + eval("var valor = ds[s]."+tips[r]+".valor");
  705 + eval("var link = ds[s]."+tips[r]+".link");
  706 + eval("var img = ds[s]."+tips[r]+".img");
  707 + if (i3GEO.configura.tipotip == "completo" || i3GEO.configura.tipotip == "balao"){
  708 + if(valor != "")
  709 + ins += "<span class='tiptexto' style='text-align:left;font-size:8pt'>" + alias + " :" + valor + "</span><br>";
  710 + if(img != "")
  711 + ins += img+"<br>";
  712 +
  713 + var mostra = true;
  714 + }
  715 + else{
  716 + ins += "<span class='tiptexto' style='text-align:left;font-size:8pt'>" + valor + "</span><br>";
  717 + var mostra = true;
711 } 718 }
712 } 719 }
713 - while(ocorrencia--)  
714 } 720 }
715 } 721 }
716 - while(tema--) 722 + if(ins != "")
  723 + var res = res + titulo + ins;
  724 + }
  725 + if(!mostra){
  726 + if($i("tip"))
  727 + $i("tip").style.display="none";
  728 + return;
717 } 729 }
718 - if(!mostra){$i("tip").style.display="none";return;}  
719 else{ 730 else{
720 if(i3GEO.configura.tipotip != "balao"){ 731 if(i3GEO.configura.tipotip != "balao"){
721 var n = i3GEO.janela.tip(); 732 var n = i3GEO.janela.tip();
@@ -733,7 +744,7 @@ i3GEO.mapa = { @@ -733,7 +744,7 @@ i3GEO.mapa = {
733 } 744 }
734 } 745 }
735 } 746 }
736 - if($i("img")){ 747 + if(i3GEO.interface.ATUAL=="padrao"){
737 var temp = "zoom"; 748 var temp = "zoom";
738 if(i3GEO.interface.ATIVAMENUCONTEXTO) 749 if(i3GEO.interface.ATIVAMENUCONTEXTO)
739 var temp = "identifica_contexto"; 750 var temp = "identifica_contexto";
@@ -741,7 +752,7 @@ i3GEO.mapa = { @@ -741,7 +752,7 @@ i3GEO.mapa = {
741 } 752 }
742 } 753 }
743 catch(e){ 754 catch(e){
744 - if($i("img")){ 755 + if(i3GEO.interface.ATUAL=="padrao"){
745 var temp = "identifica"; 756 var temp = "identifica";
746 if(i3GEO.interface.ATIVAMENUCONTEXTO) 757 if(i3GEO.interface.ATIVAMENUCONTEXTO)
747 var temp = "identifica_contexto"; 758 var temp = "identifica_contexto";
@@ -749,7 +760,7 @@ i3GEO.mapa = { @@ -749,7 +760,7 @@ i3GEO.mapa = {
749 } 760 }
750 } 761 }
751 }; 762 };
752 - i3GEO.php.identifica(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5"); 763 + i3GEO.php.identifica2(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5");
753 } 764 }
754 } 765 }
755 }; 766 };
classesjs/classe_php.js
@@ -788,7 +788,9 @@ i3GEO.php = { @@ -788,7 +788,9 @@ i3GEO.php = {
788 }, 788 },
789 /* 789 /*
790 Function: identifica 790 Function: identifica
791 - 791 +
  792 + Depreciado na versão 4.2 (utilize "identifica2")
  793 +
792 PHP: 794 PHP:
793 classesphp/classe_atributos.php 795 classesphp/classe_atributos.php
794 796
@@ -796,10 +798,24 @@ i3GEO.php = { @@ -796,10 +798,24 @@ i3GEO.php = {
796 */ 798 */
797 identifica: function(funcao,x,y,resolucao){ 799 identifica: function(funcao,x,y,resolucao){
798 i3GEO.php.verifica(); 800 i3GEO.php.verifica();
799 - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid; 801 + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica2&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid;
800 cpJSON.call(p,"identifica",funcao); 802 cpJSON.call(p,"identifica",funcao);
801 }, 803 },
802 /* 804 /*
  805 + Function: identifica2
  806 +
  807 + PHP:
  808 + classesphp/classe_atributos.php
  809 +
  810 + <Atributos->identifica2>
  811 + */
  812 + identifica2: function(funcao,x,y,resolucao){
  813 + i3GEO.php.verifica();
  814 + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=identifica2&opcao=tip&xy="+x+","+y+"&resolucao=5&g_sid="+i3GEO.configura.sid;
  815 + cpJSON.call(p,"identifica",funcao);
  816 + },
  817 +
  818 + /*
803 Function: reiniciaMapa 819 Function: reiniciaMapa
804 820
805 PHP: 821 PHP:
classesphp/classe_atributos.php
@@ -536,6 +536,8 @@ Include: @@ -536,6 +536,8 @@ Include:
536 /* 536 /*
537 function: identifica 537 function: identifica
538 538
  539 +Depreciado na versão 4.2 (utilize "identifica2")
  540 +
539 Identifica elementos no mapa. 541 Identifica elementos no mapa.
540 542
541 parameters: 543 parameters:
@@ -661,8 +663,166 @@ $resolucao - Resolucao de busca. @@ -661,8 +663,166 @@ $resolucao - Resolucao de busca.
661 {return("");} 663 {return("");}
662 } 664 }
663 /* 665 /*
  666 +function: identifica2
  667 +
  668 +Identifica elementos no mapa.
  669 +
  670 +parameters:
  671 +
  672 +$opcao - Opcao tip|tema|ligados|todos.
  673 +
  674 +$xy - coordenada x e y separadas por virgulao.
  675 +
  676 +$resolucao - Resolucao de busca.
  677 +*/
  678 + function identifica2($opcao,$xy,$resolucao)
  679 + {
  680 + $temas = $this->mapa->getalllayernames();
  681 + foreach ($temas as $tem)
  682 + {
  683 + $vermultilayer = new vermultilayer();
  684 + $vermultilayer->verifica($this->arquivo,$tem);
  685 + if ($vermultilayer->resultado == 1) // o tema e multi layer
  686 + {
  687 + foreach (($vermultilayer->temasvisiveis) as $tv)
  688 + {
  689 + $l = $this->mapa->getlayerbyname($tv);
  690 + if ($l->getmetadata("identifica") != "nao")
  691 + {$listatemas[] = $tv;}
  692 + }
  693 + }
  694 + else
  695 + {
  696 + $l = $this->mapa->getlayerbyname($tem);
  697 + if (($l->getmetadata("escondido") == "") && ($l->getmetadata("identifica") != "nao"))
  698 + {$listatemas[] = $tem;}
  699 + }
  700 + }
  701 + $listatemas = array_unique($listatemas);
  702 + $xyarray = explode(",",$xy);
  703 + $resultados = array();
  704 + //pesquisa um tema
  705 + if ($opcao == "tema")
  706 + {
  707 + $listatemas = array();
  708 + $vermultilayer = new vermultilayer();
  709 + $vermultilayer->verifica($this->arquivo,$this->nome);
  710 + if ($vermultilayer->resultado == 1) // o tema e multi layer
  711 + {$listatemp = $vermultilayer->temasvisiveis;}
  712 + else
  713 + {$listatemp[] = $this->nome;}
  714 + foreach ($listatemp as $t)
  715 + {
  716 + $layerteste = $this->mapa->getlayerbyname($t);
  717 + $mclasse = strtoupper($layerteste->getmetadata("CLASSE"));
  718 + $mtema = strtoupper($layerteste->getmetadata("TEMA"));
  719 + $gr = $layerteste->group;
  720 + if ((!(($mclasse == "NAO") && ($mtema == "NAO"))) || ($gr != ""))
  721 + {
  722 + if (($layerteste->data != "") && ($layerteste->connectiontype != MS_WMS))
  723 + {$listatemas[] = $t;}
  724 + }
  725 + }
  726 + $layerteste = $this->layer;
  727 + if ($layerteste->connectiontype == MS_WMS)
  728 + {
  729 + $listatemas = array();
  730 + $listatemas[] = $this->nome;
  731 + }
  732 + foreach ($listatemas as $tema)
  733 + {
  734 + $resultados[$tema] = $this->identificaQBP($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao);
  735 + }
  736 + }
  737 + //pesquisa todos os temas acrescentados no mapa
  738 + if ($opcao == "todos")
  739 + {
  740 + foreach ($listatemas as $tema)
  741 + {
  742 + $resultados[$tema] = $this->identificaQBP($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao);
  743 + }
  744 + }
  745 + //pesquisa apenas os temas visiveis
  746 + if ($opcao == "ligados")
  747 + {
  748 + $novalista = array();
  749 + foreach ($listatemas as $tema)
  750 + {
  751 + $l = $this->mapa->getlayerbyname($tema);
  752 + if($l->status == MS_DEFAULT)
  753 + $novalista[] = $tema;
  754 + $listatemas = $novalista;
  755 + }
  756 + foreach ($listatemas as $tema)
  757 + {
  758 + $l = $this->mapa->getlayerbyname($tema);
  759 + $resultados[$tema] = $this->identificaQBP($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao);
  760 + }
  761 + //var_dump($resultados);
  762 + }
  763 + //pesquisa apenas os temas com tip
  764 + if ($opcao == "tip")
  765 + {
  766 + $ltemp = array();
  767 + foreach ($listatemas as $tema)
  768 + {
  769 + $tl = $this->mapa->getlayerbyname($tema);
  770 + $itemtip = $tl->getmetadata("TIP");
  771 + if ($itemtip != "")
  772 + {
  773 + if ($tl->status == MS_DEFAULT)
  774 + {
  775 + $resultados[$tema] = array("tips"=>$itemtip,"dados"=>$this->identificaQBP2($tema,$xyarray[0],$xyarray[1],$this->arquivo,$resolucao,$itemtip));
  776 + $ltemp[] = $tema;
  777 + }
  778 + }
  779 + }
  780 + $listatemas = $ltemp;
  781 + }
  782 + if (count($resultados) > 0)
  783 + {
  784 + $res = $this->retornaI2($listatemas,$resultados,$this->mapa);
  785 + return($res);
  786 + }
  787 + else
  788 + {return("");}
  789 + }
  790 +/*
  791 +function: retornaI2
  792 +
  793 +Depreciado na versão 4.2
  794 +
  795 +Processa o resultado da identificação de um elemento compondo um array de strings formatadas.
  796 +
  797 +parameters:
  798 +$listatemas - Lista de temas
  799 +
  800 +$resultados - Resultados de cada tema.
  801 +
  802 +$map - Objeto Map.
  803 +*/
  804 +function retornaI2($listatemas,$resultados,$map)
  805 +{
  806 + $final = array();
  807 + foreach ($listatemas as $tema)
  808 + {
  809 + $layer = $map->getlayerbyname($tema);
  810 + $nometmp = $tema;
  811 + if (strtoupper($layer->getMetaData("TEMA")) != "NAO")
  812 + {$nometmp = $layer->getMetaData("TEMA");}
  813 + else if ($layer->getMetaData("ALTTEMA") != "")
  814 + {$nometmp = $layer->getMetaData("ALTTEMA");}
  815 + $nometmp = mb_convert_encoding($nometmp,"UTF-8","ISO-8859-1");
  816 + $final[] = array("nome"=>$nometmp,"resultado"=>$resultados[$tema]);
  817 + }
  818 + return $final;
  819 +}
  820 +
  821 +/*
664 function: retornaI 822 function: retornaI
665 823
  824 +Depreciado na versão 4.2
  825 +
666 Processa o resultado da identificação de um elemento compondo um array de strings formatadas. 826 Processa o resultado da identificação de um elemento compondo um array de strings formatadas.
667 827
668 parameters: 828 parameters:
@@ -703,6 +863,8 @@ function retornaI($listatemas,$resultados,$map) @@ -703,6 +863,8 @@ function retornaI($listatemas,$resultados,$map)
703 /* 863 /*
704 function: identificaQBP 864 function: identificaQBP
705 865
  866 +Depreciado na versão 4.2
  867 +
706 Identifica um elemento utilizando querybypoint. 868 Identifica um elemento utilizando querybypoint.
707 869
708 parameters: 870 parameters:
@@ -906,5 +1068,191 @@ function identificaQBP($tema,$x,$y,$map_file,$resolucao,$item=&quot;&quot;,$tiporetorno=&quot;&quot; @@ -906,5 +1068,191 @@ function identificaQBP($tema,$x,$y,$map_file,$resolucao,$item=&quot;&quot;,$tiporetorno=&quot;&quot;
906 {$resultado[] = " ";} 1068 {$resultado[] = " ";}
907 return $resultado; 1069 return $resultado;
908 } 1070 }
  1071 +/*
  1072 +function: identificaQBP2
  1073 +
  1074 +Identifica um elemento utilizando querybypoint.
  1075 +
  1076 +parameters:
  1077 +
  1078 +$tema - Tema que será identificado
  1079 +
  1080 +$x - Coordenada X.
  1081 +
  1082 +$y - Coordenada Y.
  1083 +
  1084 +$map_file - Arquivo map file.
  1085 +
  1086 +$resolucao - Resolução de busca.
  1087 +
  1088 +$item - Item único que será identificado.
  1089 +
  1090 +$tiporetorno - Tipo de retorno dos dados. Se for vazio, o retorno é formatado como string, se for shape, retorna o objeto shape
  1091 +*/
  1092 +function identificaQBP2($tema,$x,$y,$map_file,$resolucao,$item="",$tiporetorno="")
  1093 +{
  1094 + $mapa = ms_newMapObj($map_file);
  1095 + $layer = $mapa->getLayerByName($tema);
  1096 + $layer->set("status",MS_DEFAULT);
  1097 + $layer->set("template","none.htm");
  1098 + $pt = ms_newPointObj();
  1099 + $pt->setXY($x, $y);
  1100 + //
  1101 + //operação especial para o caso de wms
  1102 + //
  1103 + if($layer->connectiontype == MS_WMS)
  1104 + {
  1105 + $layer->set("toleranceunits",MS_PIXELS);
  1106 + $layer->set("tolerance",$resolucao);
  1107 + $ptimg = xy2imagem($map_file,array($x,$y));
  1108 + $mapa = desligatemas($mapa);
  1109 + $mapa = desligamargem($mapa);
  1110 + $imgo = $mapa->draw();
  1111 + //$res = $layer->getWMSFeatureInfoURL($ptimg->x, $ptimg->y, 1,"MIME");
  1112 + $resultado = array();
  1113 + $res = $layer->connection;
  1114 + $res .= "&request=getfeatureinfo&service=wms";
  1115 + $res .= "&version=1.1.0";//.($layer->getmetadata("wms_version"));
  1116 + $res .= "&QUERY_LAYERS=".($layer->getmetadata("wms_name"));
  1117 + $res .= "&LAYERS=".($layer->getmetadata("wms_name"));
  1118 + $bb = $mapa->extent;
  1119 + $res .= "&BBOX=".($bb->minx).",".($bb->miny).",".($bb->maxx).",".($bb->maxy);
  1120 + $res .= "&X=".round($ptimg->x);
  1121 + $res .= "&Y=".round($ptimg->y);
  1122 + $res .= "&WIDTH=".$mapa->width;
  1123 + $res .= "&HEIGHT=".$mapa->height;
  1124 + $formatoinfo = "text/plain";
  1125 + $formatosinfo = $layer->getmetadata("formatosinfo");
  1126 + if ($formatosinfo != "")
  1127 + {
  1128 + $formatosinfo = explode(",",$formatosinfo);
  1129 + if ($formatosinfo[0] != ""){$formatoinfo = $formatosinfo[0];}
  1130 + foreach ($formatosinfo as $f)
  1131 + {
  1132 + if(strtoupper($f) == "TEXT/PLAIN")
  1133 + {$formatoinfo = "text/plain";}
  1134 + }
  1135 +
  1136 + }
  1137 + $srs = $layer->getmetadata("wms_srs");
  1138 + $srss = explode(" ",$srs);
  1139 + $srs = "EPSG:4326";
  1140 + foreach ($srss as $s)
  1141 + {
  1142 + if(strtoupper($s) == "EPSG:4291")
  1143 + {$srs = "EPSG:4291";}
  1144 + }
  1145 + $res .= "&SRS=".$srs;
  1146 + $resposta = file($res."&FORMAT=".$formatoinfo);
  1147 + $resposta = str_ireplace('<?xml version="1.0" encoding="UTF-8"?>',"",$resposta);
  1148 + $resposta = str_ireplace('<?xml version="1.0" encoding="ISO-8859-1"?>',"",$resposta);
  1149 + $resposta = str_ireplace("<?xml version='1.0' encoding='ISO-8859-1'?>","",$resposta);
  1150 + $resposta = str_ireplace('<?xml',"",$resposta);
  1151 + $resposta = str_ireplace("<","zzzzzzzzzz",$resposta);
  1152 + $resposta = str_ireplace(">","zzzzzzzzzz",$resposta);
  1153 + if (stristr(implode(" ",$resposta),"msWMSLoadGetMapParams"))
  1154 + {
  1155 + $resposta = file($res);
  1156 + $resposta = str_ireplace('<?xml version="1.0" encoding="UTF-8"?>',"",$resposta);
  1157 + $resposta = str_ireplace('<?xml version="1.0" encoding="ISO-8859-1"?>',"",$resposta);
  1158 + $resposta = str_ireplace("<?xml version='1.0' encoding='ISO-8859-1'?>","",$resposta);
  1159 + $resposta = str_ireplace('<?xml',"",$resposta);
  1160 + $resposta = str_ireplace("<","zzzzzzzzzz",$resposta);
  1161 + $resposta = str_ireplace(">","zzzzzzzzzz",$resposta);
  1162 + }
  1163 + $resultado[] = $resposta;
  1164 + return $resultado;
  1165 + }
  1166 + if(($layer->connectiontype != MS_WMS) && ($layer->type == MS_LAYER_RASTER))
  1167 + {
  1168 + $layer->set("toleranceunits",MS_PIXELS);
  1169 + $layer->set("tolerance",$resolucao);
  1170 + $ident = @$layer->queryByPoint($pt, 0, 0); //0.01);
  1171 + }
  1172 + if (($layer->type == MS_LAYER_POINT) || ($layer->type == MS_LAYER_LINE))
  1173 + {
  1174 + $layer->set("toleranceunits",MS_PIXELS);
  1175 + $layer->set("tolerance",$resolucao);
  1176 + $ident = @$layer->queryByPoint($pt, 1, 0); //0.01);
  1177 + }
  1178 + if ($layer->type == MS_LAYER_POLYGON)
  1179 + {
  1180 + $layer->set("toleranceunits",'MS_PIXEL');
  1181 + $layer->set("tolerance",1);
  1182 + $ident = @$layer->queryByPoint($pt, 1, 0);
  1183 + }
  1184 + if ($ident == MS_SUCCESS)
  1185 + {
  1186 + $itens = $layer->getmetadata("ITENS"); // itens
  1187 + $itensdesc = $layer->getmetadata("ITENSDESC"); // descri&ccedil;&atilde;o dos itens
  1188 + $lks = $layer->getmetadata("ITENSLINK"); // link dos itens
  1189 + $itemimg = $layer->getmetadata("ITEMIMG"); //indica um item que será utilizado para colocar um ícone
  1190 + $locimg = $layer->getmetadata("IMGLOC"); //indica o local onde estão os ícones
  1191 + $tips = $layer->getmetadata("TIP");
  1192 + $itensLayer = pegaItens($layer);
  1193 +
  1194 + $nitens = count($itensLayer);
  1195 +
  1196 + if($itens == "")
  1197 + {$itens = $itensLayer;}
  1198 + else
  1199 + {$itens = explode(",",$itens);}
  1200 +
  1201 + if($itensdesc == "")
  1202 + {$itensdesc = array_fill(0, $nitens-1,'');}
  1203 + else
  1204 + {$itensdesc = explode(",",$itensdesc);}
  1205 + if($lks == "")
  1206 + {$lks = array_fill(0, $nitens-1,'');}
  1207 + else
  1208 + {$lks = explode(",",$lks);}
  1209 + if($itemimg == "")
  1210 + {$itemimg = array_fill(0, $nitens-1,'');}
  1211 + else
  1212 + {$itemimg = explode(",",$itemimg);}
  1213 + if($locimg == "")
  1214 + {$locimg = array_fill(0, $nitens-1,'');}
  1215 + else
  1216 + {$locimg = explode(",",$locimg);}
  1217 +
  1218 + $res_count = $layer->getNumresults();
  1219 + $sopen = $layer->open();
  1220 + if($sopen == MS_FAILURE){return "erro";}
  1221 + for ($i = 0; $i < $res_count; ++$i)
  1222 + {
  1223 + $valori = array();
  1224 + $result = $layer->getResult($i);
  1225 + $shp_index = $result->shapeindex;
  1226 + $shape = $layer->getshape(-1, $shp_index);
  1227 + $conta = 0;
  1228 + foreach ($itens as $it)
  1229 + {
  1230 + $val = $shape->values[$it];
  1231 + $busca = '['.$it.']';
  1232 + $link = str_replace($busca,$val,$lks[$conta]);
  1233 +
  1234 + $img = "";
  1235 + if($locimg[$conta] != "" && $itemimg[$conta] != "")
  1236 + {$img = "<img src='".$locimg[$conta]."//".$shape->values[$itemimg[$conta]]."' //>";}
  1237 + else
  1238 + if($itemimg[$conta] != "")
  1239 + {$img = "<img src='".$shape->values[$itemimg[$conta]]."' //>";}
  1240 +
  1241 + $valori[$it] = array(
  1242 + "alias"=>mb_convert_encoding($itensdesc[$conta],"UTF-8","ISO-8859-1"),
  1243 + "valor"=>mb_convert_encoding($val,"UTF-8","ISO-8859-1"),
  1244 + "link"=>$link,
  1245 + "img"=>$img
  1246 + );
  1247 + $conta = $conta + 1;
  1248 + }
  1249 + $resultado[] = $valori;
  1250 + }
  1251 + $layer->close();
  1252 + }
  1253 + else
  1254 + {$resultado[] = " ";}
  1255 + return $resultado;
  1256 +}
909 } 1257 }
910 ?> 1258 ?>
911 \ No newline at end of file 1259 \ No newline at end of file
classesphp/classe_menutemas.php
@@ -202,25 +202,25 @@ array @@ -202,25 +202,25 @@ array
202 { 202 {
203 $down = "nao"; 203 $down = "nao";
204 $ogc = "sim"; 204 $ogc = "sim";
205 - $temp = ixml($temar,"DOWNLOAD"); 205 + $temp = $this->ixml($temar,"DOWNLOAD");
206 if (($temp == "sim") || ($temp == "SIM")) 206 if (($temp == "sim") || ($temp == "SIM"))
207 {$down = "sim";} 207 {$down = "sim";}
208 - $temp = ixml($temar,"OGC"); 208 + $temp = $this->ixml($temar,"OGC");
209 if (($temp == "nao") || ($temp == "NAO")) 209 if (($temp == "nao") || ($temp == "NAO"))
210 {$ogc = "nao";} 210 {$ogc = "nao";}
211 $link = " "; 211 $link = " ";
212 - $temp = ixml($temar,"TLINK"); 212 + $temp = $this->ixml($temar,"TLINK");
213 if ($temp != "") 213 if ($temp != "")
214 {$link = $temp;} 214 {$link = $temp;}
215 - $tid = ixml($temar,"TID");  
216 - $nome = ixml($temar,"TNOME"); 215 + $tid = $this->ixml($temar,"TID");
  216 + $nome = $this->ixml($temar,"TNOME");
217 $temasraiz[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); 217 $temasraiz[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc);
218 } 218 }
219 foreach($xml->GRUPO as $grupo) 219 foreach($xml->GRUPO as $grupo)
220 { 220 {
221 $incluigrupo = TRUE; 221 $incluigrupo = TRUE;
222 //filtra pelo perfil 222 //filtra pelo perfil
223 - $temp = ixml($grupo,"PERFIL"); 223 + $temp = $this->ixml($grupo,"PERFIL");
224 if ($temp != "") 224 if ($temp != "")
225 { 225 {
226 $incluigrupo = FALSE; 226 $incluigrupo = FALSE;
@@ -237,32 +237,32 @@ array @@ -237,32 +237,32 @@ array
237 { 237 {
238 $down = "nao"; 238 $down = "nao";
239 $ogc = "sim"; 239 $ogc = "sim";
240 - $temp = ixml($temar,"DOWNLOAD"); 240 + $temp = $this->ixml($temar,"DOWNLOAD");
241 if (($temp == "sim") || ($temp == "SIM")) 241 if (($temp == "sim") || ($temp == "SIM"))
242 {$down = "sim";} 242 {$down = "sim";}
243 - $temp = ixml($temar,"OGC"); 243 + $temp = $this->ixml($temar,"OGC");
244 if (($temp == "nao") || ($temp == "NAO")) 244 if (($temp == "nao") || ($temp == "NAO"))
245 {$ogc = "nao";} 245 {$ogc = "nao";}
246 $link = " "; 246 $link = " ";
247 - $temp = ixml($temar,"TLINK"); 247 + $temp = $this->ixml($temar,"TLINK");
248 if ($temp != "") 248 if ($temp != "")
249 {$link = $temp;} 249 {$link = $temp;}
250 - $tid = ixml($temar,"TID");  
251 - $nome = ixml($temar,"TNOME"); 250 + $tid = $this->ixml($temar,"TID");
  251 + $nome = $this->ixml($temar,"TNOME");
252 $temas[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); 252 $temas[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc);
253 } 253 }
254 $grupodown = "nao"; 254 $grupodown = "nao";
255 - $grupoogc = "nao"; 255 + $grupoogc = "sim";
256 foreach($grupo->SGRUPO as $sgrupo) 256 foreach($grupo->SGRUPO as $sgrupo)
257 { 257 {
258 foreach($sgrupo->TEMA as $tema) 258 foreach($sgrupo->TEMA as $tema)
259 { 259 {
260 - $temp = ixml($tema,"DOWNLOAD"); 260 + $temp = $this->ixml($tema,"DOWNLOAD");
261 if (($temp == "sim") || ($temp == "SIM")) 261 if (($temp == "sim") || ($temp == "SIM"))
262 {$grupodown = "sim";} 262 {$grupodown = "sim";}
263 - $temp = ixml($tema,"OGC");  
264 - if (($temp == "") || ($temp == "sim") || ($temp == "SIM"))  
265 - {$grupoogc = "sim";} 263 + $temp = $this->ixml($tema,"OGC");
  264 + if (($temp == "nao") || ($temp == "NAO"))
  265 + {$grupoogc = "nao";}
266 } 266 }
267 } 267 }
268 $subgrupos = array(); 268 $subgrupos = array();
@@ -271,7 +271,7 @@ array @@ -271,7 +271,7 @@ array
271 foreach($grupo->SGRUPO as $sgrupo) 271 foreach($grupo->SGRUPO as $sgrupo)
272 { 272 {
273 $incluisgrupo = TRUE; 273 $incluisgrupo = TRUE;
274 - $temp = ixml($sgrupo,"PERFIL"); 274 + $temp = $this->ixml($sgrupo,"PERFIL");
275 if ($temp != "") 275 if ($temp != "")
276 { 276 {
277 $incluisgrupo = FALSE; 277 $incluisgrupo = FALSE;
@@ -284,22 +284,22 @@ array @@ -284,22 +284,22 @@ array
284 { 284 {
285 //verifica se existem temas que podem receber download 285 //verifica se existem temas que podem receber download
286 $down = "nao"; 286 $down = "nao";
287 - $ogc = "nao"; 287 + $ogc = "sim";
288 foreach($sgrupo->TEMA as $tema) 288 foreach($sgrupo->TEMA as $tema)
289 { 289 {
290 - $temp = ixml($tema,"DOWNLOAD"); 290 + $temp = $this->ixml($tema,"DOWNLOAD");
291 if (($temp == "sim") || ($temp == "SIM")) 291 if (($temp == "sim") || ($temp == "SIM"))
292 {$down = "sim";} 292 {$down = "sim";}
293 - $temp = ixml($tema,"OGC");  
294 - if (($temp == "") || ($temp != "sim") || ($temp != "SIM"))  
295 - {$ogc = "sim";} 293 + $temp = $this->ixml($tema,"OGC");
  294 + if (($temp == "nao") || ($temp == "NAO"))
  295 + {$ogc = "nao";}
296 } 296 }
297 - $nome = ixml($sgrupo,"SDTIPO"); 297 + $nome = $this->ixml($sgrupo,"SDTIPO");
298 $subgrupos[] = array("nome"=>$nome,"download"=>$down,"ogc"=>$ogc); 298 $subgrupos[] = array("nome"=>$nome,"download"=>$down,"ogc"=>$ogc);
299 } 299 }
300 } 300 }
301 } 301 }
302 - $nome = ixml($grupo,"GTIPO"); 302 + $nome = $this->ixml($grupo,"GTIPO");
303 $grupos[] = array("nome"=>$nome,"ogc"=>$grupoogc,"download"=>$grupodown,"subgrupos"=>$subgrupos,"temasgrupo"=>$temas); 303 $grupos[] = array("nome"=>$nome,"ogc"=>$grupoogc,"download"=>$grupodown,"subgrupos"=>$subgrupos,"temasgrupo"=>$temas);
304 } 304 }
305 } 305 }
@@ -363,7 +363,7 @@ array @@ -363,7 +363,7 @@ array
363 $subgrupos[] = array(); 363 $subgrupos[] = array();
364 foreach($this->xml->GRUPO as $grupo) 364 foreach($this->xml->GRUPO as $grupo)
365 { 365 {
366 - $temp = ixml($grupo,"PERFIL"); 366 + $temp = $this->ixml($grupo,"PERFIL");
367 if ($conta == $codgrupo) 367 if ($conta == $codgrupo)
368 { 368 {
369 $incluigrupo = TRUE; 369 $incluigrupo = TRUE;
@@ -382,7 +382,7 @@ array @@ -382,7 +382,7 @@ array
382 foreach($grupo->SGRUPO as $sgrupo) 382 foreach($grupo->SGRUPO as $sgrupo)
383 { 383 {
384 $incluisgrupo = TRUE; 384 $incluisgrupo = TRUE;
385 - $temp = ixml($sgrupo,"PERFIL"); 385 + $temp = $this->ixml($sgrupo,"PERFIL");
386 if ($temp != "") 386 if ($temp != "")
387 { 387 {
388 $incluisgrupo = FALSE; 388 $incluisgrupo = FALSE;
@@ -394,17 +394,17 @@ array @@ -394,17 +394,17 @@ array
394 if (($incluisgrupo == TRUE)) 394 if (($incluisgrupo == TRUE))
395 { 395 {
396 $down = "nao"; 396 $down = "nao";
397 - $ogc = "nao"; 397 + $ogc = "sim";
398 foreach($sgrupo->TEMA as $tema) 398 foreach($sgrupo->TEMA as $tema)
399 { 399 {
400 - $temp = ixml($tema,"DOWNLOAD"); 400 + $temp = $this->ixml($tema,"DOWNLOAD");
401 if (($temp == "sim") || ($temp == "SIM")) 401 if (($temp == "sim") || ($temp == "SIM"))
402 {$down = "sim";} 402 {$down = "sim";}
403 - $temp = ixml($tema,"OGC");  
404 - if (($temp == "") || ($temp == "sim") || ($temp == "SIM"))  
405 - {$ogc = "sim";} 403 + $temp = $this->ixml($tema,"OGC");
  404 + if (($temp == "nao") || ($temp == "NAO"))
  405 + {$ogc = "nao";}
406 } 406 }
407 - $nome = ixml($sgrupo,"SDTIPO"); 407 + $nome = $this->ixml($sgrupo,"SDTIPO");
408 $subgrupos[] = array("nome"=>$nome,"ogc"=>$ogc,"download"=>$down); 408 $subgrupos[] = array("nome"=>$nome,"ogc"=>$ogc,"download"=>$down);
409 } 409 }
410 } 410 }
@@ -413,19 +413,19 @@ array @@ -413,19 +413,19 @@ array
413 foreach($grupo->TEMA as $temar) 413 foreach($grupo->TEMA as $temar)
414 { 414 {
415 $down = "nao"; 415 $down = "nao";
416 - $ogc = "nao";  
417 - $temp = ixml($temar,"DOWNLOAD"); 416 + $ogc = "sim";
  417 + $temp = $this->ixml($temar,"DOWNLOAD");
418 if (($temp == "sim") || ($temp == "SIM")) 418 if (($temp == "sim") || ($temp == "SIM"))
419 {$down = "sim";} 419 {$down = "sim";}
420 - $temp = ixml($temar,"OGC");  
421 - if (($temp == "") || ($temp == "sim") || ($temp == "SIM"))  
422 - {$ogc = "sim";} 420 + $temp = $this->ixml($temar,"OGC");
  421 + if (($temp == "nao") || ($temp == "NAO"))
  422 + {$ogc = "nao";}
423 $link = " "; 423 $link = " ";
424 - $temp = ixml($temar,"TLINK"); 424 + $temp = $this->ixml($temar,"TLINK");
425 if ($temp != "") 425 if ($temp != "")
426 {$link = $temp;} 426 {$link = $temp;}
427 - $tid = ixml($temar,"TID");  
428 - $nome = ixml($temar,"TNOME"); 427 + $tid = $this->ixml($temar,"TID");
  428 + $nome = $this->ixml($temar,"TNOME");
429 $temas[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); 429 $temas[] = array("tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc);
430 } 430 }
431 } 431 }
@@ -476,10 +476,10 @@ array @@ -476,10 +476,10 @@ array
476 foreach($this->xml->GRUPO as $g) 476 foreach($this->xml->GRUPO as $g)
477 { 477 {
478 $incluigrupo = TRUE; 478 $incluigrupo = TRUE;
479 - if (ixml($g,"PERFIL") != "") 479 + if ($this->ixml($g,"PERFIL") != "")
480 { 480 {
481 $incluigrupo = FALSE; 481 $incluigrupo = FALSE;
482 - $temp = ixml($g,"PERFIL"); 482 + $temp = $this->ixml($g,"PERFIL");
483 $perfis = str_replace(","," ",$temp); 483 $perfis = str_replace(","," ",$temp);
484 $perfis = explode(" ",$perfis); 484 $perfis = explode(" ",$perfis);
485 if ($this->array_in_array($this->perfil,$perfis)) 485 if ($this->array_in_array($this->perfil,$perfis))
@@ -493,10 +493,10 @@ array @@ -493,10 +493,10 @@ array
493 foreach ($g->SGRUPO as $s) 493 foreach ($g->SGRUPO as $s)
494 { 494 {
495 $incluisgrupo = TRUE; 495 $incluisgrupo = TRUE;
496 - if (ixml($s,"PERFIL") != "") 496 + if ($this->ixml($s,"PERFIL") != "")
497 { 497 {
498 $incluisgrupo = FALSE; 498 $incluisgrupo = FALSE;
499 - $temp = ixml($s,"PERFIL"); 499 + $temp = $this->ixml($s,"PERFIL");
500 $perfis = str_replace(","," ",$temp); 500 $perfis = str_replace(","," ",$temp);
501 $perfis = explode(" ",$perfis); 501 $perfis = explode(" ",$perfis);
502 if ($this->array_in_array($this->perfil,$perfis)) 502 if ($this->array_in_array($this->perfil,$perfis))
@@ -509,11 +509,11 @@ array @@ -509,11 +509,11 @@ array
509 foreach($s->TEMA as $tema) 509 foreach($s->TEMA as $tema)
510 { 510 {
511 $inclui = TRUE; 511 $inclui = TRUE;
512 - if (ixml($tema,"PERFIL") != "") 512 + if ($this->ixml($tema,"PERFIL") != "")
513 { 513 {
514 514
515 $inclui = FALSE; 515 $inclui = FALSE;
516 - $temp = ixml($tema,"PERFIL"); 516 + $temp = $this->ixml($tema,"PERFIL");
517 $perfis = str_replace(","," ",$temp); 517 $perfis = str_replace(","," ",$temp);
518 $perfis = explode(" ",$perfis); 518 $perfis = explode(" ",$perfis);
519 if ($this->array_in_array($this->perfil,$perfis)) 519 if ($this->array_in_array($this->perfil,$perfis))
@@ -529,10 +529,10 @@ array @@ -529,10 +529,10 @@ array
529 {$ogc = "nao";} 529 {$ogc = "nao";}
530 $link = " "; 530 $link = " ";
531 if ($tema->TLINK != "") 531 if ($tema->TLINK != "")
532 - {$link = ixml($tema,"TLINK");}  
533 - $tid = ixml($tema,"TID");  
534 - $nome = ixml($tema,"TNOME");  
535 - $temas[] = array("nacessos"=>(ixml($tema,"NACESSOS")),"tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc); 532 + {$link = $this->ixml($tema,"TLINK");}
  533 + $tid = $this->ixml($tema,"TID");
  534 + $nome = $this->ixml($tema,"TNOME");
  535 + $temas[] = array("nacessos"=>($this->ixml($tema,"NACESSOS")),"tid"=>$tid,"nome"=>$nome,"link"=>$link,"download"=>$down,"ogc"=>$ogc);
536 } 536 }
537 } 537 }
538 } 538 }
@@ -575,19 +575,19 @@ array @@ -575,19 +575,19 @@ array
575 //pega os sistemas checando os perfis 575 //pega os sistemas checando os perfis
576 foreach($this->xml->MAPA as $s) 576 foreach($this->xml->MAPA as $s)
577 { 577 {
578 - $ps = ixml($s,"PERFIL"); 578 + $ps = $this->ixml($s,"PERFIL");
579 $perfis = str_replace(","," ",$ps); 579 $perfis = str_replace(","," ",$ps);
580 $perfis = explode(" ",$perfis); 580 $perfis = explode(" ",$perfis);
581 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == "")) 581 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == ""))
582 { 582 {
583 - $n = ixml($s,"NOME");  
584 - $i = ixml($s,"IMAGEM");  
585 - $t = ixml($s,"TEMAS");  
586 - $l = ixml($s,"LIGADOS");  
587 - $e = ixml($s,"EXTENSAO");  
588 - $o = ixml($s,"OUTROS");  
589 - $k = ixml($s,"LINKDIRETO");  
590 - $p = ixml($s,"PUBLICADO"); 583 + $n = $this->ixml($s,"NOME");
  584 + $i = $this->ixml($s,"IMAGEM");
  585 + $t = $this->ixml($s,"TEMAS");
  586 + $l = $this->ixml($s,"LIGADOS");
  587 + $e = $this->ixml($s,"EXTENSAO");
  588 + $o = $this->ixml($s,"OUTROS");
  589 + $k = $this->ixml($s,"LINKDIRETO");
  590 + $p = $this->ixml($s,"PUBLICADO");
591 $mapas[] = array("PUBLICADO"=>$p,"NOME"=>$n,"IMAGEM"=>$i,"TEMAS"=>$t,"LIGADOS"=>$l,"EXTENSAO"=>$e,"OUTROS"=>$o,"LINK"=>$k); 591 $mapas[] = array("PUBLICADO"=>$p,"NOME"=>$n,"IMAGEM"=>$i,"TEMAS"=>$t,"LIGADOS"=>$l,"EXTENSAO"=>$e,"OUTROS"=>$o,"LINK"=>$k);
592 } 592 }
593 } 593 }
@@ -614,11 +614,11 @@ Array @@ -614,11 +614,11 @@ Array
614 {$xmlsistemas = simplexml_load_string(geraXmlSistemas(implode(" ",$this->perfil),$this->locaplic,$this->editores));} 614 {$xmlsistemas = simplexml_load_string(geraXmlSistemas(implode(" ",$this->perfil),$this->locaplic,$this->editores));}
615 foreach($xmlsistemas->SISTEMA as $s) 615 foreach($xmlsistemas->SISTEMA as $s)
616 { 616 {
617 - $publicado = ixml($s,"PUBLICADO"); 617 + $publicado = $this->ixml($s,"PUBLICADO");
618 if(strtolower($publicado) != "nao" || $this->editor) 618 if(strtolower($publicado) != "nao" || $this->editor)
619 { 619 {
620 - $nomesis = ixml($s,"NOMESIS");  
621 - $ps = ixml($s,"PERFIL"); 620 + $nomesis = $this->ixml($s,"NOMESIS");
  621 + $ps = $this->ixml($s,"PERFIL");
622 $perfis = str_replace(","," ",$ps); 622 $perfis = str_replace(","," ",$ps);
623 $perfis = explode(" ",$perfis); 623 $perfis = explode(" ",$perfis);
624 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == "")) 624 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == ""))
@@ -626,11 +626,11 @@ Array @@ -626,11 +626,11 @@ Array
626 $funcoes = array(); 626 $funcoes = array();
627 foreach($s->FUNCAO as $f) 627 foreach($s->FUNCAO as $f)
628 { 628 {
629 - $n = ixml($f,"NOMEFUNCAO");  
630 - $a = ixml($f,"ABRIR");  
631 - $w = ixml($f,"JANELAW");  
632 - $h = ixml($f,"JANELAH");  
633 - $p = ixml($f,"PERFIL"); 629 + $n = $this->ixml($f,"NOMEFUNCAO");
  630 + $a = $this->ixml($f,"ABRIR");
  631 + $w = $this->ixml($f,"JANELAW");
  632 + $h = $this->ixml($f,"JANELAH");
  633 + $p = $this->ixml($f,"PERFIL");
634 if (($this->array_in_array($this->perfil,$perfis)) || ($p == "")) 634 if (($this->array_in_array($this->perfil,$perfis)) || ($p == ""))
635 {$funcoes[] = array("NOME"=>$n,"ABRIR"=>$a,"W"=>$w,"H"=>$h);} 635 {$funcoes[] = array("NOME"=>$n,"ABRIR"=>$a,"W"=>$w,"H"=>$h);}
636 } 636 }
@@ -684,7 +684,7 @@ $procurar - String que será procurada. @@ -684,7 +684,7 @@ $procurar - String que será procurada.
684 foreach($xml->GRUPO as $grupo) 684 foreach($xml->GRUPO as $grupo)
685 { 685 {
686 $incluigrupo = TRUE; 686 $incluigrupo = TRUE;
687 - $temp = ixml($grupo,"PERFIL"); 687 + $temp = $this->ixml($grupo,"PERFIL");
688 if ($temp != "") 688 if ($temp != "")
689 { 689 {
690 $incluigrupo = FALSE; 690 $incluigrupo = FALSE;
@@ -700,7 +700,7 @@ $procurar - String que será procurada. @@ -700,7 +700,7 @@ $procurar - String que será procurada.
700 $incluisgrupo = TRUE; 700 $incluisgrupo = TRUE;
701 if ($this->perfil != "") 701 if ($this->perfil != "")
702 { 702 {
703 - $temp = ixml($sgrupo,"PERFIL"); 703 + $temp = $this->ixml($sgrupo,"PERFIL");
704 $perfis = str_replace(","," ",$temp); 704 $perfis = str_replace(","," ",$temp);
705 $perfis = explode(" ",$perfis); 705 $perfis = explode(" ",$perfis);
706 if (!$this->array_in_array($this->perfil,$perfis)) 706 if (!$this->array_in_array($this->perfil,$perfis))
@@ -713,7 +713,7 @@ $procurar - String que será procurada. @@ -713,7 +713,7 @@ $procurar - String que será procurada.
713 $inclui = TRUE; 713 $inclui = TRUE;
714 if ($this->perfil != "") 714 if ($this->perfil != "")
715 { 715 {
716 - $temp = ixml($tema,"PERFIL"); 716 + $temp = $this->ixml($tema,"PERFIL");
717 $perfis = str_replace(","," ",$temp); 717 $perfis = str_replace(","," ",$temp);
718 $perfis = explode(" ",$perfis); 718 $perfis = explode(" ",$perfis);
719 if (!$this->array_in_array($this->perfil,$perfis)) 719 if (!$this->array_in_array($this->perfil,$perfis))
@@ -722,28 +722,28 @@ $procurar - String que será procurada. @@ -722,28 +722,28 @@ $procurar - String que será procurada.
722 if ($inclui == TRUE) 722 if ($inclui == TRUE)
723 { 723 {
724 $down = "nao"; 724 $down = "nao";
725 - $temp = ixml($tema,"DOWNLOAD"); 725 + $temp = $this->ixml($tema,"DOWNLOAD");
726 if (($temp == "sim") || ($temp == "SIM")) 726 if (($temp == "sim") || ($temp == "SIM"))
727 {$down = "sim";} 727 {$down = "sim";}
728 - $link = ixml($tema,"TLINK");  
729 - $tid = ixml($tema,"TID"); 728 + $link = $this->ixml($tema,"TLINK");
  729 + $tid = $this->ixml($tema,"TID");
730 730
731 if(!isset($texto[$tid])) 731 if(!isset($texto[$tid]))
732 { 732 {
733 - $texto[$tid] = array("tid"=>$tid,"nome"=>(ixml($tema,"TNOME")),"link"=>$link,"download"=>$down); 733 + $texto[$tid] = array("tid"=>$tid,"nome"=>($this->ixml($tema,"TNOME")),"link"=>$link,"download"=>$down);
734 $p1 = $this->removeAcentos($procurar); 734 $p1 = $this->removeAcentos($procurar);
735 $p1 = $this->removeAcentos(htmlentities($p1)); 735 $p1 = $this->removeAcentos(htmlentities($p1));
736 - $pp1 = $this->removeAcentos(ixml($tema,"TNOME")); 736 + $pp1 = $this->removeAcentos($this->ixml($tema,"TNOME"));
737 $pp1 = $this->removeAcentos($pp1); 737 $pp1 = $this->removeAcentos($pp1);
738 $pp1 = $this->removeAcentos(htmlentities($pp1)); 738 $pp1 = $this->removeAcentos(htmlentities($pp1));
739 - if (stristr($pp1,$p1) || stristr(ixml($tema,"TNOME"),htmlentities($procurar))) 739 + if (stristr($pp1,$p1) || stristr($this->ixml($tema,"TNOME"),htmlentities($procurar)))
740 { 740 {
741 $listadetemas[] = $texto[$tid]; 741 $listadetemas[] = $texto[$tid];
742 } 742 }
743 else 743 else
744 - if(ixml($tema,"TAGS") != "") 744 + if($this->ixml($tema,"TAGS") != "")
745 { 745 {
746 - $pp1 = ixml($tema,"TAGS"); 746 + $pp1 = $this->ixml($tema,"TAGS");
747 $pp1 = $this->removeAcentos($pp1); 747 $pp1 = $this->removeAcentos($pp1);
748 if (stristr($pp1,$p1)) 748 if (stristr($pp1,$p1))
749 {$listadetemas[] = $texto[$tid];} 749 {$listadetemas[] = $texto[$tid];}
@@ -753,7 +753,7 @@ $procurar - String que será procurada. @@ -753,7 +753,7 @@ $procurar - String que será procurada.
753 } 753 }
754 if (count($listadetemas) > 0) 754 if (count($listadetemas) > 0)
755 { 755 {
756 - $subgrupo[] = array("subgrupo"=>(ixml($sgrupo,"SDTIPO")),"temas"=>$listadetemas); 756 + $subgrupo[] = array("subgrupo"=>($this->ixml($sgrupo,"SDTIPO")),"temas"=>$listadetemas);
757 } 757 }
758 $listadetemas = array(); 758 $listadetemas = array();
759 } 759 }
@@ -761,7 +761,7 @@ $procurar - String que será procurada. @@ -761,7 +761,7 @@ $procurar - String que será procurada.
761 } 761 }
762 if (count($subgrupo) > 0) 762 if (count($subgrupo) > 0)
763 { 763 {
764 - $resultado[] = array("grupo"=>(ixml($grupo,"GTIPO")),"subgrupos"=>$subgrupo); 764 + $resultado[] = array("grupo"=>($this->ixml($grupo,"GTIPO")),"subgrupos"=>$subgrupo);
765 } 765 }
766 $subgrupo = array(); 766 $subgrupo = array();
767 } 767 }
@@ -793,7 +793,7 @@ nrss - (opcional) número de registros no rss que serão considerados @@ -793,7 +793,7 @@ nrss - (opcional) número de registros no rss que serão considerados
793 foreach ( simplexml_load_file($rss)->channel->item as $item ) 793 foreach ( simplexml_load_file($rss)->channel->item as $item )
794 { 794 {
795 if($conta < $nrss) 795 if($conta < $nrss)
796 - $noticiasRSS[] = array("desc"=>(ixml($item,"description")),"titulo"=>(ixml($item,"title")),"link"=>(ixml($item,"link"))); 796 + $noticiasRSS[] = array("desc"=>($this->ixml($item,"description")),"titulo"=>($this->ixml($item,"title")),"link"=>($this->ixml($item,"link")));
797 $conta++; 797 $conta++;
798 } 798 }
799 } 799 }
@@ -818,7 +818,7 @@ nrss - (opcional) número de registros no rss que serão considerados @@ -818,7 +818,7 @@ nrss - (opcional) número de registros no rss que serão considerados
818 foreach($xml->GRUPO as $grupo) 818 foreach($xml->GRUPO as $grupo)
819 { 819 {
820 $incluigrupo = TRUE; 820 $incluigrupo = TRUE;
821 - $temp = ixml($grupo,"PERFIL"); 821 + $temp = $this->ixml($grupo,"PERFIL");
822 if ($temp != "") 822 if ($temp != "")
823 { 823 {
824 $incluigrupo = FALSE; 824 $incluigrupo = FALSE;
@@ -833,7 +833,7 @@ nrss - (opcional) número de registros no rss que serão considerados @@ -833,7 +833,7 @@ nrss - (opcional) número de registros no rss que serão considerados
833 $incluisgrupo = TRUE; 833 $incluisgrupo = TRUE;
834 if ($this->perfil != "") 834 if ($this->perfil != "")
835 { 835 {
836 - $temp = ixml($sgrupo,"PERFIL"); 836 + $temp = $this->ixml($sgrupo,"PERFIL");
837 $perfis = str_replace(","," ",$temp); 837 $perfis = str_replace(","," ",$temp);
838 $perfis = explode(" ",$perfis); 838 $perfis = explode(" ",$perfis);
839 if (!$this->array_in_array($this->perfil,$perfis)) 839 if (!$this->array_in_array($this->perfil,$perfis))
@@ -853,8 +853,8 @@ nrss - (opcional) número de registros no rss que serão considerados @@ -853,8 +853,8 @@ nrss - (opcional) número de registros no rss que serão considerados
853 } 853 }
854 if ($inclui == TRUE) 854 if ($inclui == TRUE)
855 { 855 {
856 - $tid = ixml($tema,"TID");  
857 - $tags = explode(" ",ixml($tema,"TAGS")); 856 + $tid = $this->ixml($tema,"TID");
  857 + $tags = explode(" ",$this->ixml($tema,"TAGS"));
858 foreach ($tags as $tag) 858 foreach ($tags as $tag)
859 { 859 {
860 if($tag != "") 860 if($tag != "")
@@ -956,5 +956,10 @@ nrss - (opcional) número de registros no rss que serão considerados @@ -956,5 +956,10 @@ nrss - (opcional) número de registros no rss que serão considerados
956 } 956 }
957 return $editor; 957 return $editor;
958 } 958 }
  959 + function ixml($no,$nome)
  960 + {
  961 + return mb_convert_encoding($no->$nome,"HTML-ENTITIES","auto");
  962 + }
  963 +
959 } 964 }
960 ?> 965 ?>
961 \ No newline at end of file 966 \ No newline at end of file
classesphp/mapa_controle.php
@@ -1932,6 +1932,8 @@ Include: @@ -1932,6 +1932,8 @@ Include:
1932 /* 1932 /*
1933 Property: identifica 1933 Property: identifica
1934 1934
  1935 +Depreciado na versão 4.2 (utilize "identifica2")
  1936 +
1935 Identifica elementos no mapa. 1937 Identifica elementos no mapa.
1936 1938
1937 Include: 1939 Include:
@@ -1945,6 +1947,22 @@ Include: @@ -1945,6 +1947,22 @@ Include:
1945 $cp->set_data($m->identifica($opcao,$xy,$resolucao)); 1947 $cp->set_data($m->identifica($opcao,$xy,$resolucao));
1946 break; 1948 break;
1947 /* 1949 /*
  1950 +Property: identifica2
  1951 +
  1952 +Identifica elementos no mapa.
  1953 +
  1954 +Include:
  1955 +<classe_atributos.php>
  1956 +*/
  1957 + case "identifica2":
  1958 + if (!isset($tema)){$tema = "";}
  1959 + if (!isset($resolucao)){$resolucao = 5;}
  1960 + include_once("classe_atributos.php");
  1961 + $m = new Atributos($map_file,$tema);
  1962 + $cp->set_data($m->identifica2($opcao,$xy,$resolucao));
  1963 + break;
  1964 +
  1965 +/*
1948 Property: identificaunico 1966 Property: identificaunico
1949 1967
1950 Identifica elementos no mapa retornando apenas o valor de um único item. 1968 Identifica elementos no mapa retornando apenas o valor de um único item.