Commit 5c73020e1f69ab04cf458ed16bec9c6c0d0ad989

Authored by Edmar Moretti
1 parent 245fb615

--no commit message

classesphp/classe_toponimia.php
... ... @@ -314,14 +314,18 @@ $item Lista de Itens separados por vírgula que serão utilizados.
314 314 if(!$this->layer){return "erro";}
315 315 $itens = $this->layer->getmetadata("ITENS");
316 316 $itens = explode(",",$itens);
317   - $itensdesc = $this->layer->getmetadata("ITENSDESC");
  317 + $itensdesc = mb_convert_encoding($this->layer->getmetadata("ITENSDESC"),"UTF-8","ISO-8859-1");
318 318 $itensdesc = explode(",",$itensdesc);
  319 + $itenslink = $this->layer->getmetadata("ITENSLINK");
  320 + $itenslink = explode(",",$itenslink);
  321 +
319 322 $tips = $this->layer->getmetadata("TIP");
  323 +
320 324 $res = array(
321 325 "itens"=>$itens,
322   - "itensdesc"=>$itensdesc,
323   - "tips"=>explode(",",$tips),
324   - "comb"=>array_combine($itens,$itensdesc)
  326 + "itensdesc"=>array_combine($itens,$itensdesc),
  327 + "itenslink"=>array_combine($itens,$itenslink),
  328 + "tips"=>explode(",",$tips)
325 329 );
326 330 return($res);
327 331 }
... ...
css/geral.css
... ... @@ -1033,7 +1033,16 @@ h1 {
1033 1033 border-radius: 2px;
1034 1034 }
1035 1035  
1036   -.styled-select select {
  1036 +.styled-select150 {
  1037 + width: 150px;
  1038 + overflow: hidden;
  1039 + background: #F8F8F8;
  1040 + border: 1px solid #DDDDDD;
  1041 + height: 22px;
  1042 + border-radius: 2px;
  1043 +}
  1044 +
  1045 +.styled-select select, .styled-select150 select {
1037 1046 width: 120%;
1038 1047 height: 22px;
1039 1048 border: 0;
... ... @@ -1053,7 +1062,7 @@ h1 {
1053 1062 }
1054 1063 }
1055 1064  
1056   -.styled-select input {
  1065 +.styled-select input, .styled-select150 input {
1057 1066 width: 100%;
1058 1067 height: 22px;
1059 1068 border: 0;
... ...
css/i3geo6.css
... ... @@ -915,7 +915,15 @@ border: 1px solid #DDDDDD;
915 915 height: 22px;
916 916 border-radius: 2px;
917 917 }
918   -.styled-select select {
  918 +.styled-select150 {
  919 +width: 150px;
  920 +overflow: hidden;
  921 +background: #F8F8F8;
  922 +border: 1px solid #DDDDDD;
  923 +height: 22px;
  924 +border-radius: 2px;
  925 +}
  926 +.styled-select select, .styled-select150 select {
919 927 width: 120%;
920 928 height: 22px;
921 929 border: 0;
... ... @@ -934,7 +942,7 @@ background: transparent url("../imagens/menuarodwn8_nrm_1.gif") no-repeat scroll
934 942 background-size: 16px 144px;
935 943 }
936 944 }
937   -.styled-select input {
  945 +.styled-select input, .styled-select150 input {
938 946 width: 100%;
939 947 height: 22px;
940 948 border: 0;
... ...
css/i3geo6.css.php
... ... @@ -915,7 +915,15 @@ border: 1px solid #DDDDDD;
915 915 height: 22px;
916 916 border-radius: 2px;
917 917 }
918   -.styled-select select {
  918 +.styled-select150 {
  919 +width: 150px;
  920 +overflow: hidden;
  921 +background: #F8F8F8;
  922 +border: 1px solid #DDDDDD;
  923 +height: 22px;
  924 +border-radius: 2px;
  925 +}
  926 +.styled-select select, .styled-select150 select {
919 927 width: 120%;
920 928 height: 22px;
921 929 border: 0;
... ... @@ -934,7 +942,7 @@ background: transparent url("../imagens/menuarodwn8_nrm_1.gif") no-repeat scroll
934 942 background-size: 16px 144px;
935 943 }
936 944 }
937   -.styled-select input {
  945 +.styled-select input, .styled-select150 input {
938 946 width: 100%;
939 947 height: 22px;
940 948 border: 0;
... ...
ferramentas/etiqueta/exec.php
... ... @@ -17,10 +17,14 @@ Ativa as etiquetas de um tema.
17 17 include_once(dirname(__FILE__)."/../../classesphp/classe_toponimia.php");
18 18 copiaSeguranca($map_file);
19 19 $m = new Toponimia($map_file,$tema);
20   - $retorno = $m->ativaEtiquetas($tips);
  20 + $m->layer->setmetadata("IDENTIFICA","");
  21 + $m->layer->setmetadata("TIP",$tips);
21 22 $m->layer->setmetadata("ITENS",$itens);
  23 + $m->layer->setmetadata("ITENSDESC",base64_decode($itensdesc));
  24 + $m->layer->setmetadata("ITENSLINK",base64_decode($itenslink));
22 25 $m->salva();
23 26 $_SESSION["contadorsalva"]++;
  27 + $retorno = "ok";
24 28 break;
25 29 /*
26 30 Valor: REMOVEETIQUETAS
... ...
ferramentas/etiqueta/index.js
... ... @@ -116,7 +116,7 @@ i3GEOF.etiqueta = {
116 116 html:function(){
117 117 var ins = '';
118 118 ins += '<p class="paragrafo" >'+$trad('selecionaItem',i3GEOF.etiqueta.dicionario)+':<br>';
119   - ins += '<div id=i3GEOetiquetalistai class=digitar style="text-align:left;left:0px;top:0px;330px;height:80px;overflow:auto;display:block;"></div>';
  119 + ins += '<div id=i3GEOetiquetalistai class=digitar style="text-align:left;left:0px;top:0px;width;95%;height:150px;overflow:auto;display:block;"></div>';
120 120 ins += '<br>';
121 121 ins += '<p class="paragrafo" >';
122 122 ins += '<input id=i3GEOetiquetabotao1 size=35 type=button value="'+$trad("p14")+'" />';
... ... @@ -143,8 +143,8 @@ i3GEOF.etiqueta = {
143 143 //cria a janela flutuante
144 144 titulo = "<div id='i3GEOFetiquetaComboCabeca' class='comboTemasCabecalho'> ------</div><span style=margin-left:60px>"+$trad("d7at")+"</span><a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=5&idajuda=37' >&nbsp;&nbsp;&nbsp;</a>";
145 145 janela = i3GEO.janela.cria(
146   - "450px",
147   - "175px",
  146 + "500px",
  147 + "230px",
148 148 "",
149 149 "",
150 150 "",
... ... @@ -197,15 +197,16 @@ i3GEOF.etiqueta = {
197 197 montaListaItens: function(retorno){
198 198 var funcao = function(dadosItens){
199 199 var ins,i,n,itensatuais,item,ck = '',lista;
200   - lista = dadosItens.data.comb;
  200 + lista = dadosItens.data;
201 201 try{
202 202 itensatuais = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo);
203 203 itensatuais = itensatuais.etiquetas.split(",");
204 204 ins = [];
205   - ins.push("<table class='lista6' >");
206   - ins.push("<tr><td>Coluna</td><td>Tip</td><td>Identifica</td>");
  205 + ins.push("<table class='lista8' >");
  206 + ins.push("<tr><td>Coluna</td><td>Tip</td><td>Identifica</td><td>Alias</td><td>Link</td>");
207 207 n = retorno.data.valores.length;
208 208 for (i=0;i<n; i++){
  209 + //etiquetas tip
209 210 item = retorno.data.valores[i].item;
210 211 if(i3GEO.util.in_array(item,itensatuais)){
211 212 ck = "checked";
... ... @@ -215,46 +216,91 @@ i3GEOF.etiqueta = {
215 216 }
216 217 ins.push("<tr>");
217 218 ins.push("<td>&nbsp;"+item+"</td>");
218   - ins.push("<td><input style='cursor:pointer' "+ck+" type='checkbox' value='"+item+"' name='etiquetaTip' /></td>");
219   - if(lista[item]){
  219 + ins.push("<td><input disabled style='cursor:pointer' "+ck+" type='checkbox' value='"+item+"' name='etiquetaTip' /></td>");
  220 + //itens
  221 + if(i3GEO.util.in_array(item,lista.itens)){
220 222 ck = "checked";
221 223 }
222 224 else{
223 225 ck = "";
224 226 }
225   - ins.push("<td><input style='cursor:pointer' "+ck+" type='checkbox' value='"+item+"' name='identifica' /></td>");
  227 + ins.push("<td><input onclick='i3GEOF.etiqueta.ativaLinha(this)' style='cursor:pointer' id='etiqueta_"+item+"' "+ck+" type='checkbox' value='"+item+"' name='identifica' /></td>");
  228 + //alias dos itens
  229 + if(lista.itensdesc[item]){
  230 + ck = lista.itensdesc[item];
  231 + }
  232 + else{
  233 + ck = "";
  234 + }
  235 + ins.push("<td><div class='styled-select150' ><input disabled style='cursor:pointer' type='text' value='"+ck+"' name='itensdesc' /></div></td>");
  236 + //links
  237 + if(lista.itenslink[item]){
  238 + ck = lista.itenslink[item];
  239 + }
  240 + else{
  241 + ck = "";
  242 + }
  243 + ins.push("<td><div class='styled-select150' ><input disabled style='cursor:pointer' type='text' value='"+ck+"' name='itenslink' /></div></td>");
  244 +
226 245 ins.push("</tr>");
227 246 }
228   - $i("i3GEOetiquetalistai").innerHTML = ins.join("");
229 247 ins.push("</table>");
  248 + $i("i3GEOetiquetalistai").innerHTML = ins.join("");
  249 + //enable
  250 + lista = $i("i3GEOetiquetalistai").getElementsByTagName("input");
  251 + n = lista.length;
  252 + for (i=0;i<n; i++){
  253 + if(lista[i].name === "identifica"){
  254 + i3GEOF.etiqueta.ativaLinha(lista[i]);
  255 + }
  256 + }
230 257 }
231 258 catch(e)
232 259 {$i("i3GEOetiquetalistai").innerHTML = "<p style=color:red >Erro<br>"+e;}
233 260 };
234 261 i3GEOF.etiqueta.pegaDadosEtiquetas(funcao);
235 262 },
  263 + ativaLinha: function(obj){
  264 + var linha = obj.parentNode.parentNode,
  265 + objs = linha.getElementsByTagName("input"),
  266 + n = objs.length,
  267 + i;
  268 + for(i=0;i<n;i++){
  269 + if(objs[i].name != "identifica"){
  270 + objs[i].disabled = !obj.checked;
  271 + }
  272 + }
  273 + },
236 274 /*
237 275 Function: pegaItensMarcados
238 276  
239   - Recupera os itens que foram marcados e monta uma lista para enviar como parmetro para a fun&ccedil;&atilde;o de gera&ccedil;&atilde;o dos gr&aacute;ficos
  277 + Recupera os itens que foram marcados e monta uma lista para enviar como par&acirc;metro para a fun&ccedil;&atilde;o de gera&ccedil;&atilde;o dos gr&aacute;ficos
240 278 */
241 279 pegaItensMarcados: function(){
242 280 var tips = [],
243 281 itens = [],
  282 + itensdesc = [],
  283 + itenslink = [],
244 284 inputs = $i("i3GEOetiquetalistai").getElementsByTagName("input"),
245 285 i,
246 286 it,
247 287 n = inputs.length;
248 288 for (i=0;i<n; i++){
249 289 it = inputs[i];
250   - if (it.checked === true && it.name === "etiquetaTip"){
  290 + if (it.disabled === false && it.checked === true && it.name === "etiquetaTip"){
251 291 tips.push(it.value);
252 292 }
253   - if (it.checked === true && it.name === "identifica"){
  293 + if (it.disabled === false && it.checked === true && it.name === "identifica"){
254 294 itens.push(it.value);
255 295 }
  296 + if (it.disabled === false && it.name === "itensdesc"){
  297 + itensdesc.push(it.value);
  298 + }
  299 + if (it.disabled === false && it.name === "itenslink"){
  300 + itenslink.push(it.value);
  301 + }
256 302 }
257   - return([tips,itens]);
  303 + return([tips,itens,itensdesc,itenslink]);
258 304 },
259 305 /*
260 306 Function: ativa
... ... @@ -278,14 +324,18 @@ i3GEOF.etiqueta = {
278 324 temp = function(retorno){
279 325 i3GEOF.etiqueta.aguarde.visibility = "hidden";
280 326 i3GEO.atualiza(retorno);
  327 + i3GEO.php.listaItensTema(i3GEOF.etiqueta.montaListaItens,i3GEO.temaAtivo);
281 328 };
282 329 p = i3GEO.configura.locaplic+"/ferramentas/etiqueta/exec.php?g_sid="
283 330 + i3GEO.configura.sid
284 331 + "&funcao=ativaEtiquetas&tema="
285 332 + i3GEO.temaAtivo
286 333 + "&tips="+lista[0].toString(",")
287   - + "&itens="+lista[1].toString(",");
  334 + + "&itens="+lista[1].toString(",")
  335 + + "&itensdesc="+i3GEO.util.base64encode(lista[2].toString(","))
  336 + + "&itenslink="+i3GEO.util.base64encode(lista[3].toString(","));
288 337 cp.set_response_type("JSON");
  338 + cp.set_transfer_mode('POST');
289 339 cp.call(p,"etiqueta",temp);
290 340 }catch(e){i3GEO.janela.tempoMsg("Erro: "+e);i3GEOF.etiqueta.aguarde.visibility = "hidden";}
291 341 },
... ...
ferramentas/etiqueta/template_mst.html
1 1 <p class='paragrafo'>
2 2 {{{selecionaItem}}}:<br>
3   -<div id='i3GEOetiquetalistai' class='digitar' style='text-align: left; left: 0px; top: 0px; 330 px; height: 80px; overflow: auto; display: block;'></div>
  3 +<div id='i3GEOetiquetalistai' class='digitar' style='text-align: left; left: 0px; top: 0px; width:95%; height: 80px; overflow: auto; display: block;'></div>
4 4 <br>
5 5 <p class='paragrafo'>
6 6 <input id='i3GEOetiquetabotao1' size='35' type='button' value="'+$trad(" p14")+'" />
... ...