Commit 0076ba5b99c78c75dccb6c0a0338bf6dfddb10b6

Authored by Edmar Moretti
1 parent 3cb0fee4

Alterações nos estilos das janelas dos formulários no sistema de administração

admin/admin.db
No preview for this file type
admin/js/arvore.js
@@ -647,7 +647,7 @@ function editar(tipo,id) @@ -647,7 +647,7 @@ function editar(tipo,id)
647 if(tipo == "grupo") 647 if(tipo == "grupo")
648 { 648 {
649 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 649 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
650 - core_montaEditor("gravaDados('grupo','"+id+"')","400px","400px"); 650 + core_montaEditor("gravaDados('grupo','"+id+"')","400px","400px","","Grupo",true,true,false);
651 $i("editor_bd").innerHTML = montaDivGrupo(dados); 651 $i("editor_bd").innerHTML = montaDivGrupo(dados);
652 core_comboGrupos("comboGrupo","Eid_grupo",dados.id_grupo,""); 652 core_comboGrupos("comboGrupo","Eid_grupo",dados.id_grupo,"");
653 core_comboPerfis("comboPerfil","Eperfil_grupo","","registraPerfil(this.value,\"En1_perfil\")"); 653 core_comboPerfis("comboPerfil","Eperfil_grupo","","registraPerfil(this.value,\"En1_perfil\")");
@@ -655,7 +655,7 @@ function editar(tipo,id) @@ -655,7 +655,7 @@ function editar(tipo,id)
655 if(tipo == "subgrupo") 655 if(tipo == "subgrupo")
656 { 656 {
657 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 657 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
658 - core_montaEditor("gravaDados('subgrupo','"+id+"')","400px","400px"); 658 + core_montaEditor("gravaDados('subgrupo','"+id+"')","400px","400px","","SubGrupo",true,true,false);
659 $i("editor_bd").innerHTML = montaDivSubGrupo(dados); 659 $i("editor_bd").innerHTML = montaDivSubGrupo(dados);
660 core_comboSubGrupos("comboSubGrupo","Eid_subgrupo",dados.id_subgrupo,""); 660 core_comboSubGrupos("comboSubGrupo","Eid_subgrupo",dados.id_subgrupo,"");
661 core_comboPerfis("comboPerfil","Eperfil_subgrupo","","registraPerfil(this.value,\"En2_perfil\")"); 661 core_comboPerfis("comboPerfil","Eperfil_subgrupo","","registraPerfil(this.value,\"En2_perfil\")");
@@ -663,7 +663,7 @@ function editar(tipo,id) @@ -663,7 +663,7 @@ function editar(tipo,id)
663 if(tipo == "tema") 663 if(tipo == "tema")
664 { 664 {
665 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 665 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
666 - core_montaEditor("gravaDados('tema','"+id+"')","400px","400px"); 666 + core_montaEditor("gravaDados('tema','"+id+"')","400px","400px","","Tema",true,true,false);
667 $i("editor_bd").innerHTML = montaDivTema(dados); 667 $i("editor_bd").innerHTML = montaDivTema(dados);
668 core_comboTemas("comboTema","Eid_tema",dados.id_tema,""); 668 core_comboTemas("comboTema","Eid_tema",dados.id_tema,"");
669 core_comboPerfis("comboPerfil","Eperfil_tema","","registraPerfil(this.value,\"En3_perfil\")"); 669 core_comboPerfis("comboPerfil","Eperfil_tema","","registraPerfil(this.value,\"En3_perfil\")");
@@ -671,7 +671,7 @@ function editar(tipo,id) @@ -671,7 +671,7 @@ function editar(tipo,id)
671 if(tipo == "raizmenu" || tipo == "raizgrupo") 671 if(tipo == "raizmenu" || tipo == "raizgrupo")
672 { 672 {
673 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 673 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
674 - core_montaEditor("gravaDados('"+tipo+"','"+id+"')"); 674 + core_montaEditor("gravaDados('"+tipo+"','"+id+"')","","","","Raiz",true,true,false);
675 $i("editor_bd").innerHTML = montaDivRaiz(dados); 675 $i("editor_bd").innerHTML = montaDivRaiz(dados);
676 core_comboTemas("comboTema","Eid_tema",dados.id_tema,""); 676 core_comboTemas("comboTema","Eid_tema",dados.id_tema,"");
677 core_comboPerfis("comboPerfil","Eperfil","","registraPerfil(this.value,\"Eperfil\")"); 677 core_comboPerfis("comboPerfil","Eperfil","","registraPerfil(this.value,\"Eperfil\")");
admin/js/atlas.js
@@ -279,7 +279,7 @@ function editar(tipo,id) @@ -279,7 +279,7 @@ function editar(tipo,id)
279 if(tipo == "atlas") 279 if(tipo == "atlas")
280 { 280 {
281 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 281 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
282 - core_montaEditor("gravaDados('atlas','"+id+"')"); 282 + core_montaEditor("gravaDados('atlas','"+id+"')","","","","Atlas",true,true,false);
283 $i("editor_bd").innerHTML = montaDivAtlas(dados); 283 $i("editor_bd").innerHTML = montaDivAtlas(dados);
284 core_carregando("desativa"); 284 core_carregando("desativa");
285 core_comboPranchas("comboPranchaIni","Epranchadefault_atlas",dados.pranchadefault_atlas,"",id); 285 core_comboPranchas("comboPranchaIni","Epranchadefault_atlas",dados.pranchadefault_atlas,"",id);
@@ -287,14 +287,14 @@ function editar(tipo,id) @@ -287,14 +287,14 @@ function editar(tipo,id)
287 if(tipo == "prancha") 287 if(tipo == "prancha")
288 { 288 {
289 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 289 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
290 - core_montaEditor("gravaDados('prancha','"+id+"')"); 290 + core_montaEditor("gravaDados('prancha','"+id+"')","","","","Prancha",true,true,false);
291 $i("editor_bd").innerHTML = montaDivPrancha(dados); 291 $i("editor_bd").innerHTML = montaDivPrancha(dados);
292 core_carregando("desativa"); 292 core_carregando("desativa");
293 } 293 }
294 if(tipo == "tema") 294 if(tipo == "tema")
295 { 295 {
296 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 296 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
297 - core_montaEditor("gravaDados('tema','"+id+"')"); 297 + core_montaEditor("gravaDados('tema','"+id+"')","","","","Tema",true,true,false);
298 $i("editor_bd").innerHTML = montaDivTema(dados); 298 $i("editor_bd").innerHTML = montaDivTema(dados);
299 core_carregando("desativa"); 299 core_carregando("desativa");
300 core_comboMapfiles("comboTemaIni","Ecodigo_tema",dados.codigo_tema,"",true); 300 core_comboMapfiles("comboTemaIni","Ecodigo_tema",dados.codigo_tema,"",true);
admin/js/core.js
@@ -1487,57 +1487,81 @@ funcaoClose - nome da funcao que será executada quando a janela for fecha @@ -1487,57 +1487,81 @@ funcaoClose - nome da funcao que será executada quando a janela for fecha
1487 titulo - titulo da janela 1487 titulo - titulo da janela
1488 1488
1489 modal - boolean 1489 modal - boolean
  1490 +
  1491 +bsalva - boolean botao salvar
  1492 +
  1493 +bcancela - boolean botao cancelar
1490 */ 1494 */
1491 -function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal) 1495 +function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal,bsalva,bcancela)
1492 { 1496 {
1493 - if(arguments.length == 0)  
1494 - { 1497 + if(!funcaoOK){
1495 funcaoOK = ""; 1498 funcaoOK = "";
1496 - w = "400px";  
1497 - h = "354px";  
1498 - modal == true;  
1499 } 1499 }
1500 - if(arguments.length < 2)  
1501 - { 1500 + if(!w){
1502 w = "400px"; 1501 w = "400px";
  1502 + }
  1503 + if(!h){
1503 h = "354px"; 1504 h = "354px";
1504 - modal == true; 1505 + }
  1506 + if(modal == undefined){
  1507 + modal = false;
  1508 + }
  1509 + if(bsalva == undefined){
  1510 + bsalva = true;
  1511 + }
  1512 + if(bcancela == undefined){
  1513 + bcancela = true;
1505 } 1514 }
1506 if(!titulo){ 1515 if(!titulo){
1507 titulo = "Editor"; 1516 titulo = "Editor";
1508 - modal == true;  
1509 } 1517 }
1510 if(!funcaoClose){ 1518 if(!funcaoClose){
1511 funcaoClose = ""; 1519 funcaoClose = "";
1512 - modal == true;  
1513 } 1520 }
1514 if(!$i("janela_editor")) 1521 if(!$i("janela_editor"))
1515 { 1522 {
1516 - var novoel = document.createElement("div"); 1523 + var ins = "", temp = "", lb,
  1524 + salvai = "<input id=okcancel_checkboxOK type='buttom' value='Salva' />",
  1525 + cancelai = "<input id=okcancel_checkboxCANCEL type='buttom' value='Cancela' />",
  1526 + novoel = document.createElement("div");
1517 novoel.id = "janela_editor"; 1527 novoel.id = "janela_editor";
1518 - var ins = '<div class="hd">'+titulo+'</div>';  
1519 - ins += "<div class='bd' style='height:"+h+";overflow:auto'>";  
1520 - ins += "<div id='okcancel_checkbox'></div>";  
1521 - ins += "<div id='editor_bd'></div>"; 1528 + ins = '<div class="hd"><div id="okcancel_checkbox" ></div></div>' +
  1529 + "<div class='bd' style='height:"+h+";overflow:auto'>" +
  1530 + "<div id='editor_bd'></div>";
1522 novoel.innerHTML = ins; 1531 novoel.innerHTML = ins;
1523 document.body.appendChild(novoel); 1532 document.body.appendChild(novoel);
1524 if(funcaoOK != "") 1533 if(funcaoOK != "")
1525 { 1534 {
1526 - var lb = $i("okcancel_checkbox");  
1527 - lb.innerHTML = "<input id=okcancel_checkboxOK type='buttom' value='Salva' /><input id=okcancel_checkboxCANCEL type='buttom' value='Cancela' />";  
1528 - new YAHOO.widget.Button(  
1529 - "okcancel_checkboxOK",  
1530 - {onclick:{fn: function(){  
1531 - eval(funcaoOK);  
1532 - }}}  
1533 - );  
1534 - new YAHOO.widget.Button(  
1535 - "okcancel_checkboxCANCEL",  
1536 - {onclick:{fn: function(){  
1537 - YAHOO.admin.container.panelEditor.destroy();  
1538 - YAHOO.admin.container.panelEditor = null;  
1539 - }}}  
1540 - ); 1535 + lb = $i("okcancel_checkbox");
  1536 + if(bsalva === true){
  1537 + temp += salvai;
  1538 + }
  1539 + if(bcancela === true){
  1540 + temp += cancelai;
  1541 + }
  1542 + lb.innerHTML = temp + '<span style="margin-left:10px;position:relative;top:-10px;">'+titulo+'</span>';
  1543 + if(bsalva === true){
  1544 + new YAHOO.widget.Button(
  1545 + "okcancel_checkboxOK",
  1546 + {onclick:{fn: function(){
  1547 + if(YAHOO.lang.isFunction(funcaoOK)){
  1548 + funcaoOK.call();
  1549 + }
  1550 + else{
  1551 + eval(funcaoOK);
  1552 + }
  1553 + }}}
  1554 + );
  1555 + }
  1556 + if(bcancela === true){
  1557 + new YAHOO.widget.Button(
  1558 + "okcancel_checkboxCANCEL",
  1559 + {onclick:{fn: function(){
  1560 + YAHOO.admin.container.panelEditor.destroy();
  1561 + YAHOO.admin.container.panelEditor = null;
  1562 + }}}
  1563 + );
  1564 + }
1541 } 1565 }
1542 YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:"contained",close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } ); 1566 YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:"contained",close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } );
1543 YAHOO.admin.container.panelEditor.render(); 1567 YAHOO.admin.container.panelEditor.render();
@@ -1545,7 +1569,7 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal) @@ -1545,7 +1569,7 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal)
1545 else 1569 else
1546 { 1570 {
1547 if($i("editor_bd")) 1571 if($i("editor_bd"))
1548 - {$i("editor_bd").innerHTML == "";} 1572 + {$i("editor_bd").innerHTML == "?";}
1549 } 1573 }
1550 var fecha = function() 1574 var fecha = function()
1551 { 1575 {
@@ -1555,8 +1579,12 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal) @@ -1555,8 +1579,12 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal)
1555 } 1579 }
1556 catch(e){} 1580 catch(e){}
1557 try{ 1581 try{
1558 - if(funcaoClose != "")  
1559 - {eval(funcaoClose+"()");} 1582 + if(YAHOO.lang.isFunction(funcaoClose)){
  1583 + funcaoClose.call();
  1584 + }
  1585 + else if(funcaoClose != ""){
  1586 + eval(funcaoClose+"()");
  1587 + }
1560 } 1588 }
1561 catch(e){}; 1589 catch(e){};
1562 }; 1590 };
admin/js/editormapfile.js
@@ -180,7 +180,7 @@ function ativaBotaoAdicionaMapfile(idBotao) @@ -180,7 +180,7 @@ function ativaBotaoAdicionaMapfile(idBotao)
180 { 180 {
181 var adiciona = function() 181 var adiciona = function()
182 { 182 {
183 - core_montaEditor("adicionaNovoMapfile()","450px","660px","","","Mapfile"); 183 + core_montaEditor("adicionaNovoMapfile()","450px","660px","","Mapfile",true,true,false);
184 ins = "<p><b>Nome do novo arquivo mapfile (sem .map) </b>n&atilde;o utilize caracteres acentuados ou espa&ccedil;os em branco</p>"; 184 ins = "<p><b>Nome do novo arquivo mapfile (sem .map) </b>n&atilde;o utilize caracteres acentuados ou espa&ccedil;os em branco</p>";
185 ins += "<input size=50 type=text id='Ecodigo' value='' /></p>"; 185 ins += "<input size=50 type=text id='Ecodigo' value='' /></p>";
186 ins += "<p><b>Esse mapfile baseia-se no sistema de metadados estat&iacute;sticos?</b> Caso escolha sim, a conex&atilde;o com o banco e o sql de acesso aos dados ser&atilde;o constru&iacute;dos de forma din&acirc;mica</p>"; 186 ins += "<p><b>Esse mapfile baseia-se no sistema de metadados estat&iacute;sticos?</b> Caso escolha sim, a conex&atilde;o com o banco e o sql de acesso aos dados ser&atilde;o constru&iacute;dos de forma din&acirc;mica</p>";
@@ -767,59 +767,82 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, @@ -767,59 +767,82 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,
767 core_carregando("ativa"); 767 core_carregando("ativa");
768 core_carregando(" gravando o registro do layer= "+codigoLayer); 768 core_carregando(" gravando o registro do layer= "+codigoLayer);
769 var sUrl = prog+par; 769 var sUrl = prog+par;
770 - var callback =  
771 - {  
772 - success:function(o)  
773 - {  
774 - try  
775 - {  
776 - if(YAHOO.lang.JSON.parse(o.responseText) == "erro")  
777 - { 770 + var callback = {
  771 + success:function(o) {
  772 + try{
  773 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
778 core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel salvar.</span>"); 774 core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel salvar.</span>");
779 setTimeout("core_carregando('desativa')",3000); 775 setTimeout("core_carregando('desativa')",3000);
780 } 776 }
781 - else  
782 - { 777 + else{
783 if(testar == false){ 778 if(testar == false){
784 - if(tipo=="conexao")  
785 - {montaEditorDados(YAHOO.lang.JSON.parse(o.responseText));}  
786 - if(tipo=="comport")  
787 - {montaEditorComport(YAHOO.lang.JSON.parse(o.responseText));}  
788 - if(tipo=="dispo")  
789 - {montaEditorDispo(YAHOO.lang.JSON.parse(o.responseText));}  
790 - if(tipo=="editavel")  
791 - {montaEditorEditavel(YAHOO.lang.JSON.parse(o.responseText));} 779 + if(tipo=="conexao"){
  780 + //montaEditorDados(YAHOO.lang.JSON.parse(o.responseText));
  781 + YAHOO.admin.container.panelEditor.destroy();
  782 + YAHOO.admin.container.panelEditor = null;
  783 + }
  784 + if(tipo=="comport"){
  785 + //montaEditorComport(YAHOO.lang.JSON.parse(o.responseText));
  786 + YAHOO.admin.container.panelEditor.destroy();
  787 + YAHOO.admin.container.panelEditor = null;
  788 + }
  789 + if(tipo=="dispo"){
  790 + //montaEditorDispo(YAHOO.lang.JSON.parse(o.responseText));
  791 + YAHOO.admin.container.panelEditor.destroy();
  792 + YAHOO.admin.container.panelEditor = null;
  793 + }
  794 + if(tipo=="editavel"){
  795 + //montaEditorEditavel(YAHOO.lang.JSON.parse(o.responseText));
  796 + YAHOO.admin.container.panelEditor.destroy();
  797 + YAHOO.admin.container.panelEditor = null;
  798 + }
792 if(tipo=="titulo"){ 799 if(tipo=="titulo"){
793 //o codigo do layer pode ter sido alterado 800 //o codigo do layer pode ter sido alterado
794 var no = tree.getNodeByProperty("id",codigoMap+"_"+codigoLayer); 801 var no = tree.getNodeByProperty("id",codigoMap+"_"+codigoLayer);
795 tree.removeChildren(no) ; 802 tree.removeChildren(no) ;
796 no.expand(); 803 no.expand();
797 - montaEditorTitulo(YAHOO.lang.JSON.parse(o.responseText)); 804 + //montaEditorTitulo(YAHOO.lang.JSON.parse(o.responseText));
  805 + YAHOO.admin.container.panelEditor.destroy();
  806 + YAHOO.admin.container.panelEditor = null;
  807 + }
  808 + if(tipo=="metadados"){
  809 + //montaEditorMetadados(YAHOO.lang.JSON.parse(o.responseText));
  810 + YAHOO.admin.container.panelEditor.destroy();
  811 + YAHOO.admin.container.panelEditor = null;
798 } 812 }
799 - if(tipo=="metadados")  
800 - {montaEditorMetadados(YAHOO.lang.JSON.parse(o.responseText));}  
801 - if(tipo=="geral")  
802 - { 813 + if(tipo=="geral"){
803 var d = YAHOO.lang.JSON.parse(o.responseText); 814 var d = YAHOO.lang.JSON.parse(o.responseText);
804 montaEditorGeral(d); 815 montaEditorGeral(d);
805 - if(d.name != codigoLayer)  
806 - { 816 + if(d.name != codigoLayer){
807 core_pegaMapfiles("montaArvore()"); 817 core_pegaMapfiles("montaArvore()");
808 YAHOO.admin.container.panelEditor.destroy(); 818 YAHOO.admin.container.panelEditor.destroy();
809 YAHOO.admin.container.panelEditor = null; 819 YAHOO.admin.container.panelEditor = null;
810 } 820 }
811 } 821 }
812 - if(tipo=="classeGeral")  
813 - {montaEditorClasseGeral(YAHOO.lang.JSON.parse(o.responseText));}  
814 - if(tipo=="classeLabel")  
815 - {montaEditorClasseLabel(YAHOO.lang.JSON.parse(o.responseText));}  
816 - if(tipo=="estilo")  
817 - {montaEditorEstilo(YAHOO.lang.JSON.parse(o.responseText));}  
818 - 822 + if(tipo=="classeGeral"){
  823 + var dados = YAHOO.lang.JSON.parse(o.responseText);
  824 + var no = tree.getNodeByProperty("id",dados.codigoMap+"_"+dados.codigoLayer+"_"+dados.indiceClasse);
  825 + var d = conteudoNoClasse(dados.codigoMap,dados.codigoLayer,dados.indiceClasse,dados.name);
  826 + no.setHtml(d);
  827 + YAHOO.admin.container.panelEditor.destroy();
  828 + YAHOO.admin.container.panelEditor = null;
  829 + }
  830 + if(tipo=="classeLabel"){
  831 + //montaEditorClasseLabel(YAHOO.lang.JSON.parse(o.responseText));
  832 + YAHOO.admin.container.panelEditor.destroy();
  833 + YAHOO.admin.container.panelEditor = null;
  834 + }
  835 + if(tipo=="estilo"){
  836 + //montaEditorEstilo(YAHOO.lang.JSON.parse(o.responseText));
  837 + YAHOO.admin.container.panelEditor.destroy();
  838 + YAHOO.admin.container.panelEditor = null;
  839 + }
819 if(tipo =="grupousr"){ 840 if(tipo =="grupousr"){
820 var no = tree.getNodeByProperty("id",$i("Ecodigo_mapa_usr").value); 841 var no = tree.getNodeByProperty("id",$i("Ecodigo_mapa_usr").value);
821 tree.removeChildren(no) ; 842 tree.removeChildren(no) ;
822 no.expand(); 843 no.expand();
  844 + YAHOO.admin.container.panelEditor.destroy();
  845 + YAHOO.admin.container.panelEditor = null;
823 } 846 }
824 } 847 }
825 else{ 848 else{
admin/js/editormapfile_classes.js
@@ -10,7 +10,6 @@ Abre o editor de dados gerais de uma classe @@ -10,7 +10,6 @@ Abre o editor de dados gerais de uma classe
10 */ 10 */
11 function editorClasseGeral(codigoMap,codigoLayer,indiceClasse) 11 function editorClasseGeral(codigoMap,codigoLayer,indiceClasse)
12 { 12 {
13 - core_montaEditor("","450px","500px","","Classe");  
14 var sUrl = "../php/editormapfile.php?funcao=pegaClasseGeral&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse; 13 var sUrl = "../php/editormapfile.php?funcao=pegaClasseGeral&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse;
15 core_pegaDados("Obtendo dados...",sUrl,"montaEditorClasseGeral"); 14 core_pegaDados("Obtendo dados...",sUrl,"montaEditorClasseGeral");
16 } 15 }
@@ -285,6 +284,11 @@ function excluirClasse(codigoMap,codigoLayer,indiceClasse) @@ -285,6 +284,11 @@ function excluirClasse(codigoMap,codigoLayer,indiceClasse)
285 } 284 }
286 function montaEditorClasseGeral(dados) 285 function montaEditorClasseGeral(dados)
287 { 286 {
  287 + var temp = function(){
  288 + salvarDadosEditor('classeGeral',dados.codigoMap,dados.codigoLayer,dados.indiceClasse);
  289 + };
  290 + core_montaEditor(temp,"450px","500px","","Classe",true,true,false);
  291 +
288 var re = /C_/g; 292 var re = /C_/g;
289 dados.expression = dados.expression.replace(re,"]"); 293 dados.expression = dados.expression.replace(re,"]");
290 re = /_C/g; 294 re = /_C/g;
@@ -309,7 +313,7 @@ function montaEditorClasseGeral(dados) @@ -309,7 +313,7 @@ function montaEditorClasseGeral(dados)
309 titulo:"Minscale",id:"minscale",value:dados.minscale,tipo:"text"} 313 titulo:"Minscale",id:"minscale",value:dados.minscale,tipo:"text"}
310 ] 314 ]
311 }; 315 };
312 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 316 + var ins = "";
313 if(dados.colunas != "") 317 if(dados.colunas != "")
314 { 318 {
315 ins += "<p>O layer possu&iacute; as seguintes colunas na tabela de atributos: "; 319 ins += "<p>O layer possu&iacute; as seguintes colunas na tabela de atributos: ";
@@ -323,9 +327,5 @@ function montaEditorClasseGeral(dados) @@ -323,9 +327,5 @@ function montaEditorClasseGeral(dados)
323 temp += core_comboObjeto(objstatus,"valor","texto",dados.status); 327 temp += core_comboObjeto(objstatus,"valor","texto",dados.status);
324 temp += "</select>"; 328 temp += "</select>";
325 $i("cStatus").innerHTML = temp; 329 $i("cStatus").innerHTML = temp;
326 -  
327 - var temp = function()  
328 - {salvarDadosEditor('classeGeral',dados.codigoMap,dados.codigoLayer,dados.indiceClasse);};  
329 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
330 } 330 }
331 331
admin/js/editormapfile_comport.js
@@ -11,12 +11,15 @@ Abre o editor das op&amp;ccedil;&amp;otilde;es que controlam o comportamento do layer no @@ -11,12 +11,15 @@ Abre o editor das op&amp;ccedil;&amp;otilde;es que controlam o comportamento do layer no
11 */ 11 */
12 function editorComport(codigoMap,codigoLayer) 12 function editorComport(codigoMap,codigoLayer)
13 { 13 {
14 - core_montaEditor("","450px","650px","","Comportamento");  
15 var sUrl = "../php/editormapfile.php?funcao=pegaComport&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; 14 var sUrl = "../php/editormapfile.php?funcao=pegaComport&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer;
16 core_pegaDados("Obtendo dados...",sUrl,"montaEditorComport"); 15 core_pegaDados("Obtendo dados...",sUrl,"montaEditorComport");
17 } 16 }
18 function montaEditorComport(dados) 17 function montaEditorComport(dados)
19 { 18 {
  19 + var temp = function(){
  20 + salvarDadosEditor('comport',dados.codigoMap,dados.codigoLayer,false);
  21 + };
  22 + core_montaEditor(temp,"450px","650px","","Comportamento",true,true,false);
20 var param = { 23 var param = {
21 "linhas":[ 24 "linhas":[
22 {ajuda:"Define o estado atual da camada. Geralmente modificado pelo pr&oacute;prio MapServer. Default ativa a camada permanentemente.", 25 {ajuda:"Define o estado atual da camada. Geralmente modificado pelo pr&oacute;prio MapServer. Default ativa a camada permanentemente.",
@@ -61,7 +64,7 @@ function montaEditorComport(dados) @@ -61,7 +64,7 @@ function montaEditorComport(dados)
61 titulo:"Sizeunits",id:"",value:dados.sizeunits,tipo:"text",div:"<div id=cSizeunits ></div>"} 64 titulo:"Sizeunits",id:"",value:dados.sizeunits,tipo:"text",div:"<div id=cSizeunits ></div>"}
62 ] 65 ]
63 }; 66 };
64 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 67 + var ins = "";
65 ins += core_geraLinhas(param); 68 ins += core_geraLinhas(param);
66 ins += "<br><br><br>"; 69 ins += "<br><br><br>";
67 $i("editor_bd").innerHTML = ins; 70 $i("editor_bd").innerHTML = ins;
@@ -115,9 +118,5 @@ function montaEditorComport(dados) @@ -115,9 +118,5 @@ function montaEditorComport(dados)
115 temp += core_comboObjeto(objmapunits,"valor","texto",dados.toleranceunits); 118 temp += core_comboObjeto(objmapunits,"valor","texto",dados.toleranceunits);
116 temp += "</select>"; 119 temp += "</select>";
117 $i("cToleranceunits").innerHTML = temp; 120 $i("cToleranceunits").innerHTML = temp;
118 -  
119 - var temp = function()  
120 - {salvarDadosEditor('comport',dados.codigoMap,dados.codigoLayer,false);};  
121 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
122 } 121 }
123 122
admin/js/editormapfile_conexao.js
@@ -11,13 +11,17 @@ Abre o editor de conex&amp;atilde;o com a fonte dos dados de um layer @@ -11,13 +11,17 @@ Abre o editor de conex&amp;atilde;o com a fonte dos dados de um layer
11 */ 11 */
12 function editorDados(codigoMap,codigoLayer) 12 function editorDados(codigoMap,codigoLayer)
13 { 13 {
14 - core_montaEditor("","500px","650px","","Conex&atilde;o");  
15 var sUrl = "../php/editormapfile.php?funcao=pegaConexao&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; 14 var sUrl = "../php/editormapfile.php?funcao=pegaConexao&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer;
16 core_pegaDados("Obtendo dados...",sUrl,"montaEditorDados"); 15 core_pegaDados("Obtendo dados...",sUrl,"montaEditorDados");
17 } 16 }
18 17
19 function montaEditorDados(dados) 18 function montaEditorDados(dados)
20 { 19 {
  20 + var temp = function(){
  21 + salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,false);
  22 + };
  23 + core_montaEditor(temp,"500px","650px","","Conex&atilde;o",true,true,false);
  24 +
21 var idsForms = ["connection","data","tileitem","tileindex","type","tipooriginal","metaestat_id_medida_variavel"], 25 var idsForms = ["connection","data","tileitem","tileindex","type","tipooriginal","metaestat_id_medida_variavel"],
22 idsMetaestat = ["connection","data","tileitem","tileindex","tipooriginal"], 26 idsMetaestat = ["connection","data","tileitem","tileindex","tipooriginal"],
23 limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png", 27 limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png",
@@ -55,8 +59,7 @@ function montaEditorDados(dados) @@ -55,8 +59,7 @@ function montaEditorDados(dados)
55 titulo:"Tipo de representa&ccedil;&atilde;o (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"<div id=cTipoOriginal ></div>"} 59 titulo:"Tipo de representa&ccedil;&atilde;o (tipooriginal) - para temas do tipo WMS",id:"",value:dados.tipooriginal,tipo:"text",div:"<div id=cTipoOriginal ></div>"}
56 ] 60 ]
57 }; 61 };
58 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />";  
59 - ins += "&nbsp;<input type=button title='Testar' value='Testar' id=testarEditor />"; 62 + var ins = "";
60 63
61 if(dados.colunas != "" && dados.colunas != undefined){ 64 if(dados.colunas != "" && dados.colunas != undefined){
62 ins += "<p>O layer possui as seguintes colunas na tabela de atributos: "; 65 ins += "<p>O layer possui as seguintes colunas na tabela de atributos: ";
@@ -124,37 +127,29 @@ function montaEditorDados(dados) @@ -124,37 +127,29 @@ function montaEditorDados(dados)
124 $i("cConvcaracter").innerHTML = temp; 127 $i("cConvcaracter").innerHTML = temp;
125 } 128 }
126 129
127 - var temp = function()  
128 - {salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,false);};  
129 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
130 -  
131 - var temp = function()  
132 - {salvarDadosEditor('conexao',dados.codigoMap,dados.codigoLayer,"","",true);};  
133 - new YAHOO.widget.Button("testarEditor",{ onclick: { fn: temp }});  
134 -  
135 $i("connectiontype").onchange = function(){ 130 $i("connectiontype").onchange = function(){
  131 + var dados = [],valor = $i("connectiontype").value;
136 core_desativaforms(idsForms); 132 core_desativaforms(idsForms);
137 - var valor = $i("connectiontype").value,  
138 - d;  
139 //["connection","data","tileitem","tileindex"] 133 //["connection","data","tileitem","tileindex"]
140 if(valor == 0 || valor == 10) 134 if(valor == 0 || valor == 10)
141 - {d = [];} 135 + {dados = [];}
142 if(valor == 1 || valor == 12) 136 if(valor == 1 || valor == 12)
143 - {d = ["data","type"];} 137 + {dados = ["data","type"];}
144 if(valor == 2) 138 if(valor == 2)
145 - {d = ["tileitem","tileindex","type"];} 139 + {dados = ["tileitem","tileindex","type"];}
146 if(valor == 3 || valor == 4 || valor == 6 || valor == 8 || valor == 13) 140 if(valor == 3 || valor == 4 || valor == 6 || valor == 8 || valor == 13)
147 - {d = idsForms;} 141 + {dados = idsForms;}
148 if(valor == 5) 142 if(valor == 5)
149 - {d = ["connection","tileitem","tileindex","type"];} 143 + {dados = ["connection","tileitem","tileindex","type"];}
150 if(valor == 7 || valor == 9) 144 if(valor == 7 || valor == 9)
151 - {d = ["connection","type","tipooriginal"];}  
152 - core_ativaforms(d); 145 + {dados = ["connection","type","tipooriginal"];}
  146 +
  147 + core_ativaforms(dados);
153 }; 148 };
154 $i("metaestat").onchange = function(){ 149 $i("metaestat").onchange = function(){
155 core_desativaforms(idsMetaestat); 150 core_desativaforms(idsMetaestat);
156 var valor = $i("metaestat").value, 151 var valor = $i("metaestat").value,
157 - d; 152 + d = [];
158 if(valor === "SIM"){ 153 if(valor === "SIM"){
159 d = ["metaestat_id_medida_variavel"]; 154 d = ["metaestat_id_medida_variavel"];
160 } 155 }
admin/js/editormapfile_dispo.js
@@ -7,12 +7,15 @@ Abre o editor que define a disponibilidade dos dados @@ -7,12 +7,15 @@ Abre o editor que define a disponibilidade dos dados
7 */ 7 */
8 function editorDispo(codigoMap,codigoLayer) 8 function editorDispo(codigoMap,codigoLayer)
9 { 9 {
10 - core_montaEditor("","450px","650px","","Disponibilidade");  
11 var sUrl = "../php/editormapfile.php?funcao=pegaDispo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; 10 var sUrl = "../php/editormapfile.php?funcao=pegaDispo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer;
12 core_pegaDados("Obtendo dados...",sUrl,"montaEditorDispo"); 11 core_pegaDados("Obtendo dados...",sUrl,"montaEditorDispo");
13 } 12 }
14 function montaEditorDispo(dados) 13 function montaEditorDispo(dados)
15 { 14 {
  15 + var temp = function(){
  16 + salvarDadosEditor('dispo',dados.codigoMap,dados.codigoLayer,false);
  17 + };
  18 + core_montaEditor(temp,"450px","650px","","Disponibilidade",true,true,false);
16 var param = { 19 var param = {
17 "linhas":[ 20 "linhas":[
18 {ajuda:"Indica se o usu&aacute;rio pode fazer download do tema. Se sim, o &iacute;cone de download ser&aacute; mostrado na &aacute;rvore de camadas dispon&iacute;veis no mapa.", 21 {ajuda:"Indica se o usu&aacute;rio pode fazer download do tema. Se sim, o &iacute;cone de download ser&aacute; mostrado na &aacute;rvore de camadas dispon&iacute;veis no mapa.",
@@ -23,7 +26,7 @@ function montaEditorDispo(dados) @@ -23,7 +26,7 @@ function montaEditorDispo(dados)
23 titulo:"Arquivo KML ou KMZ (ARQUIVOKMZ)",id:"arquivokmz",value:dados.arquivokmz,tipo:"text"} 26 titulo:"Arquivo KML ou KMZ (ARQUIVOKMZ)",id:"arquivokmz",value:dados.arquivokmz,tipo:"text"}
24 ] 27 ]
25 }; 28 };
26 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 29 + var ins = "";
27 ins += core_geraLinhas(param); 30 ins += core_geraLinhas(param);
28 ins += "<br><br><br>"; 31 ins += "<br><br><br>";
29 $i("editor_bd").innerHTML = ins; 32 $i("editor_bd").innerHTML = ins;
@@ -33,7 +36,4 @@ function montaEditorDispo(dados) @@ -33,7 +36,4 @@ function montaEditorDispo(dados)
33 temp += "</select>"; 36 temp += "</select>";
34 $i("cDownload").innerHTML = temp; 37 $i("cDownload").innerHTML = temp;
35 } 38 }
36 - var temp = function()  
37 - {salvarDadosEditor('dispo',dados.codigoMap,dados.codigoLayer,false);};  
38 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
39 } 39 }
admin/js/editormapfile_editavel.js
@@ -7,12 +7,16 @@ Abre o editor que define se o tema e editavel ou nao @@ -7,12 +7,16 @@ Abre o editor que define se o tema e editavel ou nao
7 */ 7 */
8 function editorEditavel(codigoMap,codigoLayer) 8 function editorEditavel(codigoMap,codigoLayer)
9 { 9 {
10 - core_montaEditor("","450px","450px","","Edi&ccedil;&atilde;o");  
11 var sUrl = "../php/editormapfile.php?funcao=pegaEditavel&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; 10 var sUrl = "../php/editormapfile.php?funcao=pegaEditavel&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer;
12 core_pegaDados("Obtendo dados...",sUrl,"montaEditorEditavel"); 11 core_pegaDados("Obtendo dados...",sUrl,"montaEditorEditavel");
13 } 12 }
14 function montaEditorEditavel(dados) 13 function montaEditorEditavel(dados)
15 { 14 {
  15 + var temp = function(){
  16 + salvarDadosEditor('editavel',dados.codigoMap,dados.codigoLayer,false);
  17 + };
  18 + core_montaEditor(temp,"450px","450px","","Edi&ccedil;&atilde;o",true,true,false);
  19 +
16 var limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png", 20 var limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png",
17 param = { 21 param = {
18 "linhas":[ 22 "linhas":[
@@ -28,7 +32,7 @@ function montaEditorEditavel(dados) @@ -28,7 +32,7 @@ function montaEditorEditavel(dados)
28 titulo:"Coluna com geometria edit&aacute;vel",id:"",value:"",tipo:"text",div:"<div id=cColunageometriatabelaeditavel ></div>" } 32 titulo:"Coluna com geometria edit&aacute;vel",id:"",value:"",tipo:"text",div:"<div id=cColunageometriatabelaeditavel ></div>" }
29 ] 33 ]
30 }, 34 },
31 - ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 35 + ins = "";
32 ins += "<p>Obs.: Apenas temas baseados em Postgis podem ser editados</p>"; 36 ins += "<p>Obs.: Apenas temas baseados em Postgis podem ser editados</p>";
33 ins += core_geraLinhas(param); 37 ins += core_geraLinhas(param);
34 ins += "<br><br><br>"; 38 ins += "<br><br><br>";
@@ -71,7 +75,4 @@ function montaEditorEditavel(dados) @@ -71,7 +75,4 @@ function montaEditorEditavel(dados)
71 $i("colunageometriatabelaeditavelBusca").onclick = function(){ 75 $i("colunageometriatabelaeditavelBusca").onclick = function(){
72 i3GEO.util.navegadorPostgis($i("colunageometria"),"","coluna"); 76 i3GEO.util.navegadorPostgis($i("colunageometria"),"","coluna");
73 }; 77 };
74 - var temp = function()  
75 - {salvarDadosEditor('editavel',dados.codigoMap,dados.codigoLayer,false);};  
76 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
77 } 78 }
admin/js/editormapfile_estilos.js
@@ -12,7 +12,6 @@ Abre o editor de dados gerais de um estilo @@ -12,7 +12,6 @@ Abre o editor de dados gerais de um estilo
12 */ 12 */
13 function editorEstilo(codigoMap,codigoLayer,indiceClasse,indiceEstilo) 13 function editorEstilo(codigoMap,codigoLayer,indiceClasse,indiceEstilo)
14 { 14 {
15 - core_montaEditor("","450px","500px","","Estilo");  
16 var sUrl = "../php/editormapfile.php?funcao=pegaEstilo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse+"&indiceEstilo="+indiceEstilo; 15 var sUrl = "../php/editormapfile.php?funcao=pegaEstilo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse+"&indiceEstilo="+indiceEstilo;
17 core_pegaDados("Obtendo dados...",sUrl,"montaEditorEstilo"); 16 core_pegaDados("Obtendo dados...",sUrl,"montaEditorEstilo");
18 } 17 }
@@ -66,6 +65,11 @@ function excluirEstilo(codigoMap,codigoLayer,indiceClasse,indiceEstilo) @@ -66,6 +65,11 @@ function excluirEstilo(codigoMap,codigoLayer,indiceClasse,indiceEstilo)
66 } 65 }
67 function montaEditorEstilo(dados) 66 function montaEditorEstilo(dados)
68 { 67 {
  68 + var temp = function(){
  69 + salvarDadosEditor('estilo',dados.codigoMap,dados.codigoLayer,dados.indiceClasse,dados.indiceEstilo);
  70 + };
  71 + core_montaEditor(temp,"450px","650px","","Estilo",true,true,false);
  72 +
69 var limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png"; 73 var limg = i3GEO.configura.locaplic+"/imagens/ic_zoom.png";
70 param = { 74 param = {
71 "linhas":[ 75 "linhas":[
@@ -99,7 +103,7 @@ function montaEditorEstilo(dados) @@ -99,7 +103,7 @@ function montaEditorEstilo(dados)
99 titulo:"Angle",id:"angle",value:dados.angle,tipo:"text"} 103 titulo:"Angle",id:"angle",value:dados.angle,tipo:"text"}
100 ] 104 ]
101 }; 105 };
102 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 106 + var ins = "";
103 ins += core_geraLinhas(param); 107 ins += core_geraLinhas(param);
104 ins += "<br><br><br>"; 108 ins += "<br><br><br>";
105 $i("editor_bd").innerHTML = ins; 109 $i("editor_bd").innerHTML = ins;
@@ -109,10 +113,6 @@ function montaEditorEstilo(dados) @@ -109,10 +113,6 @@ function montaEditorEstilo(dados)
109 temp += "<div id='listaSimbolos' style='overflow:auto;width:350px;height:50px;'></div>"; 113 temp += "<div id='listaSimbolos' style='overflow:auto;width:350px;height:50px;'></div>";
110 $i("cSymbolname").innerHTML = temp; 114 $i("cSymbolname").innerHTML = temp;
111 115
112 - var temp = function()  
113 - {salvarDadosEditor('estilo',dados.codigoMap,dados.codigoLayer,dados.indiceClasse,dados.indiceEstilo);};  
114 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
115 -  
116 escolheSimbolo = function(nome){ 116 escolheSimbolo = function(nome){
117 $i("symbolname").value = nome; 117 $i("symbolname").value = nome;
118 }; 118 };
admin/js/editormapfile_label.js
@@ -7,13 +7,16 @@ Abre o editor dos labels de um layer @@ -7,13 +7,16 @@ Abre o editor dos labels de um layer
7 */ 7 */
8 function editorClasseLabel(codigoMap,codigoLayer,indiceClasse) 8 function editorClasseLabel(codigoMap,codigoLayer,indiceClasse)
9 { 9 {
10 - core_montaEditor("","450px","500px","","Label");  
11 var sUrl = "../php/editormapfile.php?funcao=pegaClasseLabel&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse; 10 var sUrl = "../php/editormapfile.php?funcao=pegaClasseLabel&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&indiceClasse="+indiceClasse;
12 core_pegaDados("Obtendo dados...",sUrl,"montaEditorClasseLabel"); 11 core_pegaDados("Obtendo dados...",sUrl,"montaEditorClasseLabel");
13 } 12 }
14 13
15 function montaEditorClasseLabel(dados) 14 function montaEditorClasseLabel(dados)
16 { 15 {
  16 + var temp = function(){
  17 + salvarDadosEditor('classeLabel',dados.codigoMap,dados.codigoLayer,dados.indiceClasse);
  18 + };
  19 + core_montaEditor(temp,"450px","500px","","Label",true,true,false);
17 var param = { 20 var param = {
18 "linhas":[ 21 "linhas":[
19 {ajuda:"Cor com a qual o texto ser&aacute; desenhado. [ATRIBUTO] especifica o nome do item na tabela de atributos para usar como valores de cor. Os colchetes [] s&atilde;o necess&aacute;rios. Por exemplo, se o DBF do seu shapefile tem um campo chamado &#8220;MYCOLOR&#8221; o objeto LABEL deve conter: LABEL &#8594; COLOR [MYCOLOR].", 22 {ajuda:"Cor com a qual o texto ser&aacute; desenhado. [ATRIBUTO] especifica o nome do item na tabela de atributos para usar como valores de cor. Os colchetes [] s&atilde;o necess&aacute;rios. Por exemplo, se o DBF do seu shapefile tem um campo chamado &#8220;MYCOLOR&#8221; o objeto LABEL deve conter: LABEL &#8594; COLOR [MYCOLOR].",
@@ -72,11 +75,11 @@ function montaEditorClasseLabel(dados) @@ -72,11 +75,11 @@ function montaEditorClasseLabel(dados)
72 titulo:"Encoding",id:"encoding",value:dados.encoding,tipo:"text"} 75 titulo:"Encoding",id:"encoding",value:dados.encoding,tipo:"text"}
73 ] 76 ]
74 }; 77 };
75 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 78 + var ins = "";
76 if(dados.colunas != "") 79 if(dados.colunas != "")
77 { 80 {
78 - ins += "<p>O layer possu&iacute; as seguintes colunas na tabela de atributos: ";  
79 - ins += dados.colunas+"</p>"; 81 + //ins += "<p>O layer possu&iacute; as seguintes colunas na tabela de atributos: ";
  82 + //ins += dados.colunas+"</p>";
80 } 83 }
81 ins += core_geraLinhas(param); 84 ins += core_geraLinhas(param);
82 ins += "<br><br><br>"; 85 ins += "<br><br><br>";
@@ -106,8 +109,4 @@ function montaEditorClasseLabel(dados) @@ -106,8 +109,4 @@ function montaEditorClasseLabel(dados)
106 temp += core_comboObjeto(objbool_tf,"valor","texto",dados.autoangle); 109 temp += core_comboObjeto(objbool_tf,"valor","texto",dados.autoangle);
107 temp += "</select>"; 110 temp += "</select>";
108 $i("cAutoangle").innerHTML = temp; 111 $i("cAutoangle").innerHTML = temp;
109 -  
110 - var temp = function()  
111 - {salvarDadosEditor('classeLabel',dados.codigoMap,dados.codigoLayer,dados.indiceClasse);};  
112 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
113 } 112 }
admin/js/editormapfile_layer.js
@@ -101,7 +101,6 @@ function montaParametrosTemas(no,dados,redesenha) @@ -101,7 +101,6 @@ function montaParametrosTemas(no,dados,redesenha)
101 tempNodeR.isLeaf = false; 101 tempNodeR.isLeaf = false;
102 tempNodeR.enableHighlight = false; 102 tempNodeR.enableHighlight = false;
103 103
104 -  
105 conteudo = "<span style='cursor:pointer;' onclick=\"adicionaNovaClasse('"+codigoMap+"','"+codigoLayer+"')\" ><img style='position:relative;top:2px' src=\"../imagens/05.png\" /> Adicionar uma classe</span>"; 104 conteudo = "<span style='cursor:pointer;' onclick=\"adicionaNovaClasse('"+codigoMap+"','"+codigoLayer+"')\" ><img style='position:relative;top:2px' src=\"../imagens/05.png\" /> Adicionar uma classe</span>";
106 d = {html:conteudo}; 105 d = {html:conteudo};
107 tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 106 tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
@@ -159,7 +158,7 @@ function montaParametrosTemas(no,dados,redesenha) @@ -159,7 +158,7 @@ function montaParametrosTemas(no,dados,redesenha)
159 * @param codigoLayer 158 * @param codigoLayer
160 */ 159 */
161 function pegaPluginLayer(plugin,codigoMap,codigoLayer){ 160 function pegaPluginLayer(plugin,codigoMap,codigoLayer){
162 - core_montaEditor("","450px","500px","","Plugin"); 161 + core_montaEditor("","450px","500px","","Plugin",true,false,false);
163 var sUrl = "../php/editormapfile.php?funcao=pegaPlugin&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; 162 var sUrl = "../php/editormapfile.php?funcao=pegaPlugin&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer;
164 var montaEditorPlugin = function(retorno){ 163 var montaEditorPlugin = function(retorno){
165 var ins = "<input type=button title='Salvar' value='Salvar' id=salvarPlugin />" 164 var ins = "<input type=button title='Salvar' value='Salvar' id=salvarPlugin />"
admin/js/editormapfile_metadados.js
@@ -5,14 +5,17 @@ Abre o editor de metadados @@ -5,14 +5,17 @@ Abre o editor de metadados
5 5
6 <PEGAMETADADOS> 6 <PEGAMETADADOS>
7 */ 7 */
8 -function editorMetadados(codigoMap,codigoLayer)  
9 -{  
10 - core_montaEditor("","450px","500px","","Miscel&acirc;nea"); 8 +function editorMetadados(codigoMap,codigoLayer){
  9 + //core_montaEditor("","450px","500px","","Miscel&acirc;nea");
11 var sUrl = "../php/editormapfile.php?funcao=pegaMetadados&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; 10 var sUrl = "../php/editormapfile.php?funcao=pegaMetadados&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer;
12 core_pegaDados("Obtendo dados...",sUrl,"montaEditorMetadados"); 11 core_pegaDados("Obtendo dados...",sUrl,"montaEditorMetadados");
13 } 12 }
14 -function montaEditorMetadados(dados)  
15 -{ 13 +function montaEditorMetadados(dados){
  14 + //core_montaEditor("","450px","500px","","Miscel&acirc;nea");
  15 + var temp = function(){
  16 + salvarDadosEditor('metadados',dados.codigoMap,dados.codigoLayer);
  17 + };
  18 + core_montaEditor(temp,"450px","500px","","Miscel&acirc;nea",true,true,false);
16 var paramRaster = { 19 var paramRaster = {
17 "linhas":[ 20 "linhas":[
18 {ajuda:"A palete &eacute; v&aacute;lida apenas para temas RASTER. Entre com o endere&ccedil;o do arquivo no servidor. Veja exemplo em i3geo/localhost/symbols/testepalete.txt", 21 {ajuda:"A palete &eacute; v&aacute;lida apenas para temas RASTER. Entre com o endere&ccedil;o do arquivo no servidor. Veja exemplo em i3geo/localhost/symbols/testepalete.txt",
@@ -126,7 +129,8 @@ function montaEditorMetadados(dados) @@ -126,7 +129,8 @@ function montaEditorMetadados(dados)
126 titulo:"&Eacute; do tipo TileCache (0 ou 1 indicam n&atilde;o ou sim) - wms_tile",id:"wms_tile",value:dados.wms_tile,tipo:"text"} 129 titulo:"&Eacute; do tipo TileCache (0 ou 1 indicam n&atilde;o ou sim) - wms_tile",id:"wms_tile",value:dados.wms_tile,tipo:"text"}
127 ] 130 ]
128 }; 131 };
129 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 132 + //var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />";
  133 + var ins = "";
130 if(dados.colunas != "") 134 if(dados.colunas != "")
131 { 135 {
132 ins += "<p>O layer possu&iacute; as seguintes colunas na tabela de atributos: <br>"; 136 ins += "<p>O layer possu&iacute; as seguintes colunas na tabela de atributos: <br>";
@@ -156,7 +160,4 @@ function montaEditorMetadados(dados) @@ -156,7 +160,4 @@ function montaEditorMetadados(dados)
156 temp += "</select>"; 160 temp += "</select>";
157 $i("cLtempoconvencode").innerHTML = temp; 161 $i("cLtempoconvencode").innerHTML = temp;
158 } 162 }
159 - var temp = function()  
160 - {salvarDadosEditor('metadados',dados.codigoMap,dados.codigoLayer);};  
161 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
162 } 163 }
admin/js/editormapfile_titulo.js
@@ -8,12 +8,16 @@ Abre o editor de t&amp;iacute;tulo e descri&amp;ccedil;&amp;atilde;o @@ -8,12 +8,16 @@ Abre o editor de t&amp;iacute;tulo e descri&amp;ccedil;&amp;atilde;o
8 */ 8 */
9 function editorTitulo(codigoMap,codigoLayer) 9 function editorTitulo(codigoMap,codigoLayer)
10 { 10 {
11 - core_montaEditor("","450px","650px","","T&iacute;tulo");  
12 var sUrl = "../php/editormapfile.php?funcao=pegaTitulo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; 11 var sUrl = "../php/editormapfile.php?funcao=pegaTitulo&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer;
13 core_pegaDados("Obtendo dados...",sUrl,"montaEditorTitulo"); 12 core_pegaDados("Obtendo dados...",sUrl,"montaEditorTitulo");
14 } 13 }
15 function montaEditorTitulo(dados) 14 function montaEditorTitulo(dados)
16 { 15 {
  16 + var temp = function(){
  17 + salvarDadosEditor('titulo',dados.codigoMap,dados.codigoLayer);
  18 + };
  19 + core_montaEditor(temp,"450px","650px","","T&iacute;tulo",true,true,false);
  20 +
17 var param = { 21 var param = {
18 "linhas":[ 22 "linhas":[
19 {ajuda:"Elemento 'NAME'. N&atilde;o confunda com o nome que aparece no mapa ou na &aacute;rvore de temas. Normalmente o código recebe o mesmo nome do arquivo mapfile, sem a extens&atilde;o '.map'", 23 {ajuda:"Elemento 'NAME'. N&atilde;o confunda com o nome que aparece no mapa ou na &aacute;rvore de temas. Normalmente o código recebe o mesmo nome do arquivo mapfile, sem a extens&atilde;o '.map'",
@@ -32,12 +36,9 @@ function montaEditorTitulo(dados) @@ -32,12 +36,9 @@ function montaEditorTitulo(dados)
32 titulo:"Mensagem (MENSAGEM)",id:"mensagem",value:dados.mensagem,tipo:"text"} 36 titulo:"Mensagem (MENSAGEM)",id:"mensagem",value:dados.mensagem,tipo:"text"}
33 ] 37 ]
34 }; 38 };
35 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 39 + var ins = "";
36 ins += core_geraLinhas(param); 40 ins += core_geraLinhas(param);
37 ins += "<br><br><br>"; 41 ins += "<br><br><br>";
38 $i("editor_bd").innerHTML = ins; 42 $i("editor_bd").innerHTML = ins;
39 43
40 - var temp = function()  
41 - {salvarDadosEditor('titulo',dados.codigoMap,dados.codigoLayer);};  
42 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: temp }});  
43 } 44 }
admin/js/editormapfile_usuario.js
@@ -37,18 +37,19 @@ function excluirGrupoUsrTema(id_tema,id_grupo,codigo_mapa){ @@ -37,18 +37,19 @@ function excluirGrupoUsrTema(id_tema,id_grupo,codigo_mapa){
37 } 37 }
38 function editorGrupousr(id_tema,codigo_mapa) 38 function editorGrupousr(id_tema,codigo_mapa)
39 { 39 {
40 - core_montaEditor("","350px","200px","","Grupo usuario"); 40 + var temp = function(){
  41 + salvarDadosEditor('grupousr');
  42 + };
  43 + core_montaEditor(temp,"350px","200px","","Grupo usuario",true,true,false);
41 $i("editor_bd").innerHTML = "<input type=hidden value='"+codigo_mapa+"' id='Ecodigo_mapa_usr'/><input type=hidden value='"+id_tema+"' id='Eid_tema_usr'/>"; 44 $i("editor_bd").innerHTML = "<input type=hidden value='"+codigo_mapa+"' id='Ecodigo_mapa_usr'/><input type=hidden value='"+id_tema+"' id='Eid_tema_usr'/>";
42 var sUrl = "../php/gruposusuarios.php?funcao=pegaGrupos"; 45 var sUrl = "../php/gruposusuarios.php?funcao=pegaGrupos";
43 core_pegaDados("Obtendo dados...",sUrl,"montaEditorGrupousr"); 46 core_pegaDados("Obtendo dados...",sUrl,"montaEditorGrupousr");
44 } 47 }
45 function montaEditorGrupousr(dados){ 48 function montaEditorGrupousr(dados){
46 - var temp = "<input type=button title='Salvar' value='Salvar' id=salvarEditor />"; 49 + var temp = "";
47 temp += "<p>Escolha o grupo de usu&aacute;rios:</p><select id='Eid_grupousr' >"; 50 temp += "<p>Escolha o grupo de usu&aacute;rios:</p><select id='Eid_grupousr' >";
48 temp += core_comboObjeto(dados,"id_grupo","nome"); 51 temp += core_comboObjeto(dados,"id_grupo","nome");
49 temp += "</select>"; 52 temp += "</select>";
50 $i("editor_bd").innerHTML += temp; 53 $i("editor_bd").innerHTML += temp;
51 - var tempf = function()  
52 - {salvarDadosEditor('grupousr');};  
53 - new YAHOO.widget.Button("salvarEditor",{ onclick: { fn: tempf }}); 54 +
54 } 55 }
admin/js/estat_mapa.js
1 YAHOO.namespace("admin.container"); 1 YAHOO.namespace("admin.container");
2 /* 2 /*
3 -Licenca:  
4 -  
5 -GPL2  
6 -  
7 -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet  
8 -  
9 -Direitos Autorais Reservados (c) 2012 Edmar Moretti  
10 -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com  
11 -  
12 -Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo  
13 -e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral  
14 -GNU conforme publicada pela Free Software Foundation;  
15 -  
16 -Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,  
17 -por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita  
18 -de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.  
19 -Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.  
20 -Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do  
21 - GNU junto com este programa; se n&atilde;o, escreva para a  
22 -Free Software Foundation, Inc., no endere&ccedil;o  
23 -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.  
24 -  
25 -*/ 3 + * Licenca:
  4 + *
  5 + * GPL2
  6 + *
  7 + * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
  8 + *
  9 + * Direitos Autorais Reservados (c) 2012 Edmar Moretti Desenvolvedor: Edmar
  10 + * Moretti edmar.moretti@gmail.com
  11 + *
  12 + * Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo
  13 + * e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral
  14 + * GNU conforme publicada pela Free Software Foundation;
  15 + *
  16 + * Este programa &eacute; distribu&iacute;do na expectativa de que seja
  17 + * &uacute;til, por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia
  18 + * impl&iacute;cita de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA
  19 + * FINALIDADE ESPEC&Iacute;FICA. Consulte a Licen&ccedil;a P&uacute;blica Geral
  20 + * do GNU para mais detalhes. Voc&ecirc; deve ter recebido uma c&oacute;pia da
  21 + * Licen&ccedil;a P&uacute;blica Geral do GNU junto com este programa; se
  22 + * n&atilde;o, escreva para a Free Software Foundation, Inc., no endere&ccedil;o
  23 + * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  24 + *
  25 + */
26 /* 26 /*
27 -Function: initMenu  
28 -  
29 -Inicializa o editor de mapas  
30 -*/  
31 -function initMenu()  
32 -{  
33 - ativaBotaoAdiciona("../php/metaestat.php?funcao=alteraMapa","adiciona");  
34 - new YAHOO.widget.Button("upload",{ onclick: { fn: function(){  
35 - core_montaEditor();  
36 - $i("editor_bd").innerHTML = formUploadImagem();  
37 - } } }); 27 + * Function: initMenu
  28 + *
  29 + * Inicializa o editor de mapas
  30 + */
  31 +function initMenu() {
  32 + ativaBotaoAdiciona(
  33 + "../php/metaestat.php?funcao=alteraMapa",
  34 + "adiciona");
  35 + new YAHOO.widget.Button(
  36 + "upload", {
  37 + onclick : {
  38 + fn : function() {
  39 + core_montaEditor();
  40 + $i("editor_bd").innerHTML = formUploadImagem();
  41 + }
  42 + }
  43 + });
38 core_carregando("ativa"); 44 core_carregando("ativa");
39 - core_ativaPainelAjuda("ajuda","botaoAjuda");  
40 - core_pegaDados("buscando mapas...","../php/metaestat.php?funcao=listaMapas","montaArvore"); 45 + core_ativaPainelAjuda(
  46 + "ajuda",
  47 + "botaoAjuda");
  48 + core_pegaDados(
  49 + "buscando mapas...",
  50 + "../php/metaestat.php?funcao=listaMapas",
  51 + "montaArvore");
41 } 52 }
42 -function ativaBotaoAdiciona(sUrl,idBotao)  
43 -{  
44 - var adiciona = function(){ 53 +function ativaBotaoAdiciona(sUrl, idBotao) {
  54 + var adiciona = function() {
45 core_carregando("ativa"); 55 core_carregando("ativa");
46 core_carregando(" adicionando um novo registro"); 56 core_carregando(" adicionando um novo registro");
47 - var callback =  
48 - {  
49 - success:function(o)  
50 - {  
51 - try  
52 - {  
53 - var j = YAHOO.lang.JSON.parse(o.responseText);  
54 - adicionaNosMapa([j],true);  
55 - editar("mapa",j.id_mapa);  
56 - core_carregando("desativa");  
57 - }  
58 - catch(e){core_handleFailure(e,o.responseText);}  
59 - },  
60 - failure:core_handleFailure,  
61 - argument: { foo:"foo", bar:"bar" } 57 + var callback = {
  58 + success : function(o) {
  59 + try {
  60 + var j = YAHOO.lang.JSON.parse(o.responseText);
  61 + adicionaNosMapa(
  62 + [
  63 + j
  64 + ],
  65 + true);
  66 + editar(
  67 + "mapa",
  68 + j.id_mapa);
  69 + core_carregando("desativa");
  70 + } catch (e) {
  71 + core_handleFailure(
  72 + e,
  73 + o.responseText);
  74 + }
  75 + },
  76 + failure : core_handleFailure,
  77 + argument : {
  78 + foo : "foo",
  79 + bar : "bar"
  80 + }
62 }; 81 };
63 - core_makeRequest(sUrl,callback); 82 + core_makeRequest(
  83 + sUrl,
  84 + callback);
64 }; 85 };
65 - new YAHOO.widget.Button(idBotao,{ onclick: { fn: adiciona } }); 86 + new YAHOO.widget.Button(
  87 + idBotao, {
  88 + onclick : {
  89 + fn : adiciona
  90 + }
  91 + });
66 } 92 }
67 -function formUploadImagem(){  
68 - var ins = '' +  
69 - '<form id=uploadimagem target="i3GEOuploadiframe" action="../php/metaestat_mapa_uploadimagem.php" method="post" ENCTYPE="multipart/form-data" >' +  
70 - '<p>Imagem (jpg ou png) se o arquivo j&aacute; existir, ser&aacute; substitu&iacute;do: <br><input type="file" size=22 name="uploadimagem" style="top:0px;left:0px;cursor:pointer;"></p>' +  
71 - '<p><input type="submit" size=12 name="submit">' +  
72 - '<input type="hidden" name="MAX_FILE_SIZE" value="1000000">' +  
73 - '</form>' +  
74 - '<iframe name=i3GEOuploadiframe style="text-align:left;border:1px solid gray;" width="98%" height="160px"></iframe>'; 93 +function formUploadImagem() {
  94 + var ins = ''
  95 + + '<form id=uploadimagem target="i3GEOuploadiframe" action="../php/metaestat_mapa_uploadimagem.php" method="post" ENCTYPE="multipart/form-data" >'
  96 + + '<p>Imagem (jpg ou png) se o arquivo j&aacute; existir, ser&aacute; substitu&iacute;do: <br><input type="file" size=22 name="uploadimagem" style="top:0px;left:0px;cursor:pointer;"></p>'
  97 + + '<p><input type="submit" size=12 name="submit">'
  98 + + '<input type="hidden" name="MAX_FILE_SIZE" value="1000000">'
  99 + + '</form>'
  100 + + '<iframe name=i3GEOuploadiframe style="text-align:left;border:1px solid gray;" width="98%" height="160px"></iframe>';
75 return ins; 101 return ins;
76 } 102 }
77 /* 103 /*
78 -Function: montaArvore  
79 -  
80 -Monta a &aacute;rvore de edi&ccedil;&atilde;o  
81 -  
82 -<PEGAPRANCHAS>  
83 -*/  
84 -function montaArvore(dados)  
85 -{  
86 - YAHOO.example.treeExample = new function()  
87 - { 104 + * Function: montaArvore
  105 + *
  106 + * Monta a &aacute;rvore de edi&ccedil;&atilde;o
  107 + *
  108 + * <PEGAPRANCHAS>
  109 + */
  110 +function montaArvore(dados) {
  111 + YAHOO.example.treeExample = new function() {
88 tree = ""; 112 tree = "";
89 - function changeIconMode(){ 113 + function changeIconMode() {
90 buildTree(); 114 buildTree();
91 } 115 }
92 - function loadNodeData(node, fnLoadComplete){  
93 - var sUrl = "../php/metaestat.php?funcao=listaGruposMapa&id_mapa="+node.data.id_mapa;  
94 - var callback =  
95 - {  
96 - success: function(oResponse)  
97 - { 116 + function loadNodeData(node, fnLoadComplete) {
  117 + var sUrl = "../php/metaestat.php?funcao=listaGruposMapa&id_mapa="
  118 + + node.data.id_mapa;
  119 + var callback = {
  120 + success : function(oResponse) {
98 var dados = YAHOO.lang.JSON.parse(oResponse.responseText); 121 var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
99 - adicionaNosGrupos(node,dados,false); 122 + adicionaNosGrupos(
  123 + node,
  124 + dados,
  125 + false);
100 oResponse.argument.fnLoadComplete(); 126 oResponse.argument.fnLoadComplete();
101 }, 127 },
102 - failure: function(oResponse)  
103 - { 128 + failure : function(oResponse) {
104 oResponse.argument.fnLoadComplete(); 129 oResponse.argument.fnLoadComplete();
105 }, 130 },
106 - argument:  
107 - {  
108 - "node": node,  
109 - "fnLoadComplete": fnLoadComplete 131 + argument : {
  132 + "node" : node,
  133 + "fnLoadComplete" : fnLoadComplete
110 }, 134 },
111 - timeout: 25000 135 + timeout : 25000
112 }; 136 };
113 - YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); 137 + YAHOO.util.Connect.asyncRequest(
  138 + 'GET',
  139 + sUrl,
  140 + callback);
114 } 141 }
115 - function buildTree()  
116 - {  
117 - tree = new YAHOO.widget.TreeView("tabela");  
118 - tree.setDynamicLoad(loadNodeData, 1); 142 + function buildTree() {
  143 + tree = new YAHOO.widget.TreeView(
  144 + "tabela");
  145 + tree.setDynamicLoad(
  146 + loadNodeData,
  147 + 1);
119 var root = tree.getRoot(); 148 var root = tree.getRoot();
120 - var tempNode = new YAHOO.widget.TextNode('', root, false); 149 + var tempNode = new YAHOO.widget.TextNode(
  150 + '', root, false);
121 tempNode.isLeaf = true; 151 tempNode.isLeaf = true;
122 tempNode.enableHighlight = false; 152 tempNode.enableHighlight = false;
123 core_carregando("desativa"); 153 core_carregando("desativa");
@@ -127,453 +157,700 @@ function montaArvore(dados) @@ -127,453 +157,700 @@ function montaArvore(dados)
127 adicionaNosMapa(dados); 157 adicionaNosMapa(dados);
128 tree.draw(); 158 tree.draw();
129 } 159 }
130 -function testarMapfile(codigoMap)  
131 -{  
132 - window.open("../../testamapfile.php?map="+codigoMap+".map"); 160 +function testarMapfile(codigoMap) {
  161 + window.open("../../testamapfile.php?map="
  162 + + codigoMap
  163 + + ".map");
133 } 164 }
134 -function adicionaNosTemas(no,dados,redesenha)  
135 -{  
136 - if(!redesenha)  
137 - {  
138 - var conteudo = "<span onclick=\"adicionarTema('"+no.data.id_mapa_grupo+"')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:0px\" width='10px' heigth='10px' src=\"../imagens/05.png\" /><i>Adicionar novo tema:</i></span>";  
139 - var d = {html:conteudo};  
140 - var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 165 +function adicionaNosTemas(no, dados, redesenha) {
  166 + if (!redesenha) {
  167 + var conteudo = "<span onclick=\"adicionarTema('"
  168 + + no.data.id_mapa_grupo
  169 + + "')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:0px\" width='10px' heigth='10px' src=\"../imagens/05.png\" /><i>Adicionar novo tema:</i></span>";
  170 + var d = {
  171 + html : conteudo
  172 + };
  173 + var tempNode = new YAHOO.widget.HTMLNode(
  174 + d, no, false, true);
141 tempNode.isLeaf = true; 175 tempNode.isLeaf = true;
142 tempNode.enableHighlight = false; 176 tempNode.enableHighlight = false;
143 } 177 }
144 - for (var i=0, j=dados.length; i<j; i++)  
145 - {  
146 - if(dados[i].titulo == "null" || !dados[i].titulo || dados[i].id_mapa_tema == "")  
147 - {dados[i].titulo = "";} 178 + for ( var i = 0, j = dados.length; i < j; i++) {
  179 + if (dados[i].titulo == "null"
  180 + || !dados[i].titulo
  181 + || dados[i].id_mapa_tema == "") {
  182 + dados[i].titulo = "";
  183 + }
148 var conteudo = ""; 184 var conteudo = "";
149 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('tema','"+dados[i].id_mapa_tema+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";  
150 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('tema','"+dados[i].id_mapa_tema+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />";  
151 - if(dados[i].id_mapa_tema != "")  
152 - {conteudo += "&nbsp;<span>"+dados[i].titulo+"</span>";}  
153 - else  
154 - {conteudo += "&nbsp;<span style=color:red >Edite para definir o tema!!!</span>";}  
155 - var d = {html:conteudo,id_mapa_tema:dados[i].id_mapa_tema,tipo:"tema"};  
156 - var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 185 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('tema','"
  186 + + dados[i].id_mapa_tema
  187 + + "')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";
  188 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('tema','"
  189 + + dados[i].id_mapa_tema
  190 + + "')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />";
  191 + if (dados[i].id_mapa_tema != "") {
  192 + conteudo += "&nbsp;<span>"
  193 + + dados[i].titulo
  194 + + "</span>";
  195 + } else {
  196 + conteudo += "&nbsp;<span style=color:red >Edite para definir o tema!!!</span>";
  197 + }
  198 + var d = {
  199 + html : conteudo,
  200 + id_mapa_tema : dados[i].id_mapa_tema,
  201 + tipo : "tema"
  202 + };
  203 + var tempNode = new YAHOO.widget.HTMLNode(
  204 + d, no, false, true);
157 tempNode.isLeaf = true; 205 tempNode.isLeaf = true;
158 tempNode.enableHighlight = false; 206 tempNode.enableHighlight = false;
159 } 207 }
160 - if(redesenha){tree.draw();} 208 + if (redesenha) {
  209 + tree.draw();
  210 + }
161 } 211 }
162 -function adicionaNosGrupos(no,dados,redesenha)  
163 -{  
164 - function temaIconMode()  
165 - { 212 +function adicionaNosGrupos(no, dados, redesenha) {
  213 + function temaIconMode() {
166 var newVal = parseInt(this.value); 214 var newVal = parseInt(this.value);
167 - if (newVal != currentIconMode)  
168 - {currentIconMode = newVal;} 215 + if (newVal != currentIconMode) {
  216 + currentIconMode = newVal;
  217 + }
169 } 218 }
170 - function loadTemasData(node, fnLoadComplete)  
171 - {  
172 - var sUrl = "../php/metaestat.php?funcao=listaTemasMapa&id_mapa_grupo="+node.data.id_mapa_grupo;  
173 - var callback =  
174 - {  
175 - success: function(oResponse)  
176 - { 219 + function loadTemasData(node, fnLoadComplete) {
  220 + var sUrl = "../php/metaestat.php?funcao=listaTemasMapa&id_mapa_grupo="
  221 + + node.data.id_mapa_grupo;
  222 + var callback = {
  223 + success : function(oResponse) {
177 var dados = YAHOO.lang.JSON.parse(oResponse.responseText); 224 var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
178 - adicionaNosTemas(node,dados,false); 225 + adicionaNosTemas(
  226 + node,
  227 + dados,
  228 + false);
179 oResponse.argument.fnLoadComplete(); 229 oResponse.argument.fnLoadComplete();
180 }, 230 },
181 - failure: function(oResponse)  
182 - { 231 + failure : function(oResponse) {
183 oResponse.argument.fnLoadComplete(); 232 oResponse.argument.fnLoadComplete();
184 }, 233 },
185 - argument:  
186 - {  
187 - "node": node,  
188 - "fnLoadComplete": fnLoadComplete 234 + argument : {
  235 + "node" : node,
  236 + "fnLoadComplete" : fnLoadComplete
189 }, 237 },
190 - timeout: 7000 238 + timeout : 7000
191 }; 239 };
192 - YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); 240 + YAHOO.util.Connect.asyncRequest(
  241 + 'GET',
  242 + sUrl,
  243 + callback);
193 } 244 }
194 - if(!redesenha)  
195 - {  
196 - var conteudo = "<span style=\"cursor:pointer;\" onclick=\"adicionarGrupo('"+no.data.id_mapa+"')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i>Adicionar grupo de temas</i></span>";  
197 - var d = {html:conteudo};  
198 - var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 245 + if (!redesenha) {
  246 + var conteudo = "<span style=\"cursor:pointer;\" onclick=\"adicionarGrupo('"
  247 + + no.data.id_mapa
  248 + + "')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i>Adicionar grupo de temas</i></span>";
  249 + var d = {
  250 + html : conteudo
  251 + };
  252 + var tempNode = new YAHOO.widget.HTMLNode(
  253 + d, no, false, true);
199 tempNode.isLeaf = true; 254 tempNode.isLeaf = true;
200 tempNode.enableHighlight = false; 255 tempNode.enableHighlight = false;
201 } 256 }
202 - for (var i=0, j=dados.length; i<j; i++)  
203 - { 257 + for ( var i = 0, j = dados.length; i < j; i++) {
204 var conteudo = ""; 258 var conteudo = "";
205 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('grupo','"+dados[i].id_mapa_grupo+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";  
206 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('grupo','"+dados[i].id_mapa_grupo+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />";  
207 - if(dados[i].titulo != "")  
208 - {conteudo += "&nbsp;<span>"+dados[i].titulo+"</span>";}  
209 - else  
210 - {conteudo += "&nbsp;<span style=color:red >Edite para definir o grupo!!!</span>";}  
211 - var d = {html:conteudo,id_mapa_grupo:dados[i].id_mapa_grupo,tipo:"grupo"};  
212 - var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 259 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('grupo','"
  260 + + dados[i].id_mapa_grupo
  261 + + "')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";
  262 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('grupo','"
  263 + + dados[i].id_mapa_grupo
  264 + + "')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />";
  265 + if (dados[i].titulo != "") {
  266 + conteudo += "&nbsp;<span>"
  267 + + dados[i].titulo
  268 + + "</span>";
  269 + } else {
  270 + conteudo += "&nbsp;<span style=color:red >Edite para definir o grupo!!!</span>";
  271 + }
  272 + var d = {
  273 + html : conteudo,
  274 + id_mapa_grupo : dados[i].id_mapa_grupo,
  275 + tipo : "grupo"
  276 + };
  277 + var tempNode = new YAHOO.widget.HTMLNode(
  278 + d, no, false, true);
213 tempNode.enableHighlight = false; 279 tempNode.enableHighlight = false;
214 - //tempNode.isLeaf = true;  
215 - tempNode.setDynamicLoad(loadTemasData, temaIconMode); 280 + // tempNode.isLeaf = true;
  281 + tempNode.setDynamicLoad(
  282 + loadTemasData,
  283 + temaIconMode);
  284 + }
  285 + if (redesenha) {
  286 + tree.draw();
216 } 287 }
217 - if(redesenha){tree.draw();}  
218 } 288 }
219 -function adicionaNosMapa(dados,redesenha)  
220 -{ 289 +function adicionaNosMapa(dados, redesenha) {
221 var root = tree.getRoot(); 290 var root = tree.getRoot();
222 - for (var i=0, j=dados.length; i<j; i++)  
223 - { 291 + for ( var i = 0, j = dados.length; i < j; i++) {
224 var conteudo = ""; 292 var conteudo = "";
225 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluir('mapa','"+dados[i].id_mapa+"')\" title=excluir src=\"../imagens/01.png\" />";  
226 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editar('mapa','"+dados[i].id_mapa+"')\" title=editar src=\"../imagens/06.png\" /><b>";  
227 - conteudo += "&nbsp;<img style=\"width:25px;position:relative;cursor:pointer;top:2px\" onclick=\"testaMapaTemplate(\'"+dados[i].template+"\',"+dados[i].id_mapa+")\" title=editar src=\"../../imagens/i3geo2.jpg\" /><b>";  
228 - if(dados[i].titulo != "")  
229 - {conteudo += "&nbsp;id "+dados[i].id_mapa+" - <span>"+dados[i].titulo+"</span>";}  
230 - else  
231 - {conteudo += "&nbsp;id "+dados[i].id_mapa+" - <span style=color:red >Edite para definir o Mapa!!!</span>";}  
232 - var d = {html:conteudo,id_mapa:dados[i].id_mapa,tipo:"mapa"};  
233 - var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 293 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluir('mapa','"
  294 + + dados[i].id_mapa
  295 + + "')\" title=excluir src=\"../imagens/01.png\" />";
  296 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editar('mapa','"
  297 + + dados[i].id_mapa
  298 + + "')\" title=editar src=\"../imagens/06.png\" /><b>";
  299 + conteudo += "&nbsp;<img style=\"width:25px;position:relative;cursor:pointer;top:2px\" onclick=\"testaMapaTemplate(\'"
  300 + + dados[i].template
  301 + + "\',"
  302 + + dados[i].id_mapa
  303 + + ")\" title=editar src=\"../../imagens/i3geo2.jpg\" /><b>";
  304 + if (dados[i].titulo != "") {
  305 + conteudo += "&nbsp;id "
  306 + + dados[i].id_mapa
  307 + + " - <span>"
  308 + + dados[i].titulo
  309 + + "</span>";
  310 + } else {
  311 + conteudo += "&nbsp;id "
  312 + + dados[i].id_mapa
  313 + + " - <span style=color:red >Edite para definir o Mapa!!!</span>";
  314 + }
  315 + var d = {
  316 + html : conteudo,
  317 + id_mapa : dados[i].id_mapa,
  318 + tipo : "mapa"
  319 + };
  320 + var tempNode = new YAHOO.widget.HTMLNode(
  321 + d, root, false, true);
234 tempNode.enableHighlight = false; 322 tempNode.enableHighlight = false;
235 } 323 }
236 - if(redesenha){tree.draw();} 324 + if (redesenha) {
  325 + tree.draw();
  326 + }
237 } 327 }
238 -function testaMapaTemplate(template,id_mapa){  
239 - if(template == ""){ 328 +function testaMapaTemplate(template, id_mapa) {
  329 + if (template == "") {
240 alert("Template nao definido"); 330 alert("Template nao definido");
241 return; 331 return;
242 } 332 }
243 - var p = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=listaTemplatesMapa";  
244 - i3GEO.util.ajaxGet(p,function(retorno){  
245 - var url = i3GEO.configura.locaplic+retorno.metaestatTemplates+"/"+template+"?id="+id_mapa;  
246 - window.open(url,"_blank");  
247 - }); 333 + var p = i3GEO.configura.locaplic
  334 + + "/admin/php/metaestat.php?funcao=listaTemplatesMapa";
  335 + i3GEO.util.ajaxGet(
  336 + p,
  337 + function(retorno) {
  338 + var url = i3GEO.configura.locaplic
  339 + + retorno.metaestatTemplates
  340 + + "/"
  341 + + template
  342 + + "?id="
  343 + + id_mapa;
  344 + window.open(
  345 + url,
  346 + "_blank");
  347 + });
248 } 348 }
249 -function editar(tipo,id)  
250 -{ 349 +function editar(tipo, id) {
251 core_carregando("ativa"); 350 core_carregando("ativa");
252 core_carregando(" buscando dados"); 351 core_carregando(" buscando dados");
253 var sUrl = null; 352 var sUrl = null;
254 - var callback =  
255 - {  
256 - success:function(o)  
257 - {  
258 - try  
259 - {  
260 - if(tipo == "mapa")  
261 - { 353 + var callback = {
  354 + success : function(o) {
  355 + try {
  356 + if (tipo == "mapa") {
262 var dados = YAHOO.lang.JSON.parse(o.responseText); 357 var dados = YAHOO.lang.JSON.parse(o.responseText);
263 - core_montaEditor("gravaDados('mapa','"+id+"')"); 358 + core_montaEditor("gravaDados('mapa','"
  359 + + id
  360 + + "')","","","","Mapa",true,true,false);
264 $i("editor_bd").innerHTML = montaDivMapa(dados); 361 $i("editor_bd").innerHTML = montaDivMapa(dados);
265 core_carregando("desativa"); 362 core_carregando("desativa");
266 } 363 }
267 - if(tipo == "grupo")  
268 - { 364 + if (tipo == "grupo") {
269 var dados = YAHOO.lang.JSON.parse(o.responseText); 365 var dados = YAHOO.lang.JSON.parse(o.responseText);
270 - core_montaEditor("gravaDados('grupo','"+id+"')"); 366 + core_montaEditor("gravaDados('grupo','"
  367 + + id
  368 + + "')","","","","Grupo",true,true,false);
271 $i("editor_bd").innerHTML = montaDivGrupo(dados); 369 $i("editor_bd").innerHTML = montaDivGrupo(dados);
272 core_carregando("desativa"); 370 core_carregando("desativa");
273 } 371 }
274 - if(tipo == "tema")  
275 - { 372 + if (tipo == "tema") {
276 var dados = YAHOO.lang.JSON.parse(o.responseText); 373 var dados = YAHOO.lang.JSON.parse(o.responseText);
277 - core_montaEditor("gravaDados('tema','"+id+"')"); 374 + core_montaEditor("gravaDados('tema','"
  375 + + id
  376 + + "')","","","","Tema",true,true,false);
278 montaDivTema(dados); 377 montaDivTema(dados);
279 core_carregando("desativa"); 378 core_carregando("desativa");
280 } 379 }
281 core_carregando("desativa"); 380 core_carregando("desativa");
  381 + } catch (e) {
  382 + core_handleFailure(
  383 + e,
  384 + o.responseText);
282 } 385 }
283 - catch(e){core_handleFailure(e,o.responseText);}  
284 }, 386 },
285 - failure:core_handleFailure,  
286 - argument: { foo:"foo", bar:"bar" } 387 + failure : core_handleFailure,
  388 + argument : {
  389 + foo : "foo",
  390 + bar : "bar"
  391 + }
287 }; 392 };
288 - if(tipo == "mapa")  
289 - {sUrl = "../php/metaestat.php?funcao=listaMapas&id_mapa="+id;}  
290 - if(tipo == "grupo")  
291 - {sUrl = "../php/metaestat.php?funcao=listaGruposMapa&id_mapa_grupo="+id;}  
292 - if(tipo == "tema")  
293 - {sUrl = "../php/metaestat.php?funcao=listaTemasMapa&id_mapa_tema="+id;}  
294 - if(sUrl)  
295 - {core_makeRequest(sUrl,callback);} 393 + if (tipo == "mapa") {
  394 + sUrl = "../php/metaestat.php?funcao=listaMapas&id_mapa="
  395 + + id;
  396 + }
  397 + if (tipo == "grupo") {
  398 + sUrl = "../php/metaestat.php?funcao=listaGruposMapa&id_mapa_grupo="
  399 + + id;
  400 + }
  401 + if (tipo == "tema") {
  402 + sUrl = "../php/metaestat.php?funcao=listaTemasMapa&id_mapa_tema="
  403 + + id;
  404 + }
  405 + if (sUrl) {
  406 + core_makeRequest(
  407 + sUrl,
  408 + callback);
  409 + }
296 } 410 }
297 -function montaDivTema(i){  
298 - var sUrl = "../php/metaestat.php?funcao=arvoreVar&dadosGerenciais=nao&detalhes=nao",  
299 - ins = "",  
300 - callback = {  
301 - success:function(o){  
302 - o = YAHOO.lang.JSON.parse(o.responseText);  
303 - var n = o.length,  
304 - m,i,j,filhos,a,b;  
305 - //monta os divs onde entrarao as arvores  
306 - for(i=0;i<n;i++){  
307 - ins += "<div id=arvore_"+i+" >"+o[i].titulo+"</div>"; 411 +function montaDivTema(i) {
  412 + var sUrl = "../php/metaestat.php?funcao=arvoreVar&dadosGerenciais=nao&detalhes=nao", ins = "", callback = {
  413 + success : function(o) {
  414 + o = YAHOO.lang.JSON.parse(o.responseText);
  415 + var n = o.length, m, i, j, filhos, a, b;
  416 + // monta os divs onde entrarao as arvores
  417 + for (i = 0; i < n; i++) {
  418 + ins += "<div id=arvore_"
  419 + + i
  420 + + " >"
  421 + + o[i].titulo
  422 + + "</div>";
  423 + }
  424 + $i("editor_bd").innerHTML = ins;
  425 + // monta as arvores
  426 + for (i = 0; i < n; i++) {
  427 + a = [];
  428 + filhos = o[i].filhos;
  429 + m = filhos.length;
  430 + for (j = 0; j < m; j++) {
  431 + b = {};
  432 + b.text = "<b>"
  433 + + (j + 1)
  434 + + "</b>&nbsp;"
  435 + + filhos[j].titulo
  436 + + "<br><br>";
  437 + b.url = 'javascript:$i(\"Etitulo\").value=\"'
  438 + + filhos[j].titulo
  439 + + '\";$i(\"Eid_medida_variavel\").value=\"'
  440 + + filhos[j].id
  441 + + '\"';
  442 + a.push(b);
308 } 443 }
309 - $i("editor_bd").innerHTML = ins;  
310 - //monta as arvores  
311 - for(i=0;i<n;i++){  
312 - a = [];  
313 - filhos = o[i].filhos;  
314 - m = filhos.length;  
315 - for(j=0;j<m;j++){  
316 - b = {};  
317 - b.text = "<b>"+(j+1)+"</b>&nbsp;" + filhos[j].titulo+"<br><br>";  
318 - b.url = 'javascript:$i(\"Etitulo\").value=\"'+filhos[j].titulo+'\";$i(\"Eid_medida_variavel\").value=\"'+filhos[j].id+'\"';  
319 - a.push(b);  
320 - }  
321 - core_arvore(o[i].titulo,"arvore_"+i,{"propriedades":a}); 444 + core_arvore(
  445 + o[i].titulo,
  446 + "arvore_"
  447 + + i,
  448 + {
  449 + "propriedades" : a
  450 + });
322 451
323 - }  
324 - //ins += "<br><div>"+YAHOO.lang.JSON.parse(o.responseText)+"</div>";  
325 - //$i("editor_bd").innerHTML = ins;  
326 - },  
327 - failure: function(){return ins;},  
328 - argument: { foo:"foo", bar:"bar" } 452 + }
  453 + // ins +=
  454 + // "<br><div>"+YAHOO.lang.JSON.parse(o.responseText)+"</div>";
  455 + // $i("editor_bd").innerHTML = ins;
329 }, 456 },
330 - param = {  
331 - "linhas":[  
332 - {titulo:"T&iacute;tulo:",id:"Etitulo",size:"50",value:i.titulo,tipo:"text",div:""},  
333 - {titulo:"ID da medida de uma vari&aacute;vel (clique nos links abaixo para escolher):",id:"Eid_medida_variavel",size:"50",value:i.id_medida_variavel,tipo:"text",div:""}  
334 - ]  
335 - }; 457 + failure : function() {
  458 + return ins;
  459 + },
  460 + argument : {
  461 + foo : "foo",
  462 + bar : "bar"
  463 + }
  464 + }, param = {
  465 + "linhas" : [
  466 + {
  467 + titulo : "T&iacute;tulo:",
  468 + id : "Etitulo",
  469 + size : "50",
  470 + value : i.titulo,
  471 + tipo : "text",
  472 + div : ""
  473 + },
  474 + {
  475 + titulo : "ID da medida de uma vari&aacute;vel (clique nos links abaixo para escolher):",
  476 + id : "Eid_medida_variavel",
  477 + size : "50",
  478 + value : i.id_medida_variavel,
  479 + tipo : "text",
  480 + div : ""
  481 + }
  482 + ]
  483 + };
336 ins += core_geraLinhas(param); 484 ins += core_geraLinhas(param);
337 - core_makeRequest(sUrl,callback); 485 + core_makeRequest(
  486 + sUrl,
  487 + callback);
338 } 488 }
339 -function montaDivGrupo(i)  
340 -{  
341 - var param =  
342 - {  
343 - "linhas":[  
344 - {titulo:"T&iacute;tulo:",id:"Etitulo",size:"50",value:i.titulo,tipo:"text",div:""} 489 +function montaDivGrupo(i) {
  490 + var param = {
  491 + "linhas" : [
  492 + {
  493 + titulo : "T&iacute;tulo:",
  494 + id : "Etitulo",
  495 + size : "50",
  496 + value : i.titulo,
  497 + tipo : "text",
  498 + div : ""
  499 + }
345 ] 500 ]
346 }; 501 };
347 var ins = ""; 502 var ins = "";
348 ins += core_geraLinhas(param); 503 ins += core_geraLinhas(param);
349 - return(ins); 504 + return (ins);
350 } 505 }
351 -function montaDivMapa(i)  
352 -{  
353 - var limg=i3GEO.configura.locaplic+"/imagens/ic_zoom.png",  
354 - param =  
355 - {  
356 - "linhas":[  
357 - {titulo:"T&iacute;tulo:",id:"Etitulo",size:"50",value:i.titulo,tipo:"text",div:""},  
358 - {titulo:"Template (<a href='../php/metaestat_templates.php' target='_blank'>pr&eacute;via</a>) <img onclick='selTemplate(\"Etemplate\")' src='"+limg+"' style='cursor:pointer;position :relative;top:2px'/>:",id:"Etemplate",size:"50",value:i.template,tipo:"text",div:""},  
359 - {titulo:"Logo (esquerdo) <img onclick='selLogo(\"Elogoesquerdo\")' src='"+limg+"' style='cursor:pointer;position :relative;top:2px'/>:",id:"Elogoesquerdo",size:"50",value:i.logoesquerdo,tipo:"text",div:""},  
360 - {titulo:"Logo (direito) <img onclick='selLogo(\"Elogodireito\")' src='"+limg+"' style='cursor:pointer;position :relative;top:2px'/>::",id:"Elogodireito",size:"50",value:i.logodireito,tipo:"text",div:""}  
361 - ]  
362 - },  
363 - ins = ""; 506 +function montaDivMapa(i) {
  507 + var limg = i3GEO.configura.locaplic
  508 + + "/imagens/ic_zoom.png", param = {
  509 + "linhas" : [
  510 + {
  511 + titulo : "T&iacute;tulo:",
  512 + id : "Etitulo",
  513 + size : "50",
  514 + value : i.titulo,
  515 + tipo : "text",
  516 + div : ""
  517 + },
  518 + {
  519 + titulo : "Template (<a href='../php/metaestat_templates.php' target='_blank'>pr&eacute;via</a>) <img onclick='selTemplate(\"Etemplate\")' src='"
  520 + + limg
  521 + + "' style='cursor:pointer;position :relative;top:2px'/>:",
  522 + id : "Etemplate",
  523 + size : "50",
  524 + value : i.template,
  525 + tipo : "text",
  526 + div : ""
  527 + },
  528 + {
  529 + titulo : "Logo (esquerdo) <img onclick='selLogo(\"Elogoesquerdo\")' src='"
  530 + + limg
  531 + + "' style='cursor:pointer;position :relative;top:2px'/>:",
  532 + id : "Elogoesquerdo",
  533 + size : "50",
  534 + value : i.logoesquerdo,
  535 + tipo : "text",
  536 + div : ""
  537 + },
  538 + {
  539 + titulo : "Logo (direito) <img onclick='selLogo(\"Elogodireito\")' src='"
  540 + + limg
  541 + + "' style='cursor:pointer;position :relative;top:2px'/>::",
  542 + id : "Elogodireito",
  543 + size : "50",
  544 + value : i.logodireito,
  545 + tipo : "text",
  546 + div : ""
  547 + }
  548 + ]
  549 + }, ins = "";
364 ins += core_geraLinhas(param); 550 ins += core_geraLinhas(param);
365 ins += "Publicado?<br>"; 551 ins += "Publicado?<br>";
366 ins += "<select id='Epublicado' >"; 552 ins += "<select id='Epublicado' >";
367 ins += core_combosimnao(i.publicado); 553 ins += core_combosimnao(i.publicado);
368 ins += "</select>"; 554 ins += "</select>";
369 - return(ins); 555 + return (ins);
370 } 556 }
371 -function selLogo(id){ 557 +function selLogo(id) {
372 var callback = { 558 var callback = {
373 - success:function(o){  
374 - try {  
375 - var dados = YAHOO.lang.JSON.parse(o.responseText).nomes,  
376 - n = dados.length,  
377 - i,  
378 - valores = [],  
379 - textos = [],  
380 - selecionados = [$i(id).value];  
381 - for(i=0;i<n;i++){ 559 + success : function(o) {
  560 + try {
  561 + var dados = YAHOO.lang.JSON.parse(o.responseText).nomes, n = dados.length, i, valores = [], textos = [], selecionados = [
  562 + $i(id).value
  563 + ];
  564 + for (i = 0; i < n; i++) {
382 valores.push(dados[i]); 565 valores.push(dados[i]);
383 textos.push(dados[i]); 566 textos.push(dados[i]);
384 } 567 }
385 - core_menuCheckBox(valores,textos,selecionados,$i(id),"","","sim"); 568 + core_menuCheckBox(
  569 + valores,
  570 + textos,
  571 + selecionados,
  572 + $i(id),
  573 + "",
  574 + "",
  575 + "sim");
  576 + } catch (e) {
  577 + core_handleFailure(
  578 + e,
  579 + o.responseText);
386 } 580 }
387 - catch(e){core_handleFailure(e,o.responseText);}  
388 }, 581 },
389 - failure:core_handleFailure,  
390 - argument: { foo:"foo", bar:"bar" } 582 + failure : core_handleFailure,
  583 + argument : {
  584 + foo : "foo",
  585 + bar : "bar"
  586 + }
391 }; 587 };
392 - core_makeRequest(i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=listaLogosMapa",callback); 588 + core_makeRequest(
  589 + i3GEO.configura.locaplic
  590 + + "/admin/php/metaestat.php?funcao=listaLogosMapa",
  591 + callback);
393 } 592 }
394 -function selTemplate(id){ 593 +function selTemplate(id) {
395 var callback = { 594 var callback = {
396 - success:function(o){  
397 - try {  
398 - var dados = YAHOO.lang.JSON.parse(o.responseText).nomes,  
399 - n = dados.length,  
400 - i,  
401 - valores = [],  
402 - textos = [],  
403 - selecionados = [$i(id).value];  
404 - for(i=0;i<n;i++){  
405 - if(dados[i].split(".")[1] === "php"){ 595 + success : function(o) {
  596 + try {
  597 + var dados = YAHOO.lang.JSON.parse(o.responseText).nomes, n = dados.length, i, valores = [], textos = [], selecionados = [
  598 + $i(id).value
  599 + ];
  600 + for (i = 0; i < n; i++) {
  601 + if (dados[i].split(".")[1] === "php") {
406 valores.push(dados[i]); 602 valores.push(dados[i]);
407 textos.push(dados[i]); 603 textos.push(dados[i]);
408 } 604 }
409 } 605 }
410 - core_menuCheckBox(valores,textos,selecionados,$i(id),"","","sim"); 606 + core_menuCheckBox(
  607 + valores,
  608 + textos,
  609 + selecionados,
  610 + $i(id),
  611 + "",
  612 + "",
  613 + "sim");
  614 + } catch (e) {
  615 + core_handleFailure(
  616 + e,
  617 + o.responseText);
411 } 618 }
412 - catch(e){core_handleFailure(e,o.responseText);}  
413 }, 619 },
414 - failure:core_handleFailure,  
415 - argument: { foo:"foo", bar:"bar" } 620 + failure : core_handleFailure,
  621 + argument : {
  622 + foo : "foo",
  623 + bar : "bar"
  624 + }
416 }; 625 };
417 - core_makeRequest(i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=listaTemplatesMapa",callback); 626 + core_makeRequest(
  627 + i3GEO.configura.locaplic
  628 + + "/admin/php/metaestat.php?funcao=listaTemplatesMapa",
  629 + callback);
418 } 630 }
419 -function excluir(tipo,id)  
420 -{  
421 - var mensagem = " excluindo o registro do id= "+id; 631 +function excluir(tipo, id) {
  632 + var mensagem = " excluindo o registro do id= "
  633 + + id;
422 var no = null; 634 var no = null;
423 var sUrl = null; 635 var sUrl = null;
424 - if(tipo == "mapa")  
425 - {  
426 - no = tree.getNodeByProperty("id_mapa",id);  
427 - sUrl = "../php/metaestat.php?funcao=excluirMapa&id_mapa="+id; 636 + if (tipo == "mapa") {
  637 + no = tree.getNodeByProperty(
  638 + "id_mapa",
  639 + id);
  640 + sUrl = "../php/metaestat.php?funcao=excluirMapa&id_mapa="
  641 + + id;
428 } 642 }
429 - if(tipo == "grupo")  
430 - {  
431 - no = tree.getNodeByProperty("id_mapa_grupo",id);  
432 - sUrl = "../php/metaestat.php?funcao=excluirMapaGrupo&id_mapa_grupo="+id; 643 + if (tipo == "grupo") {
  644 + no = tree.getNodeByProperty(
  645 + "id_mapa_grupo",
  646 + id);
  647 + sUrl = "../php/metaestat.php?funcao=excluirMapaGrupo&id_mapa_grupo="
  648 + + id;
433 } 649 }
434 - if(tipo == "tema")  
435 - {  
436 - no = tree.getNodeByProperty("id_mapa_tema",id);  
437 - sUrl = "../php/metaestat.php?funcao=excluirMapaTema&id_mapa_tema="+id; 650 + if (tipo == "tema") {
  651 + no = tree.getNodeByProperty(
  652 + "id_mapa_tema",
  653 + id);
  654 + sUrl = "../php/metaestat.php?funcao=excluirMapaTema&id_mapa_tema="
  655 + + id;
  656 + }
  657 + if (sUrl) {
  658 + core_excluiNoTree(
  659 + sUrl,
  660 + no,
  661 + mensagem);
438 } 662 }
439 - if(sUrl)  
440 - {core_excluiNoTree(sUrl,no,mensagem);}  
441 } 663 }
442 /* 664 /*
443 -Function: adicionarTema  
444 -  
445 -Adiciona um novo tema  
446 -  
447 -<ALTERARTEMA>  
448 -*/  
449 -function adicionarTema(id)  
450 -{  
451 - var no = tree.getNodeByProperty("id_mapa_grupo",id);  
452 - var sUrl = "../php/metaestat.php?funcao=alteraMapaTema&id_mapa_grupo="+id;  
453 - var callback =  
454 - {  
455 - success: function(oResponse)  
456 - { 665 + * Function: adicionarTema
  666 + *
  667 + * Adiciona um novo tema
  668 + *
  669 + * <ALTERARTEMA>
  670 + */
  671 +function adicionarTema(id) {
  672 + var no = tree.getNodeByProperty(
  673 + "id_mapa_grupo",
  674 + id);
  675 + var sUrl = "../php/metaestat.php?funcao=alteraMapaTema&id_mapa_grupo="
  676 + + id;
  677 + var callback = {
  678 + success : function(oResponse) {
457 var dados = YAHOO.lang.JSON.parse(oResponse.responseText); 679 var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
458 - adicionaNosTemas(no,[dados],true);  
459 - editar('tema',dados.id_mapa_tema); 680 + adicionaNosTemas(
  681 + no,
  682 + [
  683 + dados
  684 + ],
  685 + true);
  686 + editar(
  687 + 'tema',
  688 + dados.id_mapa_tema);
460 }, 689 },
461 - failure:core_handleFailure,  
462 - argument: { foo:"foo", bar:"bar" } 690 + failure : core_handleFailure,
  691 + argument : {
  692 + foo : "foo",
  693 + bar : "bar"
  694 + }
463 }; 695 };
464 - core_makeRequest(sUrl,callback); 696 + core_makeRequest(
  697 + sUrl,
  698 + callback);
465 } 699 }
466 -function adicionarGrupo(id_mapa)  
467 -{  
468 - var no = tree.getNodeByProperty("id_mapa",id_mapa);  
469 - var sUrl = "../php/metaestat.php?funcao=alteraMapaGrupo&id_mapa="+id_mapa;  
470 - var callback =  
471 - {  
472 - success: function(oResponse)  
473 - { 700 +function adicionarGrupo(id_mapa) {
  701 + var no = tree.getNodeByProperty(
  702 + "id_mapa",
  703 + id_mapa);
  704 + var sUrl = "../php/metaestat.php?funcao=alteraMapaGrupo&id_mapa="
  705 + + id_mapa;
  706 + var callback = {
  707 + success : function(oResponse) {
474 var dados = YAHOO.lang.JSON.parse(oResponse.responseText); 708 var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
475 - adicionaNosGrupos(no,[dados],true);  
476 - editar('grupo',dados.id_mapa_grupo); 709 + adicionaNosGrupos(
  710 + no,
  711 + [
  712 + dados
  713 + ],
  714 + true);
  715 + editar(
  716 + 'grupo',
  717 + dados.id_mapa_grupo);
477 }, 718 },
478 - failure:core_handleFailure,  
479 - argument: { foo:"foo", bar:"bar" } 719 + failure : core_handleFailure,
  720 + argument : {
  721 + foo : "foo",
  722 + bar : "bar"
  723 + }
480 }; 724 };
481 - core_makeRequest(sUrl,callback); 725 + core_makeRequest(
  726 + sUrl,
  727 + callback);
482 } 728 }
483 /* 729 /*
484 -Function: gravaDados  
485 -  
486 -Altera dados de um elemento do Mapa  
487 -  
488 -<ALTERARATLAS>  
489 -  
490 -<ALTERARPRANCHA>  
491 -  
492 -<ALTERARTEMA>  
493 -*/  
494 -function gravaDados(tipo,id)  
495 -{ 730 + * Function: gravaDados
  731 + *
  732 + * Altera dados de um elemento do Mapa
  733 + *
  734 + * <ALTERARATLAS>
  735 + *
  736 + * <ALTERARPRANCHA>
  737 + *
  738 + * <ALTERARTEMA>
  739 + */
  740 +function gravaDados(tipo, id) {
496 var campos = null; 741 var campos = null;
497 var par = null; 742 var par = null;
498 var prog = null; 743 var prog = null;
499 - if(tipo == "mapa")  
500 - {  
501 - campos = new Array("titulo","template","logoesquerdo","logodireito","publicado");  
502 - par = "&id_mapa="+id; 744 + if (tipo == "mapa") {
  745 + campos = new Array(
  746 + "titulo", "template", "logoesquerdo", "logodireito", "publicado");
  747 + par = "&id_mapa="
  748 + + id;
503 prog = "../php/metaestat.php?funcao=alteraMapa"; 749 prog = "../php/metaestat.php?funcao=alteraMapa";
504 } 750 }
505 - if(tipo == "grupo")  
506 - {  
507 - campos = new Array("titulo");  
508 - par = "&id_mapa_grupo="+id; 751 + if (tipo == "grupo") {
  752 + campos = new Array(
  753 + "titulo");
  754 + par = "&id_mapa_grupo="
  755 + + id;
509 prog = "../php/metaestat.php?funcao=alteraMapaGrupo"; 756 prog = "../php/metaestat.php?funcao=alteraMapaGrupo";
510 } 757 }
511 - if(tipo == "tema")  
512 - {  
513 - campos = new Array("titulo","id_medida_variavel");  
514 - par = "&id_mapa_tema="+id; 758 + if (tipo == "tema") {
  759 + campos = new Array(
  760 + "titulo", "id_medida_variavel");
  761 + par = "&id_mapa_tema="
  762 + + id;
515 prog = "../php/metaestat.php?funcao=alteraMapaTema"; 763 prog = "../php/metaestat.php?funcao=alteraMapaTema";
516 } 764 }
517 - for (var i=0;i<campos.length;i++)  
518 - {par += "&"+campos[i]+"="+($i("E"+campos[i]).value);} 765 + for ( var i = 0; i < campos.length; i++) {
  766 + par += "&"
  767 + + campos[i]
  768 + + "="
  769 + + ($i("E"
  770 + + campos[i]).value);
  771 + }
519 772
520 - var callback =  
521 - {  
522 - success:function(o)  
523 - {  
524 - try  
525 - {  
526 - if(YAHOO.lang.JSON.parse(o.responseText) == "erro")  
527 - {  
528 - core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem menus vinculados a este tema</span>");  
529 - setTimeout("core_carregando('desativa')",3000); 773 + var callback = {
  774 + success : function(o) {
  775 + try {
  776 + if (YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  777 + core_carregando("<span style=color:red >N&atilde;o foi poss&iacute;vel excluir. Verifique se n&atilde;o existem menus vinculados a este tema</span>");
  778 + setTimeout(
  779 + "core_carregando('desativa')",
  780 + 3000);
  781 + } else {
  782 + if (tipo == "mapa") {
  783 + var no = tree.getNodeByProperty(
  784 + "id_mapa",
  785 + id);
  786 + no.getContentEl().getElementsByTagName(
  787 + "span")[0].innerHTML = document.getElementById("Etitulo").value;
  788 + no.getContentEl().getElementsByTagName(
  789 + "span")[0].style.color = "";
  790 + no.html = no.getContentEl().innerHTML;
  791 + core_pegaDados(
  792 + "buscando mapas...",
  793 + "../php/metaestat.php?funcao=listaMapas",
  794 + "montaArvore");
530 } 795 }
531 - else  
532 - {  
533 - if(tipo == "mapa")  
534 - {  
535 - var no = tree.getNodeByProperty("id_mapa",id);  
536 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo").value;  
537 - no.getContentEl().getElementsByTagName("span")[0].style.color = "";  
538 - no.html = no.getContentEl().innerHTML;  
539 - core_pegaDados("buscando mapas...","../php/metaestat.php?funcao=listaMapas","montaArvore");  
540 - }  
541 - if(tipo == "grupo")  
542 - {  
543 - var no = tree.getNodeByProperty("id_mapa_grupo",id);  
544 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo").value;  
545 - no.getContentEl().getElementsByTagName("span")[0].style.color = "";  
546 - no.html = no.getContentEl().innerHTML;  
547 - }  
548 - if(tipo == "tema")  
549 - {  
550 - var no = tree.getNodeByProperty("id_mapa_tema",id);  
551 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo").value;  
552 - no.getContentEl().getElementsByTagName("span")[0].style.color = "";  
553 - no.html = no.getContentEl().innerHTML;  
554 - }  
555 - core_carregando("desativa"); 796 + if (tipo == "grupo") {
  797 + var no = tree.getNodeByProperty(
  798 + "id_mapa_grupo",
  799 + id);
  800 + no.getContentEl().getElementsByTagName(
  801 + "span")[0].innerHTML = document.getElementById("Etitulo").value;
  802 + no.getContentEl().getElementsByTagName(
  803 + "span")[0].style.color = "";
  804 + no.html = no.getContentEl().innerHTML;
  805 + }
  806 + if (tipo == "tema") {
  807 + var no = tree.getNodeByProperty(
  808 + "id_mapa_tema",
  809 + id);
  810 + no.getContentEl().getElementsByTagName(
  811 + "span")[0].innerHTML = document.getElementById("Etitulo").value;
  812 + no.getContentEl().getElementsByTagName(
  813 + "span")[0].style.color = "";
  814 + no.html = no.getContentEl().innerHTML;
556 } 815 }
  816 + core_carregando("desativa");
  817 + }
557 YAHOO.admin.container.panelEditor.destroy(); 818 YAHOO.admin.container.panelEditor.destroy();
558 YAHOO.admin.container.panelEditor = null; 819 YAHOO.admin.container.panelEditor = null;
559 - }  
560 - catch(e){core_handleFailure(e,o.responseText);}  
561 - },  
562 - failure:core_handleFailure,  
563 - argument: { foo:"foo", bar:"bar" } 820 + } catch (e) {
  821 + core_handleFailure(
  822 + e,
  823 + o.responseText);
  824 + }
  825 + },
  826 + failure : core_handleFailure,
  827 + argument : {
  828 + foo : "foo",
  829 + bar : "bar"
  830 + }
564 }; 831 };
565 - if(prog && par){ 832 + if (prog
  833 + && par) {
566 core_carregando("ativa"); 834 core_carregando("ativa");
567 - core_carregando(" gravando o registro do id= "+id);  
568 - var sUrl = prog+par;  
569 - core_makeRequest(sUrl,callback,'POST'); 835 + core_carregando(" gravando o registro do id= "
  836 + + id);
  837 + var sUrl = prog
  838 + + par;
  839 + core_makeRequest(
  840 + sUrl,
  841 + callback,
  842 + 'POST');
570 } 843 }
571 } 844 }
572 /* 845 /*
573 -Function: abreMapa 846 + Function: abreMapa
574 847
575 -Abre o Mapa para teste  
576 -*/  
577 -function abreMapa(id){  
578 - window.open("../../classesphp/atlas_controle.php?atlasId_="+id+"&funcao=criaMapa","blank"); 848 + Abre o Mapa para teste
  849 + */
  850 +function abreMapa(id) {
  851 + window.open(
  852 + "../../classesphp/atlas_controle.php?atlasId_="
  853 + + id
  854 + + "&funcao=criaMapa",
  855 + "blank");
579 } 856 }
admin/js/estat_variavel.js
@@ -70,7 +70,7 @@ i3GEOadmin.variaveis = { @@ -70,7 +70,7 @@ i3GEOadmin.variaveis = {
70 try { 70 try {
71 core_carregando("desativa"); 71 core_carregando("desativa");
72 var j = YAHOO.lang.JSON.parse(o.responseText); 72 var j = YAHOO.lang.JSON.parse(o.responseText);
73 - core_montaEditor("","650px","500px","","Relat&oacute;rio"); 73 + core_montaEditor("","650px","500px","","Relat&oacute;rio",true,true,false);
74 $i("editor_bd").innerHTML = j; 74 $i("editor_bd").innerHTML = j;
75 } 75 }
76 catch(e){core_handleFailure(e,o.responseText);} 76 catch(e){core_handleFailure(e,o.responseText);}
@@ -440,7 +440,7 @@ i3GEOadmin.variaveis = { @@ -440,7 +440,7 @@ i3GEOadmin.variaveis = {
440 core_makeRequest(p,callback); 440 core_makeRequest(p,callback);
441 }, 441 },
442 classesAuto: function(id_classificacao,id_medida_variavel){ 442 classesAuto: function(id_classificacao,id_medida_variavel){
443 - core_montaEditor("","450px","230px","","Criar classes"); 443 + core_montaEditor("","450px","230px","","Criar classes",false,false,false);
444 var ins = "" + 444 var ins = "" +
445 "<p class='paragrafo' >&nbsp;N&uacute;mero de intervalos de classes: <input type=text value=5 id=i3GEOFmetaestatEditorNumInt size=5 />" + 445 "<p class='paragrafo' >&nbsp;N&uacute;mero de intervalos de classes: <input type=text value=5 id=i3GEOFmetaestatEditorNumInt size=5 />" +
446 "<img src='../imagens/accessories-calculator.png' title='Calcular por Sturges' onclick='i3GEOadmin.variaveis.classificacao.sturges("+id_medida_variavel+",\"i3GEOFmetaestatEditorNumInt\")' style='position:relative;cursor:pointer;top:2px'> </p>" + 446 "<img src='../imagens/accessories-calculator.png' title='Calcular por Sturges' onclick='i3GEOadmin.variaveis.classificacao.sturges("+id_medida_variavel+",\"i3GEOFmetaestatEditorNumInt\")' style='position:relative;cursor:pointer;top:2px'> </p>" +
@@ -917,27 +917,27 @@ i3GEOadmin.variaveis = { @@ -917,27 +917,27 @@ i3GEOadmin.variaveis = {
917 }, 917 },
918 editarMontaFormulario: function(dados,tipo,id){ 918 editarMontaFormulario: function(dados,tipo,id){
919 if(tipo == "variavel"){ 919 if(tipo == "variavel"){
920 - core_montaEditor("i3GEOadmin.variaveis.gravaDados('variavel','"+id+"')","450px","200px","","Editor de vari&aacute;vel",true); 920 + core_montaEditor("i3GEOadmin.variaveis.gravaDados('variavel','"+id+"')","450px","200px","","Editor de vari&aacute;vel",true,true,false);
921 i3GEOadmin.variaveis.montaDivVariavel(dados); 921 i3GEOadmin.variaveis.montaDivVariavel(dados);
922 } 922 }
923 if(tipo == "medidaVariavel"){ 923 if(tipo == "medidaVariavel"){
924 - core_montaEditor("i3GEOadmin.variaveis.gravaDados('medidaVariavel','"+id+"')","450px","200px","","Editor de medidas",true); 924 + core_montaEditor("i3GEOadmin.variaveis.gravaDados('medidaVariavel','"+id+"')","450px","200px","","Editor de medidas",true,true,false);
925 i3GEOadmin.variaveis.medidas.montaDiv(dados); 925 i3GEOadmin.variaveis.medidas.montaDiv(dados);
926 } 926 }
927 if(tipo == "parametroMedida"){ 927 if(tipo == "parametroMedida"){
928 - core_montaEditor("i3GEOadmin.variaveis.gravaDados('parametroMedida','"+id+"')","450px","200px","","Editor de par&acirc;metros",true); 928 + core_montaEditor("i3GEOadmin.variaveis.gravaDados('parametroMedida','"+id+"')","450px","200px","","Editor de par&acirc;metros",true,true,false);
929 i3GEOadmin.variaveis.parametro.montaDiv(dados); 929 i3GEOadmin.variaveis.parametro.montaDiv(dados);
930 } 930 }
931 if(tipo == "classificacaoMedida"){ 931 if(tipo == "classificacaoMedida"){
932 - core_montaEditor("i3GEOadmin.variaveis.gravaDados('classificacaoMedida','"+id+"')","450px","200px","","Editor de classifica&ccedil;&atilde;o",true); 932 + core_montaEditor("i3GEOadmin.variaveis.gravaDados('classificacaoMedida','"+id+"')","450px","200px","","Editor de classifica&ccedil;&atilde;o",true,true,false);
933 i3GEOadmin.variaveis.classificacao.montaDiv(dados); 933 i3GEOadmin.variaveis.classificacao.montaDiv(dados);
934 } 934 }
935 if(tipo == "classeClassificacao"){ 935 if(tipo == "classeClassificacao"){
936 - core_montaEditor("i3GEOadmin.variaveis.gravaDados('classeClassificacao','"+id+"')","450px","200px","","Editor de classe",true); 936 + core_montaEditor("i3GEOadmin.variaveis.gravaDados('classeClassificacao','"+id+"')","450px","200px","","Editor de classe",true,true,false);
937 i3GEOadmin.variaveis.classes.montaDiv(dados); 937 i3GEOadmin.variaveis.classes.montaDiv(dados);
938 } 938 }
939 if(tipo == "linkMedida"){ 939 if(tipo == "linkMedida"){
940 - core_montaEditor("i3GEOadmin.variaveis.gravaDados('linkMedida','"+id+"')","450px","200px","","Editor de links",true); 940 + core_montaEditor("i3GEOadmin.variaveis.gravaDados('linkMedida','"+id+"')","450px","200px","","Editor de links",true,true,false);
941 i3GEOadmin.variaveis.link.montaDiv(dados); 941 i3GEOadmin.variaveis.link.montaDiv(dados);
942 } 942 }
943 }, 943 },
@@ -979,7 +979,7 @@ i3GEOadmin.variaveis = { @@ -979,7 +979,7 @@ i3GEOadmin.variaveis = {
979 sUrl = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=listaLinkMedida&id_link="+id; 979 sUrl = i3GEO.configura.locaplic+"/admin/php/metaestat.php?funcao=listaLinkMedida&id_link="+id;
980 } 980 }
981 if(tipo == "fonteinfo"){ 981 if(tipo == "fonteinfo"){
982 - core_montaEditor("i3GEOadmin.variaveis.gravaDados('fonteinfo','"+id+"')","450px","200px","","Editor de fontes"); 982 + core_montaEditor("i3GEOadmin.variaveis.gravaDados('fonteinfo','"+id+"')","450px","200px","","Editor de fontes",true,true,false);
983 i3GEOadmin.variaveis.fonte.montaDiv(); 983 i3GEOadmin.variaveis.fonte.montaDiv();
984 core_carregando("desativa"); 984 core_carregando("desativa");
985 } 985 }
@@ -1004,7 +1004,7 @@ i3GEOadmin.variaveis = { @@ -1004,7 +1004,7 @@ i3GEOadmin.variaveis = {
1004 if(tipo == "medidaVariavel"){ 1004 if(tipo == "medidaVariavel"){
1005 var ins = "", 1005 var ins = "",
1006 dados = YAHOO.lang.JSON.parse(o.responseText); 1006 dados = YAHOO.lang.JSON.parse(o.responseText);
1007 - core_montaEditor("","480px","300px","","Testes",false); 1007 + core_montaEditor("","480px","300px","","Testes",false,false,false);
1008 ins = "<p><b>Select simples:</b> "+dados.sql; 1008 ins = "<p><b>Select simples:</b> "+dados.sql;
1009 ins += "<p><b>Mapserver:</b> "+dados.sqlmapserver; 1009 ins += "<p><b>Mapserver:</b> "+dados.sqlmapserver;
1010 ins += "<p><b>&Uacute;ltima URL:</b><div id='ultimaUrl'></div> "; 1010 ins += "<p><b>&Uacute;ltima URL:</b><div id='ultimaUrl'></div> ";
admin/js/grupos.js
@@ -173,33 +173,36 @@ i3GEOadmin.grupos = { @@ -173,33 +173,36 @@ i3GEOadmin.grupos = {
173 core_carregando("desativa"); 173 core_carregando("desativa");
174 }, 174 },
175 editor: function(dados,id,recordid){ 175 editor: function(dados,id,recordid){
176 - function on_editorCheckBoxChange(p_oEvent){  
177 - if(p_oEvent.newValue.get("value") == "OK"){  
178 - i3GEOadmin.grupos.salva(id,recordid);  
179 - }  
180 - YAHOO.grupos.panelEditor2.destroy();  
181 - YAHOO.grupos.panelEditor2 = null;  
182 - };  
183 if(!$i("janela_editor2")){ 176 if(!$i("janela_editor2")){
184 var editorBotoes,ins, 177 var editorBotoes,ins,
185 novoel = document.createElement("div"); 178 novoel = document.createElement("div");
186 novoel.id = "janela_editor2"; 179 novoel.id = "janela_editor2";
187 - ins = '<div class="hd">Editor</div>'; 180 + ins = '<div class="hd"><input id=okcancel_checkbox_id2 type="buttom" value="Salva" /><span style="margin-left:10px;position:relative;top:-10px;">Grupo</span></div>';
188 ins += "<div class='bd' style='height:354px;overflow:auto'>"; 181 ins += "<div class='bd' style='height:354px;overflow:auto'>";
189 - ins += "<div id='okcancel_checkbox2'></div><div id='editor_bd2'></div>"; 182 + ins += "<div id='editor_bd2'></div>";
190 ins += "<div id='letras_G'></div>"; 183 ins += "<div id='letras_G'></div>";
191 novoel.innerHTML = ins; 184 novoel.innerHTML = ins;
192 185
193 document.body.appendChild(novoel); 186 document.body.appendChild(novoel);
194 - editorBotoes = new YAHOO.widget.ButtonGroup({id:"okcancel_checkbox_id2", name: "okcancel_checkbox_id2", container: "okcancel_checkbox2" });  
195 - editorBotoes.addButtons([  
196 - { label: "Salva", value: "OK", checked: false},  
197 - { label: "Cancela", value: "CANCEL", checked: false }  
198 - ]);  
199 - editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange);  
200 - YAHOO.grupos.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:false,width:"460px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } ); 187 +
  188 + new YAHOO.widget.Button(
  189 + "okcancel_checkbox_id2",
  190 + {onclick:{fn: function(){
  191 + i3GEOadmin.grupos.salva(id,recordid);
  192 + YAHOO.grupos.panelEditor2.destroy();
  193 + YAHOO.grupos.panelEditor2 = null;
  194 + }}}
  195 + );
  196 +
  197 + YAHOO.grupos.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:true,width:"460px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } );
201 YAHOO.grupos.panelEditor2.render(); 198 YAHOO.grupos.panelEditor2.render();
202 } 199 }
  200 + var fecha = function(){
  201 + YAHOO.grupos.panelEditor2.destroy();
  202 + YAHOO.grupos.panelEditor2 = null;
  203 + };
  204 + YAHOO.util.Event.addListener(YAHOO.grupos.panelEditor2.close, "click", fecha);
  205 +
203 YAHOO.grupos.panelEditor2.show(); 206 YAHOO.grupos.panelEditor2.show();
204 $i("editor_bd2").innerHTML = i3GEOadmin.grupos.formulario(dados[0]); 207 $i("editor_bd2").innerHTML = i3GEOadmin.grupos.formulario(dados[0]);
205 core_carregando("desativa"); 208 core_carregando("desativa");
admin/js/gruposusuarios.js
@@ -172,13 +172,12 @@ function editar(tipo,id){ @@ -172,13 +172,12 @@ function editar(tipo,id){
172 try { 172 try {
173 if(tipo == "grupo") { 173 if(tipo == "grupo") {
174 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 174 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
175 - core_montaEditor("","450px","280px","","Grupo");  
176 montaDivGrupo(dados); 175 montaDivGrupo(dados);
177 core_carregando("desativa"); 176 core_carregando("desativa");
178 } 177 }
179 if(tipo == "usuario") { 178 if(tipo == "usuario") {
180 var dados = YAHOO.lang.JSON.parse(o.responseText); 179 var dados = YAHOO.lang.JSON.parse(o.responseText);
181 - core_montaEditor("gravaDados('usuario','"+id+"')","250px","100px"); 180 + core_montaEditor("gravaDados('usuario','"+id+"')","250px","100px","","Usu&aacute;rio",true,true,false);
182 $i("editor_bd").innerHTML = montaDivUsuario(dados); 181 $i("editor_bd").innerHTML = montaDivUsuario(dados);
183 document.getElementById("Eid_usuario").style.width = "200px"; 182 document.getElementById("Eid_usuario").style.width = "200px";
184 core_carregando("desativa"); 183 core_carregando("desativa");
@@ -198,19 +197,20 @@ function editar(tipo,id){ @@ -198,19 +197,20 @@ function editar(tipo,id){
198 {core_makeRequest(sUrl,callback);} 197 {core_makeRequest(sUrl,callback);}
199 } 198 }
200 function montaDivGrupo(i){ 199 function montaDivGrupo(i){
  200 + var temp = function(){
  201 + gravaDados('grupo',i.id_grupo);
  202 + };
  203 + core_montaEditor(temp,"450px","280px","","Grupo",true,true,false);
201 var param = { 204 var param = {
202 "linhas":[ 205 "linhas":[
203 {titulo:"Nome:",id:"Enome",size:"50",value:i.nome,tipo:"text",div:""}, 206 {titulo:"Nome:",id:"Enome",size:"50",value:i.nome,tipo:"text",div:""},
204 {titulo:"Descri&ccedil;&atilde;o:",id:"Edescricao",size:"50",value:i.descricao,tipo:"text",div:""} 207 {titulo:"Descri&ccedil;&atilde;o:",id:"Edescricao",size:"50",value:i.descricao,tipo:"text",div:""}
205 ] 208 ]
206 }; 209 };
207 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditorGrupo />"; 210 + var ins = "";
208 ins += core_geraLinhas(param); 211 ins += core_geraLinhas(param);
209 ins += "<br><br><br>"; 212 ins += "<br><br><br>";
210 $i("editor_bd").innerHTML = ins; 213 $i("editor_bd").innerHTML = ins;
211 - var temp = function()  
212 - {gravaDados('grupo',i.id_grupo);};  
213 - new YAHOO.widget.Button("salvarEditorGrupo",{ onclick: { fn: temp }});  
214 } 214 }
215 function montaDivUsuario(dados){ 215 function montaDivUsuario(dados){
216 var ins = "<p><select id='Eid_usuario' >"; 216 var ins = "<p><select id='Eid_usuario' >";
admin/js/mapas.js
@@ -138,34 +138,41 @@ i3GEOadmin.mapas = { @@ -138,34 +138,41 @@ i3GEOadmin.mapas = {
138 core_carregando("desativa"); 138 core_carregando("desativa");
139 }, 139 },
140 editor: function(dados,id,recordid){ 140 editor: function(dados,id,recordid){
141 - function on_editorCheckBoxChange(p_oEvent){  
142 - if(p_oEvent.newValue.get("value") == "OK"){  
143 - i3GEOadmin.mapas.salva(id,recordid);  
144 - }  
145 - YAHOO.mapas.panelEditor2.destroy();  
146 - YAHOO.mapas.panelEditor2 = null;  
147 - };  
148 if(!$i("janela_editor2")){ 141 if(!$i("janela_editor2")){
149 var editorBotoes,ins, 142 var editorBotoes,ins,
150 novoel = document.createElement("div"); 143 novoel = document.createElement("div");
151 novoel.id = "janela_editor2"; 144 novoel.id = "janela_editor2";
152 - ins = '<div class="hd">Editor</div>';  
153 - ins += "<div class='bd' style='height:354px;overflow:auto'>";  
154 - ins += "<div id='okcancel_checkbox2'></div><div id='editor_bd2'></div>";  
155 - ins += "<div id='letras_SG'></div>"; 145 + ins = '<div class="hd"><input id=okcancel_checkboxOK type="buttom" value="Salva" />' +
  146 + '<span style="margin-left:10px;position:relative;top:-10px;">Editor</div>' +
  147 + "<div class='bd' style='height:354px;overflow:auto'>" +
  148 + "<div id='okcancel_checkbox2'></div><div id='editor_bd2'></div>" +
  149 + "<div id='letras_SG'></div>";
156 novoel.innerHTML = ins; 150 novoel.innerHTML = ins;
157 151
158 document.body.appendChild(novoel); 152 document.body.appendChild(novoel);
159 - editorBotoes = new YAHOO.widget.ButtonGroup({id:"okcancel_checkbox_id2", name: "okcancel_checkbox_id2", container: "okcancel_checkbox2" });  
160 - editorBotoes.addButtons([  
161 - { label: "Salva", value: "OK", checked: false},  
162 - { label: "Cancela", value: "CANCEL", checked: false }  
163 - ]);  
164 - editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange);  
165 - YAHOO.mapas.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:false,width:"400px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } ); 153 +
  154 + new YAHOO.widget.Button(
  155 + "okcancel_checkboxOK",
  156 + {onclick:{fn: function(){
  157 + i3GEOadmin.mapas.salva(id,recordid);
  158 + YAHOO.mapas.panelEditor2.destroy();
  159 + YAHOO.mapas.panelEditor2 = null;
  160 + }}}
  161 + );
  162 + YAHOO.mapas.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:true,width:"400px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } );
166 YAHOO.mapas.panelEditor2.render(); 163 YAHOO.mapas.panelEditor2.render();
167 } 164 }
  165 +
  166 + var fecha = function(){
  167 + try{
  168 + YAHOO.admin.container.panelEditor.destroy();
  169 + YAHOO.admin.container.panelEditor = null;
  170 + }
  171 + catch(e){}
  172 + };
  173 + YAHOO.util.Event.addListener(YAHOO.mapas.panelEditor2.close, "click", fecha);
168 YAHOO.mapas.panelEditor2.show(); 174 YAHOO.mapas.panelEditor2.show();
  175 +
169 $i("editor_bd2").innerHTML = i3GEOadmin.mapas.formulario(dados[0]); 176 $i("editor_bd2").innerHTML = i3GEOadmin.mapas.formulario(dados[0]);
170 core_comboMapfiles("comboMapfiles","Etemas_mapa","",'registraMapfile(this.value,\"Etemas_mapa\")'); 177 core_comboMapfiles("comboMapfiles","Etemas_mapa","",'registraMapfile(this.value,\"Etemas_mapa\")');
171 core_comboPerfis("comboPerfis","Eperfil_mapa","","registraPerfil(this.value)"); 178 core_comboPerfis("comboPerfis","Eperfil_mapa","","registraPerfil(this.value)");
@@ -174,8 +181,6 @@ i3GEOadmin.mapas = { @@ -174,8 +181,6 @@ i3GEOadmin.mapas = {
174 formulario: function(i){ 181 formulario: function(i){
175 var ins = ""; 182 var ins = "";
176 183
177 - //ins += "<p>Mapfile (c�digo do mapfile que ser&aacute; utilizado para criar a camada no i3geo):"  
178 - //ins += "<div id=comboMapfiles >Buscando...</div>";  
179 ins += "<p>Ordem de apresenta&ccedil;&atilde;o do mapa:<br>"; 184 ins += "<p>Ordem de apresenta&ccedil;&atilde;o do mapa:<br>";
180 ins += "<input size=10 type=text id=Eordem_mapa value='"+i.ordem_mapa+"' /></p>"; 185 ins += "<input size=10 type=text id=Eordem_mapa value='"+i.ordem_mapa+"' /></p>";
181 186
admin/js/menu.js
@@ -150,33 +150,36 @@ i3GEOadmin.menus = { @@ -150,33 +150,36 @@ i3GEOadmin.menus = {
150 core_carregando("desativa"); 150 core_carregando("desativa");
151 }, 151 },
152 editor: function(dados,id,recordid){ 152 editor: function(dados,id,recordid){
153 - function on_editorCheckBoxChange(p_oEvent){  
154 - if(p_oEvent.newValue.get("value") == "OK"){  
155 - i3GEOadmin.menus.salva(id,recordid);  
156 - }  
157 - YAHOO.menus.panelEditor2.destroy();  
158 - YAHOO.menus.panelEditor2 = null;  
159 - };  
160 if(!$i("janela_editor2")){ 153 if(!$i("janela_editor2")){
161 var editorBotoes,ins, 154 var editorBotoes,ins,
162 novoel = document.createElement("div"); 155 novoel = document.createElement("div");
163 novoel.id = "janela_editor2"; 156 novoel.id = "janela_editor2";
164 - ins = '<div class="hd">Editor</div>'; 157 + ins = '<div class="hd"><input id=okcancel_checkbox_id2 type="buttom" value="Salva" /><span style="margin-left:10px;position:relative;top:-10px;">Menu</span></div>';
165 ins += "<div class='bd' style='height:354px;overflow:auto'>"; 158 ins += "<div class='bd' style='height:354px;overflow:auto'>";
166 - ins += "<div id='okcancel_checkbox2'></div><div id='editor_bd2'></div>"; 159 + ins += "<div id='editor_bd2'></div>";
167 ins += "<div id='letras_M'></div>"; 160 ins += "<div id='letras_M'></div>";
168 novoel.innerHTML = ins; 161 novoel.innerHTML = ins;
169 162
170 document.body.appendChild(novoel); 163 document.body.appendChild(novoel);
171 - editorBotoes = new YAHOO.widget.ButtonGroup({id:"okcancel_checkbox_id2", name: "okcancel_checkbox_id2", container: "okcancel_checkbox2" });  
172 - editorBotoes.addButtons([  
173 - { label: "Salva", value: "OK", checked: false},  
174 - { label: "Cancela", value: "CANCEL", checked: false }  
175 - ]);  
176 - editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange);  
177 - YAHOO.menus.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:false,width:"480px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } ); 164 +
  165 + new YAHOO.widget.Button(
  166 + "okcancel_checkbox_id2",
  167 + {onclick:{fn: function(){
  168 + i3GEOadmin.menus.salva(id,recordid);
  169 + YAHOO.menus.panelEditor2.destroy();
  170 + YAHOO.menus.panelEditor2 = null;
  171 + }}}
  172 + );
  173 +
  174 + YAHOO.menus.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:true,width:"480px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } );
178 YAHOO.menus.panelEditor2.render(); 175 YAHOO.menus.panelEditor2.render();
179 } 176 }
  177 + var fecha = function(){
  178 + YAHOO.menus.panelEditor2.destroy();
  179 + YAHOO.menus.panelEditor2 = null;
  180 + };
  181 + YAHOO.util.Event.addListener(YAHOO.menus.panelEditor2.close, "click", fecha);
  182 +
180 YAHOO.menus.panelEditor2.show(); 183 YAHOO.menus.panelEditor2.show();
181 $i("editor_bd2").innerHTML = i3GEOadmin.menus.formulario(dados[0]); 184 $i("editor_bd2").innerHTML = i3GEOadmin.menus.formulario(dados[0]);
182 core_carregando("desativa"); 185 core_carregando("desativa");
admin/js/operacoes.js
@@ -195,14 +195,14 @@ function editar(tipo,id) @@ -195,14 +195,14 @@ function editar(tipo,id)
195 if(tipo == "operacao") 195 if(tipo == "operacao")
196 { 196 {
197 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 197 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
198 - core_montaEditor("gravaDados('operacao','"+id+"')"); 198 + core_montaEditor("gravaDados('operacao','"+id+"')","","","","Opera&ccedil;&atilde;o",true,true,false);
199 $i("editor_bd").innerHTML = montaDivOperacao(dados); 199 $i("editor_bd").innerHTML = montaDivOperacao(dados);
200 core_carregando("desativa"); 200 core_carregando("desativa");
201 } 201 }
202 if(tipo == "papel") 202 if(tipo == "papel")
203 { 203 {
204 var dados = YAHOO.lang.JSON.parse(o.responseText); 204 var dados = YAHOO.lang.JSON.parse(o.responseText);
205 - core_montaEditor("gravaDados('papel','"+id+"')","250px","100px","","Papel"); 205 + core_montaEditor("gravaDados('papel','"+id+"')","250px","100px","","Papel",true,true,false);
206 $i("editor_bd").innerHTML = montaDivPapel(dados); 206 $i("editor_bd").innerHTML = montaDivPapel(dados);
207 document.getElementById("Eid_papel").style.width = "200px"; 207 document.getElementById("Eid_papel").style.width = "200px";
208 core_carregando("desativa"); 208 core_carregando("desativa");
admin/js/sistemas.js
@@ -218,14 +218,14 @@ function editar(tipo,id) @@ -218,14 +218,14 @@ function editar(tipo,id)
218 } 218 }
219 function montaEditorSistemas(dados,id) 219 function montaEditorSistemas(dados,id)
220 { 220 {
221 - core_montaEditor("gravaDadosSistema('"+id+"')"); 221 + core_montaEditor("gravaDadosSistema('"+id+"')","","","","Sistema",true,true,false);
222 $i("editor_bd").innerHTML = montaDivSistemas(dados); 222 $i("editor_bd").innerHTML = montaDivSistemas(dados);
223 core_carregando("desativa"); 223 core_carregando("desativa");
224 core_comboPerfis("comboPerfis","selPerfil","","registraPerfil(this.value,\"Eperfil_sistema\")"); 224 core_comboPerfis("comboPerfis","selPerfil","","registraPerfil(this.value,\"Eperfil_sistema\")");
225 } 225 }
226 function montaEditorFuncoes(dados,id) 226 function montaEditorFuncoes(dados,id)
227 { 227 {
228 - core_montaEditor("gravaDadosFuncao('"+id+"')"); 228 + core_montaEditor("gravaDadosFuncao('"+id+"')","","","","Fun&ccedil;&atilde;o",true,true,false);
229 $i("editor_bd").innerHTML = montaDivFuncoes(dados); 229 $i("editor_bd").innerHTML = montaDivFuncoes(dados);
230 core_carregando("desativa"); 230 core_carregando("desativa");
231 core_comboPerfis("comboPerfis","selPerfil","","registraPerfil(this.value,\"Eperfil_funcao\")"); 231 core_comboPerfis("comboPerfis","selPerfil","","registraPerfil(this.value,\"Eperfil_funcao\")");
admin/js/subgrupos.js
@@ -112,7 +112,7 @@ i3GEOadmin.subgrupos = { @@ -112,7 +112,7 @@ i3GEOadmin.subgrupos = {
112 i3GEOadmin.subgrupos.editor([i3GEOadmin.subgrupos.dados[0]],i3GEOadmin.subgrupos.dados[0].id_subgrupo,rec.getId()); 112 i3GEOadmin.subgrupos.editor([i3GEOadmin.subgrupos.dados[0]],i3GEOadmin.subgrupos.dados[0].id_subgrupo,rec.getId());
113 } 113 }
114 } 114 }
115 - ); 115 + );
116 i3GEOadmin.subgrupos.dataTable.subscribe('cellClickEvent',function(ev){ 116 i3GEOadmin.subgrupos.dataTable.subscribe('cellClickEvent',function(ev){
117 var sUrl, callback,$clicouId, $recordid, 117 var sUrl, callback,$clicouId, $recordid,
118 target = YAHOO.util.Event.getTarget(ev), 118 target = YAHOO.util.Event.getTarget(ev),
@@ -148,33 +148,36 @@ i3GEOadmin.subgrupos = { @@ -148,33 +148,36 @@ i3GEOadmin.subgrupos = {
148 core_carregando("desativa"); 148 core_carregando("desativa");
149 }, 149 },
150 editor: function(dados,id,recordid){ 150 editor: function(dados,id,recordid){
151 - function on_editorCheckBoxChange(p_oEvent){  
152 - if(p_oEvent.newValue.get("value") == "OK"){  
153 - i3GEOadmin.subgrupos.salva(id,recordid);  
154 - }  
155 - YAHOO.subgrupos.panelEditor2.destroy();  
156 - YAHOO.subgrupos.panelEditor2 = null;  
157 - };  
158 if(!$i("janela_editor2")){ 151 if(!$i("janela_editor2")){
159 var editorBotoes,ins, 152 var editorBotoes,ins,
160 novoel = document.createElement("div"); 153 novoel = document.createElement("div");
161 novoel.id = "janela_editor2"; 154 novoel.id = "janela_editor2";
162 - ins = '<div class="hd">Editor</div>'; 155 + ins = '<div class="hd"><input id=okcancel_checkbox_id2 type="buttom" value="Salva" /><span style="margin-left:10px;position:relative;top:-10px;">Subgrupos</span></div>';
163 ins += "<div class='bd' style='height:354px;overflow:auto'>"; 156 ins += "<div class='bd' style='height:354px;overflow:auto'>";
164 - ins += "<div id='okcancel_checkbox2'></div><div id='editor_bd2'></div>"; 157 + ins += "<div id='editor_bd2'></div>";
165 ins += "<div id='letras_SG'></div>"; 158 ins += "<div id='letras_SG'></div>";
166 novoel.innerHTML = ins; 159 novoel.innerHTML = ins;
167 160
168 document.body.appendChild(novoel); 161 document.body.appendChild(novoel);
169 - editorBotoes = new YAHOO.widget.ButtonGroup({id:"okcancel_checkbox_id2", name: "okcancel_checkbox_id2", container: "okcancel_checkbox2" });  
170 - editorBotoes.addButtons([  
171 - { label: "Salva", value: "OK", checked: false},  
172 - { label: "Cancela", value: "CANCEL", checked: false }  
173 - ]);  
174 - editorBotoes.on("checkedButtonChange", on_editorCheckBoxChange);  
175 - YAHOO.subgrupos.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:false,width:"450px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } ); 162 +
  163 + new YAHOO.widget.Button(
  164 + "okcancel_checkbox_id2",
  165 + {onclick:{fn: function(){
  166 + i3GEOadmin.subgrupos.salva(id,recordid);
  167 + YAHOO.subgrupos.panelEditor2.destroy();
  168 + YAHOO.subgrupos.panelEditor2 = null;
  169 + }}}
  170 + );
  171 +
  172 + YAHOO.subgrupos.panelEditor2 = new YAHOO.widget.Panel("janela_editor2", { modal:true,fixedcenter:true,close:true,width:"450px", height:"480px",overflow:"auto", visible:false,constraintoviewport:true } );
176 YAHOO.subgrupos.panelEditor2.render(); 173 YAHOO.subgrupos.panelEditor2.render();
177 } 174 }
  175 + var fecha = function(){
  176 + YAHOO.subgrupos.panelEditor2.destroy();
  177 + YAHOO.subgrupos.panelEditor2 = null;
  178 + };
  179 + YAHOO.util.Event.addListener(YAHOO.subgrupos.panelEditor2.close, "click", fecha);
  180 +
178 YAHOO.subgrupos.panelEditor2.show(); 181 YAHOO.subgrupos.panelEditor2.show();
179 $i("editor_bd2").innerHTML = i3GEOadmin.subgrupos.formulario(dados[0]); 182 $i("editor_bd2").innerHTML = i3GEOadmin.subgrupos.formulario(dados[0]);
180 core_carregando("desativa"); 183 core_carregando("desativa");
admin/js/usuarios.js
@@ -199,14 +199,13 @@ function editar(tipo,id) @@ -199,14 +199,13 @@ function editar(tipo,id)
199 if(tipo == "usuario") 199 if(tipo == "usuario")
200 { 200 {
201 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 201 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
202 - core_montaEditor("","450px","380px","","Usu&aacute;rio");  
203 montaDivUsuario(dados); 202 montaDivUsuario(dados);
204 core_carregando("desativa"); 203 core_carregando("desativa");
205 } 204 }
206 if(tipo == "papel") 205 if(tipo == "papel")
207 { 206 {
208 var dados = YAHOO.lang.JSON.parse(o.responseText); 207 var dados = YAHOO.lang.JSON.parse(o.responseText);
209 - core_montaEditor("gravaDados('papel','"+id+"')","250px","100px"); 208 + core_montaEditor("gravaDados('papel','"+id+"')","250px","100px","","Papel",true,true,false);
210 $i("editor_bd").innerHTML = montaDivPapel(dados); 209 $i("editor_bd").innerHTML = montaDivPapel(dados);
211 document.getElementById("Eid_papel").style.width = "200px"; 210 document.getElementById("Eid_papel").style.width = "200px";
212 core_carregando("desativa"); 211 core_carregando("desativa");
@@ -226,6 +225,10 @@ function editar(tipo,id) @@ -226,6 +225,10 @@ function editar(tipo,id)
226 {core_makeRequest(sUrl,callback);} 225 {core_makeRequest(sUrl,callback);}
227 } 226 }
228 function montaDivUsuario(i){ 227 function montaDivUsuario(i){
  228 + var temp = function(){
  229 + gravaDados('usuario',i.id_usuario);
  230 + };
  231 + core_montaEditor(temp,"450px","380px","","Usu&aacute;rio",true,true,false);
229 var param = { 232 var param = {
230 "linhas":[ 233 "linhas":[
231 {titulo:"Nome:",id:"Enome_usuario",size:"50",value:i.nome_usuario,tipo:"text",div:""}, 234 {titulo:"Nome:",id:"Enome_usuario",size:"50",value:i.nome_usuario,tipo:"text",div:""},
@@ -236,7 +239,7 @@ function montaDivUsuario(i){ @@ -236,7 +239,7 @@ function montaDivUsuario(i){
236 {titulo:"Ativo:",id:"",size:"50",value:i.ativo,tipo:"text",div:"<div id=cAtivo ></div>"} 239 {titulo:"Ativo:",id:"",size:"50",value:i.ativo,tipo:"text",div:"<div id=cAtivo ></div>"}
237 ] 240 ]
238 }; 241 };
239 - var ins = "<input type=button title='Salvar' value='Salvar' id=salvarEditorUsuario />"; 242 + var ins = "";
240 ins += core_geraLinhas(param); 243 ins += core_geraLinhas(param);
241 ins += "<br><br><br>"; 244 ins += "<br><br><br>";
242 $i("editor_bd").innerHTML = ins; 245 $i("editor_bd").innerHTML = ins;
@@ -248,9 +251,6 @@ function montaDivUsuario(i){ @@ -248,9 +251,6 @@ function montaDivUsuario(i){
248 $i("cAtivo").innerHTML = temp; 251 $i("cAtivo").innerHTML = temp;
249 $i("Eativo").value = i.ativo; 252 $i("Eativo").value = i.ativo;
250 } 253 }
251 - var temp = function()  
252 - {gravaDados('usuario',i.id_usuario);};  
253 - new YAHOO.widget.Button("salvarEditorUsuario",{ onclick: { fn: temp }});  
254 } 254 }
255 function montaDivPapel(dados){ 255 function montaDivPapel(dados){
256 var ins = "<p><select id='Eid_papel' >"; 256 var ins = "<p><select id='Eid_papel' >";
temas/_cursoaeroporto.map
@@ -4,9 +4,24 @@ MAP @@ -4,9 +4,24 @@ MAP
4 LAYER 4 LAYER
5 DATA "/var/www/i3geo/aplicmap/dados/sc22/AEROPORTO_CAMPO_DE_POUSO.shp" 5 DATA "/var/www/i3geo/aplicmap/dados/sc22/AEROPORTO_CAMPO_DE_POUSO.shp"
6 METADATA 6 METADATA
  7 + "ltempoitemimagem" ""
  8 + "ltempoitemdescricao" ""
7 "CLASSE" "SIM" 9 "CLASSE" "SIM"
  10 + "ltempoiteminicio" ""
  11 + "palletestep" ""
  12 + "ltempoitemtip" ""
  13 + "ltempoitemtitulo" ""
  14 + "description_template" ""
  15 + "ltempoitemlink" ""
  16 + "palletefile" ""
  17 + "ltempoformatodata" ""
  18 + "ltempoitemicone" ""
8 "PLUGINI3GEO" "" 19 "PLUGINI3GEO" ""
  20 + "itembuscarapida" ""
9 "TEMA" "Aeroportos SC22" 21 "TEMA" "Aeroportos SC22"
  22 + "ltempoconvencode" ""
  23 + "editorsql" ""
  24 + "ltempoitemfim" ""
10 END # METADATA 25 END # METADATA
11 NAME "_cursoaeroporto" 26 NAME "_cursoaeroporto"
12 STATUS OFF 27 STATUS OFF
@@ -25,4 +40,5 @@ MAP @@ -25,4 +40,5 @@ MAP
25 END # CLASS 40 END # CLASS
26 END # LAYER 41 END # LAYER
27 42
28 -END # MAP  
29 \ No newline at end of file 43 \ No newline at end of file
  44 +END # MAP
  45 +
temas/_lbairros.map
@@ -16,6 +16,8 @@ MAP @@ -16,6 +16,8 @@ MAP
16 "palletestep" "" 16 "palletestep" ""
17 "ltempoitemtip" "" 17 "ltempoitemtip" ""
18 "permitekmz" "nao" 18 "permitekmz" "nao"
  19 + "temporizador" ""
  20 + "iconetema" ""
19 "ltempoitemtitulo" "" 21 "ltempoitemtitulo" ""
20 "description_template" "" 22 "description_template" ""
21 "ltempoitemlink" "" 23 "ltempoitemlink" ""
@@ -25,36 +27,44 @@ MAP @@ -25,36 +27,44 @@ MAP
25 "ltempoformatodata" "" 27 "ltempoformatodata" ""
26 "permitedownload" "sim" 28 "permitedownload" "sim"
27 "ltempoitemicone" "" 29 "ltempoitemicone" ""
  30 + "permitecomentario" ""
28 "metaestat" "" 31 "metaestat" ""
29 "ESQUEMATABELAEDITAVEL" "i3geo_metaestat" 32 "ESQUEMATABELAEDITAVEL" "i3geo_metaestat"
  33 + "download" "SIM"
30 "itembuscarapida" "no_bairro" 34 "itembuscarapida" "no_bairro"
  35 + "arquivodownload" ""
  36 + "arquivokmz" ""
31 "permitekml" "sim" 37 "permitekml" "sim"
32 "permiteogc" "sim" 38 "permiteogc" "sim"
33 "convcaracter" "" 39 "convcaracter" ""
34 - "TEMA" "Bairros IBGE" 40 + "TEMA" "Bairros IBGE -"
35 "COLUNAIDUNICO" "gid" 41 "COLUNAIDUNICO" "gid"
36 "COLUNAGEOMETRIA" "the_geom" 42 "COLUNAGEOMETRIA" "the_geom"
  43 + "cortepixels" "0"
37 "ltempoconvencode" "" 44 "ltempoconvencode" ""
38 "editorsql" "" 45 "editorsql" ""
39 "TABELAEDITAVEL" "bairros" 46 "TABELAEDITAVEL" "bairros"
40 "ltempoitemfim" "" 47 "ltempoitemfim" ""
  48 + "legendaimg" ""
41 END # METADATA 49 END # METADATA
42 NAME "_lbairros" 50 NAME "_lbairros"
43 STATUS DEFAULT 51 STATUS DEFAULT
44 TEMPLATE "none.htm" 52 TEMPLATE "none.htm"
45 TILEITEM "location" 53 TILEITEM "location"
  54 + OPACITY 90
46 TYPE POLYGON 55 TYPE POLYGON
47 UNITS METERS 56 UNITS METERS
48 CLASS 57 CLASS
49 NAME "" 58 NAME ""
50 STYLE 59 STYLE
51 - COLOR 255 255 255 60 + COLOR "#ffffff33"
52 OPACITY 20 61 OPACITY 20
53 END # STYLE 62 END # STYLE
54 STYLE 63 STYLE
55 OUTLINECOLOR 255 0 0 64 OUTLINECOLOR 255 0 0
56 SYMBOL "p0" 65 SYMBOL "p0"
57 END # STYLE 66 END # STYLE
  67 + TITLE ""
58 END # CLASS 68 END # CLASS
59 END # LAYER 69 END # LAYER
60 70