Commit 167a053660efb3dca609df38b4749efcfa8f0500

Authored by Edmar Moretti
1 parent 8cc2c5ac

Revisão dos códigos JS para remoção de lixo e aplicação de padrões

admin/js/admin.js
@@ -16,42 +16,40 @@ cPaint.set_async("true"); @@ -16,42 +16,40 @@ cPaint.set_async("true");
16 cPaint.set_response_type("JSON"); 16 cPaint.set_response_type("JSON");
17 function ativaIndice(onde) 17 function ativaIndice(onde)
18 { 18 {
19 - var f = document.getElementsByTagName("fieldset")  
20 - for(t = 0;t < f.length;t++)  
21 - {  
22 - //f[t].innerHTML += "<p><a href='#indice'>índice</a></p>"  
23 - }  
24 - var etrs = document.getElementsByTagName("legend")  
25 - var ins = "<fieldset><legend><a name='indice' ><b>Índice</b></a></legend>" 19 + var f = document.getElementsByTagName("fieldset");
  20 + for(var t = 0;t < f.length;t++)
  21 + {}
  22 + var etrs = document.getElementsByTagName("legend");
  23 + var ins = "<fieldset><legend><a name='indice' ><b>Índice</b></a></legend>";
26 for(t = 0;t < etrs.length;t++) 24 for(t = 0;t < etrs.length;t++)
27 { 25 {
28 - ins += "<a href='#"+etrs[t].innerHTML+"'><p>"+etrs[t].innerHTML+"</p></a>" 26 + ins += "<a href='#"+etrs[t].innerHTML+"'><p>"+etrs[t].innerHTML+"</p></a>";
29 etrs[t].innerHTML = "<a name='"+etrs[t].innerHTML+"'>"+etrs[t].innerHTML+"</a>"; 27 etrs[t].innerHTML = "<a name='"+etrs[t].innerHTML+"'>"+etrs[t].innerHTML+"</a>";
30 28
31 } 29 }
32 - document.getElementById(onde).innerHTML = ins+"</fieldset>" 30 + document.getElementById(onde).innerHTML = ins+"</fieldset>";
33 } 31 }
34 function ativaTR() 32 function ativaTR()
35 { 33 {
36 - var etrs = document.getElementsByTagName("tr")  
37 - for(t = 0;t < etrs.length;t++) 34 + var etrs = document.getElementsByTagName("tr");
  35 + for(var t = 0;t < etrs.length;t++)
38 { 36 {
39 etrs[t].onmouseover = function() 37 etrs[t].onmouseover = function()
40 - {this.style.backgroundColor = "beige"} 38 + {this.style.backgroundColor = "beige";};
41 etrs[t].onmouseout = function() 39 etrs[t].onmouseout = function()
42 - {this.style.backgroundColor = ""} 40 + {this.style.backgroundColor = "";};
43 } 41 }
44 } 42 }
45 function ativaLegenda() 43 function ativaLegenda()
46 { 44 {
47 - var etrs = document.getElementsByTagName("legend")  
48 - for(t = 0;t < etrs.length;t++) 45 + var etrs = document.getElementsByTagName("legend");
  46 + for(var t = 0;t < etrs.length;t++)
49 { 47 {
50 etrs[t].innerHTML = "<img src='../imagens/desce.gif' id='img_"+t+"' >&nbsp;" + etrs[t].innerHTML; 48 etrs[t].innerHTML = "<img src='../imagens/desce.gif' id='img_"+t+"' >&nbsp;" + etrs[t].innerHTML;
51 etrs[t].onclick = function() 49 etrs[t].onclick = function()
52 { 50 {
53 var c = this.parentNode.childNodes; 51 var c = this.parentNode.childNodes;
54 - for(h = 0;h < c.length;h++) 52 + for(var h = 0;h < c.length;h++)
55 { 53 {
56 if(c[h].style && c[h].tagName != "LEGEND") 54 if(c[h].style && c[h].tagName != "LEGEND")
57 { 55 {
@@ -66,144 +64,147 @@ function ativaLegenda() @@ -66,144 +64,147 @@ function ativaLegenda()
66 } 64 }
67 } 65 }
68 } 66 }
69 - } 67 + };
70 } 68 }
71 } 69 }
72 function abre(url) 70 function abre(url)
73 { 71 {
74 - window.location.href = url 72 + window.location.href = url;
75 } 73 }
76 function verificaEditores() 74 function verificaEditores()
77 { 75 {
78 var retorna = function(retorno) 76 var retorna = function(retorno)
79 { 77 {
80 if(retorno.data=="nao") 78 if(retorno.data=="nao")
81 - {document.body.innerHTML += "<p style=color:red >Você não está cadastrado como um editor";return}  
82 - montaParametros()  
83 - } 79 + {document.body.innerHTML += "<p style=color:red >Você não está cadastrado como um editor";return;}
  80 + montaParametros();
  81 + };
84 var p = "../php/mapfiles.php?funcao=verificaEditores"; 82 var p = "../php/mapfiles.php?funcao=verificaEditores";
85 cPaint.call(p,"",retorna); 83 cPaint.call(p,"",retorna);
86 } 84 }
87 function combosimnao(marcar) 85 function combosimnao(marcar)
88 { 86 {
89 - var ins = "<option value='' "  
90 - if (marcar == ""){ins += "selected"} 87 + var ins = "<option value='' ";
  88 + if (marcar == ""){ins += "selected";}
91 ins += ">---</option>"; 89 ins += ">---</option>";
92 - ins += "<option value='SIM' "  
93 - if (marcar == "sim" || marcar == "SIM"){ins += "selected"} 90 + ins += "<option value='SIM' ";
  91 + if (marcar == "sim" || marcar == "SIM"){ins += "selected";}
94 ins += ">sim</option>"; 92 ins += ">sim</option>";
95 - ins += "<option value='NAO' "  
96 - if (marcar == "nao" || marcar == "NAO"){ins += "selected"} 93 + ins += "<option value='NAO' ";
  94 + if (marcar == "nao" || marcar == "NAO"){ins += "selected";}
97 ins += ">nao</option>"; 95 ins += ">nao</option>";
98 - return(ins) 96 + return(ins);
99 } 97 }
100 function combolista(lista,marcar) 98 function combolista(lista,marcar)
101 { 99 {
102 - var ins = "<option value='' "  
103 - if (marcar == ""){ins += "selected"} 100 + var ins = "<option value='' ";
  101 + if (marcar == ""){ins += "selected";}
104 ins += ">---</option>"; 102 ins += ">---</option>";
105 for (var k=0;k<lista.length;k++) 103 for (var k=0;k<lista.length;k++)
106 { 104 {
107 - ins += "<option value='"+lista[k]+"' "  
108 - if (marcar == lista[k] || marcar == lista[k].toLowerCase()){ins += "selected"} 105 + ins += "<option value='"+lista[k]+"' ";
  106 + if (marcar == lista[k] || marcar == lista[k].toLowerCase()){ins += "selected";}
109 ins += ">"+lista[k]+"</option>"; 107 ins += ">"+lista[k]+"</option>";
110 } 108 }
111 - return(ins) 109 + return(ins);
112 } 110 }
113 function comboObjeto(obj,valor,texto,marcar) 111 function comboObjeto(obj,valor,texto,marcar)
114 { 112 {
115 - var ins = "<option value='' " 113 + var ins = "<option value='' ";
116 //if (marcar == ""){ins += "selected"} 114 //if (marcar == ""){ins += "selected"}
117 ins += ">---</option>"; 115 ins += ">---</option>";
118 for (var k=0;k<obj.length;k++) 116 for (var k=0;k<obj.length;k++)
119 { 117 {
120 - var v = eval("obj[k]."+valor)  
121 - var t = eval("obj[k]."+texto)  
122 - ins += "<option value='"+v+"' "  
123 - if (marcar == v){ins += "selected"} 118 + var v = eval("obj[k]."+valor);
  119 + var t = eval("obj[k]."+texto);
  120 + ins += "<option value='"+v+"' ";
  121 + if (marcar == v){ins += "selected";}
124 ins += ">"+t+"</option>"; 122 ins += ">"+t+"</option>";
125 } 123 }
126 - return(ins) 124 + return(ins);
127 } 125 }
128 function montaCampos() 126 function montaCampos()
129 { 127 {
130 - var ins = ""  
131 - for (i=0;i<$parametros.simples.length;i++) 128 + var ins = "";
  129 + for (var i=0;i<$parametros.simples.length;i++)
132 { 130 {
133 - ins += "<fieldset><legend><b>"+$parametros.simples[i].cabeca+"</b></legend>"  
134 - ins += "<p class=mensagem >"+$parametros.simples[i].mensagem+"</p>"  
135 - ins += "<table><tr><td><img style=cursor:pointer src=../imagens/02.png title='aplicar' onclick='salva(\""+$parametros.simples[i].variavel+"\")' /></td>"  
136 - ins += "<td><input type=text size=70 id='"+$parametros.simples[i].variavel+"' /></td></tr></table>"  
137 - ins += "</fieldset><br>" 131 + ins += "<fieldset><legend><b>"+$parametros.simples[i].cabeca+"</b></legend>";
  132 + ins += "<p class=mensagem >"+$parametros.simples[i].mensagem+"</p>";
  133 + ins += "<table><tr><td><img style=cursor:pointer src=../imagens/02.png title='aplicar' onclick='salva(\""+$parametros.simples[i].variavel+"\")' /></td>";
  134 + ins += "<td><input type=text size=70 id='"+$parametros.simples[i].variavel+"' /></td></tr></table>";
  135 + ins += "</fieldset><br>";
138 } 136 }
139 - document.body.innerHTML += ins 137 + document.body.innerHTML += ins;
140 } 138 }
141 function geraLinhas(dados,param,ncolunas) 139 function geraLinhas(dados,param,ncolunas)
142 { 140 {
143 var nparam = param.linhas.length; 141 var nparam = param.linhas.length;
144 - var contaParam = 0 142 + var contaParam = 0;
145 var resultado = ""; 143 var resultado = "";
146 do 144 do
147 { 145 {
148 var p = param.linhas[contaParam]; 146 var p = param.linhas[contaParam];
149 - var idd = eval("dados."+p.id) 147 + var idd = eval("dados."+p.id);
  148 + var id;
  149 + var texto;
150 if(idd != undefined) 150 if(idd != undefined)
151 - var id = p.prefixoid+idd; 151 + id = p.prefixoid+idd;
152 else 152 else
153 - var id = p.prefixoid+p.id; 153 + id = p.prefixoid+p.id;
154 var valor = eval("dados."+p.valor); 154 var valor = eval("dados."+p.valor);
155 var titulo = p.titulo; 155 var titulo = p.titulo;
156 if(p.texto) 156 if(p.texto)
157 - {var texto = p.texto} 157 + {texto = p.texto;}
158 else 158 else
159 - {var texto = ""}  
160 - resultado += "<tr colspan='"+ncolunas+"' ><td style='background-color:rgb(250,250,250);' ><b>"+texto+"</b></td></tr>"  
161 - resultado += "<tr>"  
162 - resultado += "<td>"+titulo+": </td>"  
163 - resultado += "<td><input size=60 onchange='this.style.color=\"blue\"' type=text id='"+id+"' value='"+valor+"' /></td>" 159 + {texto = "";}
  160 + resultado += "<tr colspan='"+ncolunas+"' ><td style='background-color:rgb(250,250,250);' ><b>"+texto+"</b></td></tr>";
  161 + resultado += "<tr>";
  162 + resultado += "<td>"+titulo+": </td>";
  163 + resultado += "<td><input size=60 onchange='this.style.color=\"blue\"' type=text id='"+id+"' value='"+valor+"' /></td>";
164 if(ncolunas = 3) 164 if(ncolunas = 3)
165 - resultado += "<td></td>"  
166 - resultado += "</tr>"  
167 - contaParam++ 165 + resultado += "<td></td>";
  166 + resultado += "</tr>";
  167 + contaParam++;
168 } 168 }
169 while(contaParam < nparam) 169 while(contaParam < nparam)
170 - return(resultado) 170 + return(resultado);
171 } 171 }
172 function geraLinhas2(dados,param,funcao) 172 function geraLinhas2(dados,param,funcao)
173 { 173 {
174 var nparam = param.linhas.length; 174 var nparam = param.linhas.length;
175 - var contaParam = 0 175 + var contaParam = 0;
176 var resultado = ""; 176 var resultado = "";
177 do 177 do
178 { 178 {
179 var p = param.linhas[contaParam]; 179 var p = param.linhas[contaParam];
180 - var idd = eval("dados."+p.id) 180 + var id;
  181 + var idd = eval("dados."+p.id);
181 if(idd != undefined) 182 if(idd != undefined)
182 - var id = p.prefixoid+idd; 183 + id = p.prefixoid+idd;
183 else 184 else
184 - var id = p.prefixoid+p.id; 185 + id = p.prefixoid+p.id;
185 var valor = eval("dados."+p.valor); 186 var valor = eval("dados."+p.valor);
186 var titulo = p.titulo; 187 var titulo = p.titulo;
  188 + var texto;
187 if(p.texto) 189 if(p.texto)
188 - {var texto = p.texto} 190 + {texto = p.texto;}
189 else 191 else
190 - {var texto = ""}  
191 - resultado += "<br><fieldset><legend>+- "+titulo+"</legend><div style=display:none >"  
192 - resultado += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >"+texto+"</p>"  
193 - resultado += "<p>"  
194 - resultado += "<input size=65 onchange='this.style.color=\"blue\"' type=text id='"+id+"' value='"+valor+"' />"  
195 - resultado += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='"+funcao+"(\""+p.id+"\",\""+p.valor+"\",this)'/>"  
196 - resultado += "</p></div></fieldset>"  
197 - contaParam++ 192 + {texto = "";}
  193 + resultado += "<br><fieldset><legend>+- "+titulo+"</legend><div style=display:none >";
  194 + resultado += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >"+texto+"</p>";
  195 + resultado += "<p>";
  196 + resultado += "<input size=65 onchange='this.style.color=\"blue\"' type=text id='"+id+"' value='"+valor+"' />";
  197 + resultado += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='"+funcao+"(\""+p.id+"\",\""+p.valor+"\",this)'/>";
  198 + resultado += "</p></div></fieldset>";
  199 + contaParam++;
198 } 200 }
199 while(contaParam < nparam) 201 while(contaParam < nparam)
200 - return(resultado) 202 + return(resultado);
201 } 203 }
202 function registraPerfil(id,perfil) 204 function registraPerfil(id,perfil)
203 { 205 {
204 - var perfis = $i(id).value  
205 if(perfil == "") 206 if(perfil == "")
206 - $i(id).value = perfil 207 + $i(id).value = perfil;
207 else 208 else
208 - $i(id).value = $i(id).value+" "+perfil 209 + $i(id).value = $i(id).value+" "+perfil;
209 } 210 }
210 \ No newline at end of file 211 \ No newline at end of file
admin/js/arvore.js
@@ -47,7 +47,7 @@ $id_subgrupo = &quot;&quot;; @@ -47,7 +47,7 @@ $id_subgrupo = &quot;&quot;;
47 try{ 47 try{
48 var u = window.location.href.split("?")[1]; 48 var u = window.location.href.split("?")[1];
49 u = u.split("&"); 49 u = u.split("&");
50 - for(i=0;i<u.length;i++){ 50 + for(var i=0;i<u.length;i++){
51 var p = u[i].split("="); 51 var p = u[i].split("=");
52 eval("$"+p[0]+"='"+p[1]+"';"); 52 eval("$"+p[0]+"='"+p[1]+"';");
53 } 53 }
@@ -63,28 +63,28 @@ function initMenu() @@ -63,28 +63,28 @@ function initMenu()
63 var editorDeMenus = function() 63 var editorDeMenus = function()
64 { 64 {
65 if($i("editor_bd")){return;} 65 if($i("editor_bd")){return;}
66 - core_montaEditor("","600px","500px","pegaMenus")  
67 - $i("editor_bd").innerHTML = '<input type=button id=adicionaNovoMenu value="Adicionar um novo menu" style="left:-5px;" /><br><br><div id="tabela" style="left:-5px;"> </div>'  
68 - initEditorMenu() 66 + core_montaEditor("","600px","500px","pegaMenus");
  67 + $i("editor_bd").innerHTML = '<input type=button id=adicionaNovoMenu value="Adicionar um novo menu" style="left:-5px;" /><br><br><div id="tabela" style="left:-5px;"> </div>';
  68 + initEditorMenu();
69 }; 69 };
70 var editorDeGrupos = function() 70 var editorDeGrupos = function()
71 { 71 {
72 if($i("editor_bd")){return;} 72 if($i("editor_bd")){return;}
73 - core_montaEditor("","600px","500px")  
74 - $i("editor_bd").innerHTML = '<p class=paragrafo >Clique nas células da tabela para editar a característica de cada item. Finalize com "enter". Após editar, salve o item.</p><p class=paragrafo ><input type=button id=adicionaNovoGrupo value="Adicionar um novo grupo" style="left:-5px;" /></p><p><br><div id="tabela" style="left:-5px;"> </div>'  
75 - initEditorGrupos() 73 + core_montaEditor("","600px","500px");
  74 + $i("editor_bd").innerHTML = '<p class=paragrafo >Clique nas células da tabela para editar a característica de cada item. Finalize com "enter". Após editar, salve o item.</p><p class=paragrafo ><input type=button id=adicionaNovoGrupo value="Adicionar um novo grupo" style="left:-5px;" /></p><p><br><div id="tabela" style="left:-5px;"> </div>';
  75 + initEditorGrupos();
76 }; 76 };
77 var editorDeSubGrupos = function() 77 var editorDeSubGrupos = function()
78 { 78 {
79 if($i("editor_bd")){return;} 79 if($i("editor_bd")){return;}
80 - core_montaEditor("","600px","500px")  
81 - $i("editor_bd").innerHTML = '<p class=paragrafo >Clique nas células da tabela para editar a característica de cada item. Finalize com "enter". Após editar, salve o item.</p><p class=paragrafo ><input type=button id=adicionaNovoSubGrupo value="Adicionar um novo sub-grupo" style="left:-5px;" /></p><br><div id="tabela" style="left:-5px;"> </div>'  
82 - initEditorSubGrupos() 80 + core_montaEditor("","600px","500px");
  81 + $i("editor_bd").innerHTML = '<p class=paragrafo >Clique nas células da tabela para editar a característica de cada item. Finalize com "enter". Após editar, salve o item.</p><p class=paragrafo ><input type=button id=adicionaNovoSubGrupo value="Adicionar um novo sub-grupo" style="left:-5px;" /></p><br><div id="tabela" style="left:-5px;"> </div>';
  82 + initEditorSubGrupos();
83 }; 83 };
84 84
85 - var botao1 = new YAHOO.widget.Button("botaoEditorMenu",{ onclick: { fn: editorDeMenus } });  
86 - var botao2 = new YAHOO.widget.Button("botaoEditorGrupo",{ onclick: { fn: editorDeGrupos } });  
87 - var botao3 = new YAHOO.widget.Button("botaoEditorSubGrupo",{ onclick: { fn: editorDeSubGrupos } }); 85 + new YAHOO.widget.Button("botaoEditorMenu",{ onclick: { fn: editorDeMenus } });
  86 + new YAHOO.widget.Button("botaoEditorGrupo",{ onclick: { fn: editorDeGrupos } });
  87 + new YAHOO.widget.Button("botaoEditorSubGrupo",{ onclick: { fn: editorDeSubGrupos } });
88 88
89 core_carregando("ativa"); 89 core_carregando("ativa");
90 core_ativaPainelAjuda("ajuda","botaoAjuda"); 90 core_ativaPainelAjuda("ajuda","botaoAjuda");
@@ -102,7 +102,7 @@ function pegaMenus() @@ -102,7 +102,7 @@ function pegaMenus()
102 try 102 try
103 {YAHOO.util.Event.removeListener(YAHOO.example.container.panelEditor.close, "click");} 103 {YAHOO.util.Event.removeListener(YAHOO.example.container.panelEditor.close, "click");}
104 catch(e){} 104 catch(e){}
105 - core_pegaDados("buscando menus...","../php/menutemas.php?funcao=pegaMenus2&idioma="+idiomaSel(),"montaArvore") 105 + core_pegaDados("buscando menus...","../php/menutemas.php?funcao=pegaMenus2&idioma="+idiomaSel(),"montaArvore");
106 } 106 }
107 /* 107 /*
108 Function: montaArvore 108 Function: montaArvore
@@ -120,9 +120,6 @@ function montaArvore(dados) @@ -120,9 +120,6 @@ function montaArvore(dados)
120 tree = ""; 120 tree = "";
121 function changeIconMode() 121 function changeIconMode()
122 { 122 {
123 - var newVal = parseInt(this.value);  
124 - if (newVal != currentIconMode)  
125 - {currentIconMode = newVal;}  
126 buildTree(); 123 buildTree();
127 } 124 }
128 function loadNodeData(node, fnLoadComplete) 125 function loadNodeData(node, fnLoadComplete)
@@ -136,8 +133,8 @@ function montaArvore(dados) @@ -136,8 +133,8 @@ function montaArvore(dados)
136 { 133 {
137 success: function(oResponse) 134 success: function(oResponse)
138 { 135 {
139 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText)  
140 - montaNosGrupos(node.data.id_menu,node,dados,true) 136 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
  137 + montaNosGrupos(node.data.id_menu,node,dados,true);
141 oResponse.argument.fnLoadComplete(); 138 oResponse.argument.fnLoadComplete();
142 }, 139 },
143 failure: function(oResponse) 140 failure: function(oResponse)
@@ -156,7 +153,7 @@ function montaArvore(dados) @@ -156,7 +153,7 @@ function montaArvore(dados)
156 function buildTree() 153 function buildTree()
157 { 154 {
158 tree = new YAHOO.widget.TreeView("arvoreMenus"); 155 tree = new YAHOO.widget.TreeView("arvoreMenus");
159 - tree.setDynamicLoad(loadNodeData, currentIconMode); 156 + tree.setDynamicLoad(loadNodeData, 1);
160 var root = tree.getRoot(); 157 var root = tree.getRoot();
161 var tempNode = new YAHOO.widget.TextNode('', root, false); 158 var tempNode = new YAHOO.widget.TextNode('', root, false);
162 tempNode.isLeaf = true; 159 tempNode.isLeaf = true;
@@ -164,7 +161,7 @@ function montaArvore(dados) @@ -164,7 +161,7 @@ function montaArvore(dados)
164 } 161 }
165 buildTree(); 162 buildTree();
166 }(); 163 }();
167 - montaNosMenus(dados) 164 + montaNosMenus(dados);
168 tree.draw(); 165 tree.draw();
169 } 166 }
170 function temaIconMode() 167 function temaIconMode()
@@ -179,20 +176,21 @@ function temaIconMode() @@ -179,20 +176,21 @@ function temaIconMode()
179 function montaNosMenus(dados,redesenha) 176 function montaNosMenus(dados,redesenha)
180 { 177 {
181 //verifica se foi passado um id pela url 178 //verifica se foi passado um id pela url
182 - var root = tree.getRoot(); 179 + var root = tree.getRoot(),
  180 + tempNode = null;
183 for (var i=0, j=dados.length; i<j; i++) 181 for (var i=0, j=dados.length; i<j; i++)
184 { 182 {
185 if($id_menu == "" || $id_menu == dados[i].id_menu){ 183 if($id_menu == "" || $id_menu == dados[i].id_menu){
186 var cor = ""; 184 var cor = "";
187 if(dados[i].publicado_menu == "NAO") 185 if(dados[i].publicado_menu == "NAO")
188 - var cor = "style='color:red'";  
189 - var conteudo = "<b>&nbsp;<span "+cor+" >"+dados[i].nome_menu+"</span>" 186 + cor = "style='color:red'";
  187 + var conteudo = "<b>&nbsp;<span "+cor+" >"+dados[i].nome_menu+"</span>";
190 var d = {html:conteudo,id_menu:dados[i].id_menu,tipo:"menu"}; 188 var d = {html:conteudo,id_menu:dados[i].id_menu,tipo:"menu"};
191 - var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 189 + tempNode = new YAHOO.widget.HTMLNode(d, root, false,true);
192 } 190 }
193 } 191 }
194 if(redesenha){tree.draw();} 192 if(redesenha){tree.draw();}
195 - if($id_menu !== "") 193 + if($id_menu !== "" && tempNode)
196 {tempNode.expand();} 194 {tempNode.expand();}
197 } 195 }
198 // 196 //
@@ -207,7 +205,8 @@ Monta os nós com os grupos e permite abrir os subgrupos @@ -207,7 +205,8 @@ Monta os nós com os grupos e permite abrir os subgrupos
207 */ 205 */
208 function montaNosGrupos(idmenu,no,dados,redesenha) 206 function montaNosGrupos(idmenu,no,dados,redesenha)
209 { 207 {
210 - //pega os temas que ficam na raiz da árvore 208 + var tempNodeR = null;
  209 + //pega os temas que ficam na raiz da árvore
211 if(!tree.getNodeByProperty("etiquetaTemasRaiz","menu_"+idmenu)) 210 if(!tree.getNodeByProperty("etiquetaTemasRaiz","menu_"+idmenu))
212 {montaTemasRaiz(no,dados,true);} 211 {montaTemasRaiz(no,dados,true);}
213 //pega os grupos do menu 212 //pega os grupos do menu
@@ -215,13 +214,13 @@ function montaNosGrupos(idmenu,no,dados,redesenha) @@ -215,13 +214,13 @@ function montaNosGrupos(idmenu,no,dados,redesenha)
215 {return;} 214 {return;}
216 if(!tree.getNodeByProperty("etiquetaGrupo","menu_"+idmenu)) 215 if(!tree.getNodeByProperty("etiquetaGrupo","menu_"+idmenu))
217 { 216 {
218 - var temp = "menu_"+idmenu  
219 - var d = {tipo:"etiqueta","etiquetaGrupo":temp,html:"<i style=color:gray >Grupos</i>"}  
220 - var tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true); 217 + var temp = "menu_"+idmenu;
  218 + var d = {tipo:"etiqueta","etiquetaGrupo":temp,html:"<i style=color:gray >Grupos</i>"};
  219 + tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true);
221 tempNodeR.isLeaf = false; 220 tempNodeR.isLeaf = false;
222 if($id_grupo !== "" || $id_menu !== "") 221 if($id_grupo !== "" || $id_menu !== "")
223 {tempNodeR.expand();} 222 {tempNodeR.expand();}
224 - var conteudo = "<span onclick=\"novoGrupo('"+idmenu+"')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray > Adicionar um novo</i></span>" 223 + var conteudo = "<span onclick=\"novoGrupo('"+idmenu+"')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray > Adicionar um novo</i></span>";
225 var d = {html:conteudo}; 224 var d = {html:conteudo};
226 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 225 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
227 tempNode.isLeaf = true; 226 tempNode.isLeaf = true;
@@ -231,12 +230,14 @@ function montaNosGrupos(idmenu,no,dados,redesenha) @@ -231,12 +230,14 @@ function montaNosGrupos(idmenu,no,dados,redesenha)
231 for (var i=0, j=dados.grupos.length; i<j; i++) 230 for (var i=0, j=dados.grupos.length; i<j; i++)
232 { 231 {
233 if($id_grupo == "" || $id_grupo == dados.grupos[i].id_n1){ 232 if($id_grupo == "" || $id_grupo == dados.grupos[i].id_n1){
234 - var conteudo = montaConteudoNo(dados.grupos[i].id_n1,dados.grupos[i].publicado,dados.grupos[i].nome_grupo,"grupo")  
235 - var d = {idmenu:idmenu,html:conteudo,id_n1:dados.grupos[i].id_n1,tipo:"grupo"}  
236 - var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);  
237 - tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, idmenu);  
238 - if($id_grupo !== "")  
239 - {tempNode.expand();} 233 + var conteudo = montaConteudoNo(dados.grupos[i].id_n1,dados.grupos[i].publicado,dados.grupos[i].nome_grupo,"grupo");
  234 + var d = {idmenu:idmenu,html:conteudo,id_n1:dados.grupos[i].id_n1,tipo:"grupo"};
  235 + if(tempNodeR){
  236 + var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
  237 + tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, idmenu);
  238 + if($id_grupo !== "")
  239 + {tempNode.expand();}
  240 + }
240 } 241 }
241 } 242 }
242 if(redesenha){tree.draw();} 243 if(redesenha){tree.draw();}
@@ -249,8 +250,8 @@ function loadSubgruposData(node, fnLoadComplete) @@ -249,8 +250,8 @@ function loadSubgruposData(node, fnLoadComplete)
249 { 250 {
250 success: function(oResponse) 251 success: function(oResponse)
251 { 252 {
252 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText)  
253 - montaNosSubgrupos(idmenu,node,dados,true) 253 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
  254 + montaNosSubgrupos(idmenu,node,dados,true);
254 oResponse.argument.fnLoadComplete(); 255 oResponse.argument.fnLoadComplete();
255 }, 256 },
256 failure: function(oResponse) 257 failure: function(oResponse)
@@ -274,8 +275,8 @@ function loadTemasData(node, fnLoadComplete) @@ -274,8 +275,8 @@ function loadTemasData(node, fnLoadComplete)
274 { 275 {
275 success: function(oResponse) 276 success: function(oResponse)
276 { 277 {
277 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText)  
278 - montaTemas(idmenu,node,dados,false) 278 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
  279 + montaTemas(idmenu,node,dados,false);
279 oResponse.argument.fnLoadComplete(); 280 oResponse.argument.fnLoadComplete();
280 }, 281 },
281 failure: function(oResponse) 282 failure: function(oResponse)
@@ -301,20 +302,21 @@ Monta os nós com os temas @@ -301,20 +302,21 @@ Monta os nós com os temas
301 */ 302 */
302 function montaNosSubgrupos(idmenu,no,dados,redesenha) 303 function montaNosSubgrupos(idmenu,no,dados,redesenha)
303 { 304 {
304 - if(!tree.getNodeByProperty("etiquetaTemasGrupo","grupo_"+no.data.id_n1))  
305 - montaTemasRaizGrupo(idmenu,no,dados,true) 305 + var tempNodeR = null;
  306 + if(!tree.getNodeByProperty("etiquetaTemasGrupo","grupo_"+no.data.id_n1))
  307 + montaTemasRaizGrupo(idmenu,no,dados,true);
306 if(idmenu == undefined) 308 if(idmenu == undefined)
307 {return;} 309 {return;}
308 if(!tree.getNodeByProperty("etiquetaTemasSubGrupo",no.data.id_n1)) 310 if(!tree.getNodeByProperty("etiquetaTemasSubGrupo",no.data.id_n1))
309 { 311 {
310 - var d = {tipo:"etiqueta",etiquetaTemasSubGrupo:no.data.id_n1,html:"<i style=color:gray >Sub-grupos</i>"}  
311 - var tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true); 312 + var d = {tipo:"etiqueta",etiquetaTemasSubGrupo:no.data.id_n1,html:"<i style=color:gray >Sub-grupos</i>"};
  313 + tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true);
312 tempNodeR.isLeaf = false; 314 tempNodeR.isLeaf = false;
313 if($id_subgrupo !== "" || $id_grupo !== "") 315 if($id_subgrupo !== "" || $id_grupo !== "")
314 {tempNodeR.expand();} 316 {tempNodeR.expand();}
315 317
316 - var conteudo = "<span style=\"cursor:pointer;\" onclick=\"novoSubGrupo('"+idmenu+"','"+no.data.id_n1+"')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray > Adicionar um novo</i></span>"  
317 - var d = {html:conteudo} 318 + var conteudo = "<span style=\"cursor:pointer;\" onclick=\"novoSubGrupo('"+idmenu+"','"+no.data.id_n1+"')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray > Adicionar um novo</i></span>";
  319 + var d = {html:conteudo};
318 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 320 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
319 tempNode.isLeaf = true; 321 tempNode.isLeaf = true;
320 if($id_subgrupo !== "") 322 if($id_subgrupo !== "")
@@ -322,9 +324,9 @@ function montaNosSubgrupos(idmenu,no,dados,redesenha) @@ -322,9 +324,9 @@ function montaNosSubgrupos(idmenu,no,dados,redesenha)
322 } 324 }
323 for (var i=0, j=dados.subgrupos.length; i<j; i++) 325 for (var i=0, j=dados.subgrupos.length; i<j; i++)
324 { 326 {
325 - if($id_subgrupo == "" || $id_subgrupo == dados.subgrupos[i].id_n2){  
326 - var conteudo = montaConteudoNo(dados.subgrupos[i].id_n2,dados.subgrupos[i].publicado,dados.subgrupos[i].nome_subgrupo,"subgrupo")  
327 - var d = {idmenu:idmenu,html:conteudo,id_n2:dados.subgrupos[i].id_n2,tipo:"subgrupo"} 327 + if(tempNodeR && $id_subgrupo == "" || $id_subgrupo == dados.subgrupos[i].id_n2){
  328 + var conteudo = montaConteudoNo(dados.subgrupos[i].id_n2,dados.subgrupos[i].publicado,dados.subgrupos[i].nome_subgrupo,"subgrupo");
  329 + var d = {idmenu:idmenu,html:conteudo,id_n2:dados.subgrupos[i].id_n2,tipo:"subgrupo"};
328 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 330 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
329 tempNode.setDynamicLoad(loadTemasData, temaIconMode); 331 tempNode.setDynamicLoad(loadTemasData, temaIconMode);
330 if($id_subgrupo !== "") 332 if($id_subgrupo !== "")
@@ -335,78 +337,80 @@ function montaNosSubgrupos(idmenu,no,dados,redesenha) @@ -335,78 +337,80 @@ function montaNosSubgrupos(idmenu,no,dados,redesenha)
335 } 337 }
336 function montaTemas(idmenu,no,dados,redesenha) 338 function montaTemas(idmenu,no,dados,redesenha)
337 { 339 {
  340 + var tempNodeR = null;
338 if(!tree.getNodeByProperty("etiquetaTemas",no.data.id_n2)) 341 if(!tree.getNodeByProperty("etiquetaTemas",no.data.id_n2))
339 { 342 {
340 - var d = {tipo:"etiqueta",etiquetaTemas:no.data.id_n2,html:"<i style=color:gray >Temas</i>"}  
341 - var tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true); 343 + var d = {tipo:"etiqueta",etiquetaTemas:no.data.id_n2,html:"<i style=color:gray >Temas</i>"};
  344 + tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true);
342 tempNodeR.isLeaf = false; 345 tempNodeR.isLeaf = false;
343 -  
344 - var conteudo = "<span onclick=\"novoTema('"+idmenu+"','"+no.data.id_n2+"')\" style=\"cursor:pointer;\"><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray > Adicionar um novo</i></span>"  
345 - var d = {html:conteudo} 346 + var conteudo = "<span onclick=\"novoTema('"+idmenu+"','"+no.data.id_n2+"')\" style=\"cursor:pointer;\"><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray > Adicionar um novo</i></span>";
  347 + var d = {html:conteudo};
346 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 348 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
347 tempNode.isLeaf = true; 349 tempNode.isLeaf = true;
348 } 350 }
349 - for (i=0, j=dados.length; i<j; i++) 351 + for (var i=0, j=dados.length; i<j; i++)
350 { 352 {
351 var conteudo = montaConteudoNo(dados[i].id_n3,dados[i].publicado,dados[i].nome_tema,"tema"); 353 var conteudo = montaConteudoNo(dados[i].id_n3,dados[i].publicado,dados[i].nome_tema,"tema");
352 - var d = {html:conteudo,id_n3:dados[i].id_n3,tipo:"tema"} 354 + var d = {html:conteudo,id_n3:dados[i].id_n3,tipo:"tema"};
353 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 355 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
354 tempNode.isLeaf = true; 356 tempNode.isLeaf = true;
355 } 357 }
356 if(redesenha){tree.draw();} 358 if(redesenha){tree.draw();}
357 } 359 }
358 function montaConteudoNo(id,publicado,nome,tipo){ 360 function montaConteudoNo(id,publicado,nome,tipo){
359 - var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','"+tipo+"','"+id+"')\" title=sobe src=\"../imagens/34.png\" />"  
360 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','"+tipo+"','"+id+"')\" title=desce src=\"../imagens/33.png\" />"  
361 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('"+tipo+"','"+id+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />"  
362 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('"+tipo+"','"+id+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />&nbsp;" 361 + var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','"+tipo+"','"+id+"')\" title=sobe src=\"../imagens/34.png\" />";
  362 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','"+tipo+"','"+id+"')\" title=desce src=\"../imagens/33.png\" />";
  363 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('"+tipo+"','"+id+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";
  364 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('"+tipo+"','"+id+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />&nbsp;";
363 var cor = ""; 365 var cor = "";
364 if(publicado == "NAO") 366 if(publicado == "NAO")
365 - {var cor = "style='color:red'";} 367 + {cor = "style='color:red'";}
366 if(nome) 368 if(nome)
367 - conteudo += "<span "+cor+" >"+nome+"<span style='color:gray'> id: "+id+"</span></span>" 369 + conteudo += "<span "+cor+" >"+nome+"<span style='color:gray'> id: "+id+"</span></span>";
368 else 370 else
369 - conteudo += "<span "+cor+" > ??? vc precisa editar esse nó</span>" 371 + conteudo += "<span "+cor+" > ??? vc precisa editar esse nó</span>";
370 return conteudo; 372 return conteudo;
371 } 373 }
372 function montaTemasRaiz(no,dados,redesenha) 374 function montaTemasRaiz(no,dados,redesenha)
373 { 375 {
374 - var resultado = new Array(); 376 + var resultado = new Array(),
  377 + tempNodeR = null;
375 if(no.data.id_menu == undefined) 378 if(no.data.id_menu == undefined)
376 {return;} 379 {return;}
377 if(!tree.getNodeByProperty("etiquetaTemasRaiz","menu_"+no.data.id_menu)) 380 if(!tree.getNodeByProperty("etiquetaTemasRaiz","menu_"+no.data.id_menu))
378 { 381 {
379 var temp = "menu_"+no.data.id_menu; 382 var temp = "menu_"+no.data.id_menu;
380 - var d = {id_menu:no.data.id_menu,tipo:"etiqueta",etiquetaTemasRaiz:temp,html:"<i style=color:gray >Temas na raiz do menu</i>"}  
381 - var tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true); 383 + var d = {id_menu:no.data.id_menu,tipo:"etiqueta",etiquetaTemasRaiz:temp,html:"<i style=color:gray >Temas na raiz do menu</i>"};
  384 + tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true);
382 tempNodeR.isLeaf = false; 385 tempNodeR.isLeaf = false;
383 - var d = {tipo:"etiqueta",html:"<span style=\"cursor:pointer;\" onclick=\"novoTemaRaiz('"+no.data.id_menu+"')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray >Adicionar um novo</i></span>"} 386 + var d = {tipo:"etiqueta",html:"<span style=\"cursor:pointer;\" onclick=\"novoTemaRaiz('"+no.data.id_menu+"')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray >Adicionar um novo</i></span>"};
384 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 387 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
385 tempNode.isLeaf = true; 388 tempNode.isLeaf = true;
386 } 389 }
387 for (var i=0, j=dados.raiz.length; i<j; i++) 390 for (var i=0, j=dados.raiz.length; i<j; i++)
388 { 391 {
389 - var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','raizmenu','"+dados.raiz[i].id_raiz+"')\" title=sobe src=\"../imagens/34.png\" />"  
390 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','raizmenu','"+dados.raiz[i].id_raiz+"')\" title=desce src=\"../imagens/33.png\" />"  
391 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('raizmenu','"+dados.raiz[i].id_raiz+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />"  
392 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('raizmenu','"+dados.raiz[i].id_raiz+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />&nbsp;<span>"+dados.raiz[i].nome_tema+"</span>"  
393 - var d = {html:conteudo,id_raiz:dados.raiz[i].id_raiz,tipo:"raizmenu"} 392 + var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','raizmenu','"+dados.raiz[i].id_raiz+"')\" title=sobe src=\"../imagens/34.png\" />";
  393 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','raizmenu','"+dados.raiz[i].id_raiz+"')\" title=desce src=\"../imagens/33.png\" />";
  394 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('raizmenu','"+dados.raiz[i].id_raiz+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";
  395 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('raizmenu','"+dados.raiz[i].id_raiz+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />&nbsp;<span>"+dados.raiz[i].nome_tema+"</span>";
  396 + var d = {html:conteudo,id_raiz:dados.raiz[i].id_raiz,tipo:"raizmenu"};
394 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 397 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
395 tempNode.isLeaf = true; 398 tempNode.isLeaf = true;
396 - resultado.push(tempNode) 399 + resultado.push(tempNode);
397 } 400 }
398 return resultado; 401 return resultado;
399 } 402 }
400 function montaTemasRaizGrupo(idmenu,no,dados,redesenha) 403 function montaTemasRaizGrupo(idmenu,no,dados,redesenha)
401 { 404 {
402 - var resultado = new Array(); 405 + var resultado = new Array(),
  406 + tempNodeR = null;
403 if(no.data.id_n1 == undefined) 407 if(no.data.id_n1 == undefined)
404 {return;} 408 {return;}
405 if(!tree.getNodeByProperty("etiquetaTemasGrupo","grupo_"+no.data.id_n1)) 409 if(!tree.getNodeByProperty("etiquetaTemasGrupo","grupo_"+no.data.id_n1))
406 { 410 {
407 var temp = "grupo_"+no.data.id_n1; 411 var temp = "grupo_"+no.data.id_n1;
408 var d = {etiquetaTemasGrupo:temp,tipo:"etiqueta",html:"<i style=color:gray >Temas na raiz do grupo:</i>"}; 412 var d = {etiquetaTemasGrupo:temp,tipo:"etiqueta",html:"<i style=color:gray >Temas na raiz do grupo:</i>"};
409 - var tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true); 413 + tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true);
410 tempNodeR.isLeaf = false; 414 tempNodeR.isLeaf = false;
411 var d = {tipo:"etiqueta",html:"<span onclick=\"novoTemaRaizGrupo('"+idmenu+"','"+no.data.id_n1+"')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray >Adicionar um novo</i></span>"}; 415 var d = {tipo:"etiqueta",html:"<span onclick=\"novoTemaRaizGrupo('"+idmenu+"','"+no.data.id_n1+"')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i style=color:gray >Adicionar um novo</i></span>"};
412 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true); 416 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
@@ -418,7 +422,7 @@ function montaTemasRaizGrupo(idmenu,no,dados,redesenha) @@ -418,7 +422,7 @@ function montaTemasRaizGrupo(idmenu,no,dados,redesenha)
418 var d = {html:conteudo,id_raiz:dados.raiz[i].id_raiz,tipo:"raizgrupo"}; 422 var d = {html:conteudo,id_raiz:dados.raiz[i].id_raiz,tipo:"raizgrupo"};
419 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR,false,true); 423 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR,false,true);
420 tempNode.isLeaf = true; 424 tempNode.isLeaf = true;
421 - resultado.push(tempNode) 425 + resultado.push(tempNode);
422 } 426 }
423 return resultado; 427 return resultado;
424 } 428 }
@@ -434,16 +438,16 @@ function novoTemaRaiz(id) @@ -434,16 +438,16 @@ function novoTemaRaiz(id)
434 core_carregando("ativa"); 438 core_carregando("ativa");
435 var mensagem = " adicionando tema..."; 439 var mensagem = " adicionando tema...";
436 core_carregando(mensagem); 440 core_carregando(mensagem);
437 - var no = tree.getNodeByProperty("etiquetaTemasRaiz","menu_"+id) 441 + var no = tree.getNodeByProperty("etiquetaTemasRaiz","menu_"+id);
438 var sUrl = "../php/arvore.php?funcao=adicionarTemaRaiz&id_menu="+id+"&idioma="+idiomaSel(); 442 var sUrl = "../php/arvore.php?funcao=adicionarTemaRaiz&id_menu="+id+"&idioma="+idiomaSel();
439 var callback = 443 var callback =
440 { 444 {
441 success: function(oResponse) 445 success: function(oResponse)
442 { 446 {
443 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText) 447 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
444 dados = dados.raiz[0]; 448 dados = dados.raiz[0];
445 var conteudo = montaConteudoNo(dados.id_raiz,"SIM","","raizmenu"); 449 var conteudo = montaConteudoNo(dados.id_raiz,"SIM","","raizmenu");
446 - var d = {html:conteudo,id_raiz:dados.id_raiz,tipo:"raizmenu"} 450 + var d = {html:conteudo,id_raiz:dados.id_raiz,tipo:"raizmenu"};
447 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 451 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
448 tempNode.isLeaf = true; 452 tempNode.isLeaf = true;
449 tree.draw(); 453 tree.draw();
@@ -452,7 +456,7 @@ function novoTemaRaiz(id) @@ -452,7 +456,7 @@ function novoTemaRaiz(id)
452 failure:core_handleFailure, 456 failure:core_handleFailure,
453 argument: { foo:"foo", bar:"bar" } 457 argument: { foo:"foo", bar:"bar" }
454 }; 458 };
455 - core_makeRequest(sUrl,callback) 459 + core_makeRequest(sUrl,callback);
456 } 460 }
457 /* 461 /*
458 Function: novoTemaRaizGrupo 462 Function: novoTemaRaizGrupo
@@ -466,16 +470,16 @@ function novoTemaRaizGrupo(idmenu,id) @@ -466,16 +470,16 @@ function novoTemaRaizGrupo(idmenu,id)
466 core_carregando("ativa"); 470 core_carregando("ativa");
467 var mensagem = " adicionando tema..."; 471 var mensagem = " adicionando tema...";
468 core_carregando(mensagem); 472 core_carregando(mensagem);
469 - var no = tree.getNodeByProperty("etiquetaTemasGrupo","grupo_"+id) 473 + var no = tree.getNodeByProperty("etiquetaTemasGrupo","grupo_"+id);
470 var sUrl = "../php/arvore.php?funcao=adicionarTemaRaizGrupo&id_n1="+id+"&id_menu="+idmenu+"&idioma="+idiomaSel(); 474 var sUrl = "../php/arvore.php?funcao=adicionarTemaRaizGrupo&id_n1="+id+"&id_menu="+idmenu+"&idioma="+idiomaSel();
471 var callback = 475 var callback =
472 { 476 {
473 success: function(oResponse) 477 success: function(oResponse)
474 { 478 {
475 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText) 479 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
476 dados = dados.raiz[0]; 480 dados = dados.raiz[0];
477 var conteudo = montaConteudoNo(dados.id_raiz,"SIM","","raizgrupo"); 481 var conteudo = montaConteudoNo(dados.id_raiz,"SIM","","raizgrupo");
478 - var d = {html:conteudo,id_raiz:dados.id_raiz,tipo:"raizgrupo"} 482 + var d = {html:conteudo,id_raiz:dados.id_raiz,tipo:"raizgrupo"};
479 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 483 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
480 tempNode.isLeaf = true; 484 tempNode.isLeaf = true;
481 tree.draw(); 485 tree.draw();
@@ -484,7 +488,7 @@ function novoTemaRaizGrupo(idmenu,id) @@ -484,7 +488,7 @@ function novoTemaRaizGrupo(idmenu,id)
484 failure:core_handleFailure, 488 failure:core_handleFailure,
485 argument: { foo:"foo", bar:"bar" } 489 argument: { foo:"foo", bar:"bar" }
486 }; 490 };
487 - core_makeRequest(sUrl,callback) 491 + core_makeRequest(sUrl,callback);
488 } 492 }
489 /* 493 /*
490 Function: novoGrupo 494 Function: novoGrupo
@@ -503,11 +507,11 @@ function novoGrupo(id_menu) @@ -503,11 +507,11 @@ function novoGrupo(id_menu)
503 { 507 {
504 success: function(oResponse) 508 success: function(oResponse)
505 { 509 {
506 - var no = tree.getNodeByProperty("etiquetaGrupo","menu_"+id_menu)  
507 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText) 510 + var no = tree.getNodeByProperty("etiquetaGrupo","menu_"+id_menu);
  511 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
508 dados = dados.grupos[0]; 512 dados = dados.grupos[0];
509 var conteudo = montaConteudoNo(dados.id_n1,"NAO","","grupo"); 513 var conteudo = montaConteudoNo(dados.id_n1,"NAO","","grupo");
510 - var d = {idmenu:id_menu,html:conteudo,id_n1:dados.id_n1,tipo:"grupo"} 514 + var d = {idmenu:id_menu,html:conteudo,id_n1:dados.id_n1,tipo:"grupo"};
511 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 515 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
512 tempNode.isLeaf = false; 516 tempNode.isLeaf = false;
513 tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, id_menu); 517 tempNode.setDynamicLoad(loadSubgruposData, temaIconMode, id_menu);
@@ -518,7 +522,7 @@ function novoGrupo(id_menu) @@ -518,7 +522,7 @@ function novoGrupo(id_menu)
518 failure:core_handleFailure, 522 failure:core_handleFailure,
519 argument: { foo:"foo", bar:"bar" } 523 argument: { foo:"foo", bar:"bar" }
520 }; 524 };
521 - core_makeRequest(sUrl,callback) 525 + core_makeRequest(sUrl,callback);
522 } 526 }
523 /* 527 /*
524 Function: novoSubGrupo 528 Function: novoSubGrupo
@@ -537,11 +541,11 @@ function novoSubGrupo(id_menu,id_n1) @@ -537,11 +541,11 @@ function novoSubGrupo(id_menu,id_n1)
537 { 541 {
538 success: function(oResponse) 542 success: function(oResponse)
539 { 543 {
540 - var no = tree.getNodeByProperty("etiquetaTemasSubGrupo",id_n1)  
541 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText) 544 + var no = tree.getNodeByProperty("etiquetaTemasSubGrupo",id_n1);
  545 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
542 dados = dados.subgrupos[0]; 546 dados = dados.subgrupos[0];
543 var conteudo = montaConteudoNo(dados.id_n2,dados.publicado,"","subgrupo"); 547 var conteudo = montaConteudoNo(dados.id_n2,dados.publicado,"","subgrupo");
544 - var d = {idmenu:id_menu,html:conteudo,id_n2:dados.id_n2,tipo:"subgrupo"} 548 + var d = {idmenu:id_menu,html:conteudo,id_n2:dados.id_n2,tipo:"subgrupo"};
545 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 549 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
546 tempNode.isLeaf = false; 550 tempNode.isLeaf = false;
547 tempNode.setDynamicLoad(loadTemasData, temaIconMode, id_menu); 551 tempNode.setDynamicLoad(loadTemasData, temaIconMode, id_menu);
@@ -552,7 +556,7 @@ function novoSubGrupo(id_menu,id_n1) @@ -552,7 +556,7 @@ function novoSubGrupo(id_menu,id_n1)
552 failure:core_handleFailure, 556 failure:core_handleFailure,
553 argument: { foo:"foo", bar:"bar" } 557 argument: { foo:"foo", bar:"bar" }
554 }; 558 };
555 - core_makeRequest(sUrl,callback) 559 + core_makeRequest(sUrl,callback);
556 } 560 }
557 /* 561 /*
558 Function: novoTema 562 Function: novoTema
@@ -572,10 +576,10 @@ function novoTema(id_menu,id_n2) @@ -572,10 +576,10 @@ function novoTema(id_menu,id_n2)
572 success: function(oResponse) 576 success: function(oResponse)
573 { 577 {
574 var no = tree.getNodeByProperty("etiquetaTemas",id_n2); 578 var no = tree.getNodeByProperty("etiquetaTemas",id_n2);
575 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText) 579 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
576 dados = dados[0]; 580 dados = dados[0];
577 var conteudo = montaConteudoNo(dados.id_n3,dados.publicado,"","tema"); 581 var conteudo = montaConteudoNo(dados.id_n3,dados.publicado,"","tema");
578 - var d = {idmenu:id_menu,html:conteudo,id_n3:dados.id_n3,tipo:"tema"} 582 + var d = {idmenu:id_menu,html:conteudo,id_n3:dados.id_n3,tipo:"tema"};
579 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 583 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
580 tempNode.isLeaf = true; 584 tempNode.isLeaf = true;
581 tree.draw(); 585 tree.draw();
@@ -585,38 +589,42 @@ function novoTema(id_menu,id_n2) @@ -585,38 +589,42 @@ function novoTema(id_menu,id_n2)
585 failure:core_handleFailure, 589 failure:core_handleFailure,
586 argument: { foo:"foo", bar:"bar" } 590 argument: { foo:"foo", bar:"bar" }
587 }; 591 };
588 - core_makeRequest(sUrl,callback) 592 + core_makeRequest(sUrl,callback);
589 } 593 }
590 function excluir(tipo,id) 594 function excluir(tipo,id)
591 { 595 {
592 - var mensagem = " excluindo o registro do id= "+id; 596 + var mensagem = " excluindo o registro do id= "+id,
  597 + no = null,
  598 + sUrl = null;
593 if(tipo == "raizgrupo" || tipo == "raizmenu") 599 if(tipo == "raizgrupo" || tipo == "raizmenu")
594 { 600 {
595 - var no = tree.getNodeByProperty("id_raiz",id)  
596 - var sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_raiz&idioma="+idiomaSel(); 601 + no = tree.getNodeByProperty("id_raiz",id);
  602 + sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_raiz&idioma="+idiomaSel();
597 } 603 }
598 604
599 if(tipo == "grupo") 605 if(tipo == "grupo")
600 { 606 {
601 - var no = tree.getNodeByProperty("id_n1",id)  
602 - var sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_n1&idioma="+idiomaSel(); 607 + no = tree.getNodeByProperty("id_n1",id);
  608 + sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_n1&idioma="+idiomaSel();
603 } 609 }
604 if(tipo == "subgrupo") 610 if(tipo == "subgrupo")
605 { 611 {
606 - var no = tree.getNodeByProperty("id_n2",id)  
607 - var sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_n2&idioma="+idiomaSel(); 612 + no = tree.getNodeByProperty("id_n2",id);
  613 + sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_n2&idioma="+idiomaSel();
608 } 614 }
609 if(tipo == "tema") 615 if(tipo == "tema")
610 { 616 {
611 - var no = tree.getNodeByProperty("id_n3",id)  
612 - var sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_n3&idioma="+idiomaSel(); 617 + no = tree.getNodeByProperty("id_n3",id);
  618 + sUrl = "../php/arvore.php?funcao=excluir&id="+id+"&tabela=i3geoadmin_n3&idioma="+idiomaSel();
613 } 619 }
614 - core_excluiNoTree(sUrl,no,mensagem) 620 + if(no && sUrl)
  621 + {core_excluiNoTree(sUrl,no,mensagem);}
615 } 622 }
616 function editar(tipo,id) 623 function editar(tipo,id)
617 { 624 {
618 core_carregando("ativa"); 625 core_carregando("ativa");
619 core_carregando(" buscando dados"); 626 core_carregando(" buscando dados");
  627 + var sUrl = null;
620 var callback = 628 var callback =
621 { 629 {
622 success:function(o) 630 success:function(o)
@@ -626,34 +634,34 @@ function editar(tipo,id) @@ -626,34 +634,34 @@ function editar(tipo,id)
626 if(tipo == "grupo") 634 if(tipo == "grupo")
627 { 635 {
628 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 636 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
629 - core_montaEditor("gravaDados('grupo','"+id+"')")  
630 - $i("editor_bd").innerHTML = montaDivGrupo(dados)  
631 - core_comboGrupos("comboGrupo","Eid_grupo",dados.id_grupo,"")  
632 - core_comboPerfis("comboPerfil","Eperfil_grupo","","registraPerfil(this.value,\"En1_perfil\")") 637 + core_montaEditor("gravaDados('grupo','"+id+"')");
  638 + $i("editor_bd").innerHTML = montaDivGrupo(dados);
  639 + core_comboGrupos("comboGrupo","Eid_grupo",dados.id_grupo,"");
  640 + core_comboPerfis("comboPerfil","Eperfil_grupo","","registraPerfil(this.value,\"En1_perfil\")");
633 } 641 }
634 if(tipo == "subgrupo") 642 if(tipo == "subgrupo")
635 { 643 {
636 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 644 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
637 - core_montaEditor("gravaDados('subgrupo','"+id+"')")  
638 - $i("editor_bd").innerHTML = montaDivSubGrupo(dados)  
639 - core_comboSubGrupos("comboSubGrupo","Eid_subgrupo",dados.id_subgrupo,"")  
640 - core_comboPerfis("comboPerfil","Eperfil_subgrupo","","registraPerfil(this.value,\"En2_perfil\")") 645 + core_montaEditor("gravaDados('subgrupo','"+id+"')");
  646 + $i("editor_bd").innerHTML = montaDivSubGrupo(dados);
  647 + core_comboSubGrupos("comboSubGrupo","Eid_subgrupo",dados.id_subgrupo,"");
  648 + core_comboPerfis("comboPerfil","Eperfil_subgrupo","","registraPerfil(this.value,\"En2_perfil\")");
641 } 649 }
642 if(tipo == "tema") 650 if(tipo == "tema")
643 { 651 {
644 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 652 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
645 - core_montaEditor("gravaDados('tema','"+id+"')")  
646 - $i("editor_bd").innerHTML = montaDivTema(dados)  
647 - core_comboTemas("comboTema","Eid_tema",dados.id_tema,"")  
648 - core_comboPerfis("comboPerfil","Eperfil_tema","","registraPerfil(this.value,\"En3_perfil\")") 653 + core_montaEditor("gravaDados('tema','"+id+"')");
  654 + $i("editor_bd").innerHTML = montaDivTema(dados);
  655 + core_comboTemas("comboTema","Eid_tema",dados.id_tema,"");
  656 + core_comboPerfis("comboPerfil","Eperfil_tema","","registraPerfil(this.value,\"En3_perfil\")");
649 } 657 }
650 if(tipo == "raizmenu" || tipo == "raizgrupo") 658 if(tipo == "raizmenu" || tipo == "raizgrupo")
651 { 659 {
652 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 660 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
653 - core_montaEditor("gravaDados('"+tipo+"','"+id+"')")  
654 - $i("editor_bd").innerHTML = montaDivRaiz(dados)  
655 - core_comboTemas("comboTema","Eid_tema",dados.id_tema,"")  
656 - core_comboPerfis("comboPerfil","Eperfil","","registraPerfil(this.value,\"Eperfil\")") 661 + core_montaEditor("gravaDados('"+tipo+"','"+id+"')");
  662 + $i("editor_bd").innerHTML = montaDivRaiz(dados);
  663 + core_comboTemas("comboTema","Eid_tema",dados.id_tema,"");
  664 + core_comboPerfis("comboPerfil","Eperfil","","registraPerfil(this.value,\"Eperfil\")");
657 } 665 }
658 core_carregando("desativa"); 666 core_carregando("desativa");
659 } 667 }
@@ -663,80 +671,81 @@ function editar(tipo,id) @@ -663,80 +671,81 @@ function editar(tipo,id)
663 argument: { foo:"foo", bar:"bar" } 671 argument: { foo:"foo", bar:"bar" }
664 }; 672 };
665 if(tipo == "grupo") 673 if(tipo == "grupo")
666 - {var sUrl = "../php/arvore.php?funcao=pegaDadosGrupo&id="+id+"&idioma="+idiomaSel();} 674 + {sUrl = "../php/arvore.php?funcao=pegaDadosGrupo&id="+id+"&idioma="+idiomaSel();}
667 if(tipo == "subgrupo") 675 if(tipo == "subgrupo")
668 - {var sUrl = "../php/arvore.php?funcao=pegaDadosSubGrupo&id="+id+"&idioma="+idiomaSel();} 676 + {sUrl = "../php/arvore.php?funcao=pegaDadosSubGrupo&id="+id+"&idioma="+idiomaSel();}
669 if(tipo == "tema") 677 if(tipo == "tema")
670 - {var sUrl = "../php/arvore.php?funcao=pegaDadosTema&id="+id+"&idioma="+idiomaSel();} 678 + {sUrl = "../php/arvore.php?funcao=pegaDadosTema&id="+id+"&idioma="+idiomaSel();}
671 if(tipo == "raizmenu" || tipo == "raizgrupo") 679 if(tipo == "raizmenu" || tipo == "raizgrupo")
672 - {var sUrl = "../php/arvore.php?funcao=pegaDadosRaiz&id="+id+"&idioma="+idiomaSel();}  
673 - core_makeRequest(sUrl,callback) 680 + {sUrl = "../php/arvore.php?funcao=pegaDadosRaiz&id="+id+"&idioma="+idiomaSel();}
  681 + if(sUrl)
  682 + {core_makeRequest(sUrl,callback);}
674 } 683 }
675 function montaDivGrupo(i) 684 function montaDivGrupo(i)
676 { 685 {
677 - var ins = "<br>Escolha o grupo para esse nó:<br><br>"  
678 - ins += "<div id=comboGrupo >Buscando...</div>"  
679 - ins += "<p>Perfis que podem ver: </p>"  
680 - ins += "<input size=50 type=text id='En1_perfil' value='"+i.n1_perfil+"' /></p>" 686 + var ins = "<br>Escolha o grupo para esse nó:<br><br>";
  687 + ins += "<div id=comboGrupo >Buscando...</div>";
  688 + ins += "<p>Perfis que podem ver: </p>";
  689 + ins += "<input size=50 type=text id='En1_perfil' value='"+i.n1_perfil+"' /></p>";
681 ins += "<div id=comboPerfil >Buscando...</div>"; 690 ins += "<div id=comboPerfil >Buscando...</div>";
682 - ins += "<br>Publicado?<br>"  
683 - ins += "<select id='Epublicado' >"  
684 - ins += core_combosimnao(i.publicado)  
685 - ins += "</select>"  
686 - ins += "<br><br><br><br>"  
687 - ins += "<input type=hidden value="+i.ordem+" id='Eordem' />"  
688 - return(ins) 691 + ins += "<br>Publicado?<br>";
  692 + ins += "<select id='Epublicado' >";
  693 + ins += core_combosimnao(i.publicado);
  694 + ins += "</select>";
  695 + ins += "<br><br><br><br>";
  696 + ins += "<input type=hidden value="+i.ordem+" id='Eordem' />";
  697 + return(ins);
689 } 698 }
690 function montaDivSubGrupo(i) 699 function montaDivSubGrupo(i)
691 { 700 {
692 - var ins = "<br>Escolha o sub-grupo para esse nó:<br><br>"  
693 - ins += "<div id=comboSubGrupo >Buscando...</div>"  
694 - ins += "<p>Perfis que podem ver: </p>"  
695 - ins += "<input size=50 type=text id='En2_perfil' value='"+i.n2_perfil+"' /></p>" 701 + var ins = "<br>Escolha o sub-grupo para esse nó:<br><br>";
  702 + ins += "<div id=comboSubGrupo >Buscando...</div>";
  703 + ins += "<p>Perfis que podem ver: </p>";
  704 + ins += "<input size=50 type=text id='En2_perfil' value='"+i.n2_perfil+"' /></p>";
696 ins += "<div id=comboPerfil >Buscando...</div>"; 705 ins += "<div id=comboPerfil >Buscando...</div>";
697 - ins += "<br>Publicado?<br>"  
698 - ins += "<select id='Epublicado' >"  
699 - ins += core_combosimnao(i.publicado)  
700 - ins += "</select>"  
701 - ins += "<br><br><br><br>"  
702 - ins += "<input type=hidden value="+i.ordem+" id='Eordem' />"  
703 - return(ins) 706 + ins += "<br>Publicado?<br>";
  707 + ins += "<select id='Epublicado' >";
  708 + ins += core_combosimnao(i.publicado);
  709 + ins += "</select>";
  710 + ins += "<br><br><br><br>";
  711 + ins += "<input type=hidden value="+i.ordem+" id='Eordem' />";
  712 + return(ins);
704 } 713 }
705 function montaDivTema(i) 714 function montaDivTema(i)
706 { 715 {
707 - var ins = "<br>Escolha o tema para esse nó:<br><br>"  
708 - ins += "<div id=comboTema >Buscando...</div>"  
709 - ins += "<p>Perfis que podem ver: </p>"  
710 - ins += "<input type=text id='En3_perfil' value='"+i.n3_perfil+"' /></p>" 716 + var ins = "<br>Escolha o tema para esse nó:<br><br>";
  717 + ins += "<div id=comboTema >Buscando...</div>";
  718 + ins += "<p>Perfis que podem ver: </p>";
  719 + ins += "<input type=text id='En3_perfil' value='"+i.n3_perfil+"' /></p>";
711 ins += "<div id=comboPerfil >Buscando...</div>"; 720 ins += "<div id=comboPerfil >Buscando...</div>";
712 - ins += "<br>Publicado?<br>"  
713 - ins += "<select id='Epublicado' >"  
714 - ins += core_combosimnao(i.publicado)  
715 - ins += "</select>"  
716 - ins += "<br>Ordem<br>"  
717 - ins += "<input size=10 type=text value="+i.ordem+" id='Eordem' />"  
718 - return(ins) 721 + ins += "<br>Publicado?<br>";
  722 + ins += "<select id='Epublicado' >";
  723 + ins += core_combosimnao(i.publicado);
  724 + ins += "</select>";
  725 + ins += "<br>Ordem<br>";
  726 + ins += "<input size=10 type=text value="+i.ordem+" id='Eordem' />";;
  727 + return(ins);
719 } 728 }
720 function montaDivRaiz(i) 729 function montaDivRaiz(i)
721 { 730 {
722 - var ins = "<br>Tema:<br><br>"  
723 - ins += "<div id=comboTema >Buscando...</div>"  
724 - ins += "<p>Perfis que podem ver: </p>"  
725 - ins += "<input size=50 type=text id='Eperfil' value='"+i.perfil+"' /></p>" 731 + var ins = "<br>Tema:<br><br>";
  732 + ins += "<div id=comboTema >Buscando...</div>";
  733 + ins += "<p>Perfis que podem ver: </p>";
  734 + ins += "<input size=50 type=text id='Eperfil' value='"+i.perfil+"' /></p>";
726 ins += "<div id=comboPerfil >Buscando...</div>"; 735 ins += "<div id=comboPerfil >Buscando...</div>";
727 - ins += "<br><br>Para criar um novo mapfile clique <a href='../html/editormapfile.html' target=_blank >aqui</a>."  
728 - ins += "<br><br>Para criar um novo perfil clique <a href='../html/perfis.html' target=_blank >aqui</a>."  
729 - ins += "<input type=hidden value="+i.ordem+" id='Eordem' />"  
730 - return(ins) 736 + ins += "<br><br>Para criar um novo mapfile clique <a href='../html/editormapfile.html' target=_blank >aqui</a>.";
  737 + ins += "<br><br>Para criar um novo perfil clique <a href='../html/perfis.html' target=_blank >aqui</a>.";
  738 + ins += "<input type=hidden value="+i.ordem+" id='Eordem' />";
  739 + return(ins);
731 } 740 }
732 function registraPerfil(valor,id) 741 function registraPerfil(valor,id)
733 { 742 {
734 - var inp = $i(id)  
735 - var perfis = inp.value 743 + var inp = $i(id);
  744 + var perfis = inp.value;
736 if(perfis == "") 745 if(perfis == "")
737 - inp.value = valor 746 + inp.value = valor;
738 else 747 else
739 - inp.value = perfis+" "+valor 748 + inp.value = perfis+" "+valor;
740 } 749 }
741 /* 750 /*
742 Function: gravaDados 751 Function: gravaDados
@@ -753,33 +762,35 @@ Altera dados de um nó @@ -753,33 +762,35 @@ Altera dados de um nó
753 */ 762 */
754 function gravaDados(tipo,id) 763 function gravaDados(tipo,id)
755 { 764 {
  765 + var campos = [];
  766 + var par = null;
  767 + var prog = null;
756 if(tipo == "grupo") 768 if(tipo == "grupo")
757 { 769 {
758 - var campos = new Array("id_grupo","n1_perfil","publicado","ordem")  
759 - var par = "&id="+id  
760 - var prog = "../php/arvore.php?funcao=alterarGrupo&idioma="+idiomaSel(); 770 + campos = new Array("id_grupo","n1_perfil","publicado","ordem");
  771 + par = "&id="+id;
  772 + prog = "../php/arvore.php?funcao=alterarGrupo&idioma="+idiomaSel();
761 } 773 }
762 if(tipo == "subgrupo") 774 if(tipo == "subgrupo")
763 { 775 {
764 - var campos = new Array("id_subgrupo","n2_perfil","publicado","ordem")  
765 - var par = "&id="+id  
766 - var prog = "../php/arvore.php?funcao=alterarSubGrupo&idioma="+idiomaSel(); 776 + campos = new Array("id_subgrupo","n2_perfil","publicado","ordem");
  777 + par = "&id="+id;
  778 + prog = "../php/arvore.php?funcao=alterarSubGrupo&idioma="+idiomaSel();
767 } 779 }
768 if(tipo == "tema") 780 if(tipo == "tema")
769 { 781 {
770 - var campos = new Array("id_tema","n3_perfil","publicado","ordem")  
771 - var par = "&id="+id  
772 - var prog = "../php/arvore.php?funcao=alterarTema&idioma="+idiomaSel() 782 + campos = new Array("id_tema","n3_perfil","publicado","ordem");
  783 + par = "&id="+id;
  784 + prog = "../php/arvore.php?funcao=alterarTema&idioma="+idiomaSel();
773 } 785 }
774 if(tipo == "raizmenu" || tipo == "raizgrupo") 786 if(tipo == "raizmenu" || tipo == "raizgrupo")
775 { 787 {
776 - var campos = new Array("id_tema","perfil","ordem")  
777 - var par = "&id="+id  
778 - var prog = "../php/arvore.php?funcao=alterarRaiz&idioma="+idiomaSel() 788 + campos = new Array("id_tema","perfil","ordem");
  789 + par = "&id="+id;
  790 + prog = "../php/arvore.php?funcao=alterarRaiz&idioma="+idiomaSel();
779 } 791 }
780 -  
781 - for (i=0;i<campos.length;i++)  
782 - {par += "&"+campos[i]+"="+($i("E"+campos[i]).value)} 792 + for (var i=0;i<campos.length;i++)
  793 + {par += "&"+campos[i]+"="+($i("E"+campos[i]).value);}
783 core_carregando("ativa"); 794 core_carregando("ativa");
784 core_carregando(" gravando o registro do id= "+id); 795 core_carregando(" gravando o registro do id= "+id);
785 var sUrl = prog+par; 796 var sUrl = prog+par;
@@ -792,71 +803,71 @@ function gravaDados(tipo,id) @@ -792,71 +803,71 @@ function gravaDados(tipo,id)
792 if(YAHOO.lang.JSON.parse(o.responseText) == "erro") 803 if(YAHOO.lang.JSON.parse(o.responseText) == "erro")
793 { 804 {
794 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem menus vinculados a este tema</span>"); 805 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem menus vinculados a este tema</span>");
795 - setTimeout("core_carregando('desativa')",3000) 806 + setTimeout("core_carregando('desativa')",3000);
796 } 807 }
797 else 808 else
798 { 809 {
799 if(tipo == "grupo") 810 if(tipo == "grupo")
800 { 811 {
801 - var obj = document.getElementById("Eid_grupo")  
802 - var texto = obj.options[obj.selectedIndex].text 812 + var obj = document.getElementById("Eid_grupo");
  813 + var texto = obj.options[obj.selectedIndex].text;
803 814
804 - var objpub = document.getElementById("Epublicado")  
805 - var publicado = objpub.options[objpub.selectedIndex].value 815 + var objpub = document.getElementById("Epublicado");
  816 + var publicado = objpub.options[objpub.selectedIndex].value;
806 817
807 - var no = tree.getNodeByProperty("id_n1",id)  
808 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto 818 + var no = tree.getNodeByProperty("id_n1",id);
  819 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
809 820
810 if(publicado == "NAO") 821 if(publicado == "NAO")
811 - no.getContentEl().getElementsByTagName("span")[0].style.color = "red" 822 + no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
812 else 823 else
813 - no.getContentEl().getElementsByTagName("span")[0].style.color = "black" 824 + no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
814 825
815 no.html = no.getContentEl().innerHTML; 826 no.html = no.getContentEl().innerHTML;
816 } 827 }
817 if(tipo == "subgrupo") 828 if(tipo == "subgrupo")
818 { 829 {
819 - var obj = document.getElementById("Eid_subgrupo")  
820 - var texto = obj.options[obj.selectedIndex].text 830 + var obj = document.getElementById("Eid_subgrupo");
  831 + var texto = obj.options[obj.selectedIndex].text;
821 832
822 - var objpub = document.getElementById("Epublicado")  
823 - var publicado = objpub.options[objpub.selectedIndex].value 833 + var objpub = document.getElementById("Epublicado");
  834 + var publicado = objpub.options[objpub.selectedIndex].value;
824 835
825 - var no = tree.getNodeByProperty("id_n2",id)  
826 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto 836 + var no = tree.getNodeByProperty("id_n2",id);
  837 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
827 838
828 if(publicado == "NAO") 839 if(publicado == "NAO")
829 - no.getContentEl().getElementsByTagName("span")[0].style.color = "red" 840 + no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
830 else 841 else
831 - no.getContentEl().getElementsByTagName("span")[0].style.color = "black" 842 + no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
832 843
833 no.html = no.getContentEl().innerHTML; 844 no.html = no.getContentEl().innerHTML;
834 } 845 }
835 if(tipo == "tema") 846 if(tipo == "tema")
836 { 847 {
837 - var obj = document.getElementById("Eid_tema")  
838 - var texto = obj.options[obj.selectedIndex].text 848 + var obj = document.getElementById("Eid_tema");
  849 + var texto = obj.options[obj.selectedIndex].text;
839 850
840 - var objpub = document.getElementById("Epublicado")  
841 - var publicado = objpub.options[objpub.selectedIndex].value 851 + var objpub = document.getElementById("Epublicado");
  852 + var publicado = objpub.options[objpub.selectedIndex].value;
842 853
843 - var no = tree.getNodeByProperty("id_n3",id) 854 + var no = tree.getNodeByProperty("id_n3",id);
844 855
845 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto 856 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
846 857
847 if(publicado == "NAO") 858 if(publicado == "NAO")
848 - no.getContentEl().getElementsByTagName("span")[0].style.color = "red" 859 + no.getContentEl().getElementsByTagName("span")[0].style.color = "red";
849 else 860 else
850 - no.getContentEl().getElementsByTagName("span")[0].style.color = "black" 861 + no.getContentEl().getElementsByTagName("span")[0].style.color = "black";
851 862
852 no.html = no.getContentEl().innerHTML; 863 no.html = no.getContentEl().innerHTML;
853 } 864 }
854 if(tipo == "raizmenu" || tipo == "raizgrupo") 865 if(tipo == "raizmenu" || tipo == "raizgrupo")
855 { 866 {
856 - var obj = document.getElementById("Eid_tema")  
857 - var texto = obj.options[obj.selectedIndex].text  
858 - var no = tree.getNodeByProperty("id_raiz",id)  
859 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto 867 + var obj = document.getElementById("Eid_tema");
  868 + var texto = obj.options[obj.selectedIndex].text;
  869 + var no = tree.getNodeByProperty("id_raiz",id);
  870 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto;
860 no.html = no.getContentEl().innerHTML; 871 no.html = no.getContentEl().innerHTML;
861 } 872 }
862 core_carregando("desativa"); 873 core_carregando("desativa");
@@ -869,29 +880,31 @@ function gravaDados(tipo,id) @@ -869,29 +880,31 @@ function gravaDados(tipo,id)
869 failure:core_handleFailure, 880 failure:core_handleFailure,
870 argument: { foo:"foo", bar:"bar" } 881 argument: { foo:"foo", bar:"bar" }
871 }; 882 };
872 - core_makeRequest(sUrl,callback,'POST') 883 + core_makeRequest(sUrl,callback,'POST');
873 } 884 }
874 function sobeDesce(movimento,tipo,id) 885 function sobeDesce(movimento,tipo,id)
875 { 886 {
  887 + var no = null,
  888 + movimenta = null;
876 if(tipo == "raizmenu" || tipo == "raizgrupo") 889 if(tipo == "raizmenu" || tipo == "raizgrupo")
877 { 890 {
878 - var no = tree.getNodeByProperty("id_raiz",id)  
879 - var movimenta = core_movimentaNo(movimento,no) 891 + no = tree.getNodeByProperty("id_raiz",id);
  892 + movimenta = core_movimentaNo(movimento,no);
880 } 893 }
881 if(tipo == "grupo") 894 if(tipo == "grupo")
882 { 895 {
883 - var no = tree.getNodeByProperty("id_n1",id)  
884 - var movimenta = core_movimentaNo(movimento,no) 896 + no = tree.getNodeByProperty("id_n1",id);
  897 + movimenta = core_movimentaNo(movimento,no);
885 } 898 }
886 if(tipo == "subgrupo") 899 if(tipo == "subgrupo")
887 { 900 {
888 - var no = tree.getNodeByProperty("id_n2",id)  
889 - var movimenta = core_movimentaNo(movimento,no) 901 + no = tree.getNodeByProperty("id_n2",id);
  902 + movimenta = core_movimentaNo(movimento,no);
890 } 903 }
891 if(tipo == "tema") 904 if(tipo == "tema")
892 { 905 {
893 - var no = tree.getNodeByProperty("id_n3",id)  
894 - var movimenta = core_movimentaNo(movimento,no) 906 + no = tree.getNodeByProperty("id_n3",id);
  907 + movimenta = core_movimentaNo(movimento,no);
895 } 908 }
896 var callback = 909 var callback =
897 { 910 {
@@ -905,7 +918,7 @@ function sobeDesce(movimento,tipo,id) @@ -905,7 +918,7 @@ function sobeDesce(movimento,tipo,id)
905 var sUrl = "../php/arvore.php?funcao=movimentaNo&tipo="+tipo+"&movimento="+movimento+"&id="+id+"&idioma="+idiomaSel(); 918 var sUrl = "../php/arvore.php?funcao=movimentaNo&tipo="+tipo+"&movimento="+movimento+"&id="+id+"&idioma="+idiomaSel();
906 core_carregando("ativa"); 919 core_carregando("ativa");
907 core_carregando(" modificando a ordem no banco de dados"); 920 core_carregando(" modificando a ordem no banco de dados");
908 - core_makeRequest(sUrl,callback) 921 + core_makeRequest(sUrl,callback);
909 } 922 }
910 } 923 }
911 YAHOO.util.Event.addListener(window, "load", initMenu); 924 YAHOO.util.Event.addListener(window, "load", initMenu);
912 \ No newline at end of file 925 \ No newline at end of file
admin/js/atlas.js
@@ -37,7 +37,7 @@ Inicializa o editor @@ -37,7 +37,7 @@ Inicializa o editor
37 */ 37 */
38 function initMenu() 38 function initMenu()
39 { 39 {
40 - ativaBotaoAdicionaAtlas("../php/atlas.php?funcao=alterarAtlas","adiciona") 40 + ativaBotaoAdicionaAtlas("../php/atlas.php?funcao=alterarAtlas","adiciona");
41 core_carregando("ativa"); 41 core_carregando("ativa");
42 core_ativaPainelAjuda("ajuda","botaoAjuda"); 42 core_ativaPainelAjuda("ajuda","botaoAjuda");
43 core_pegaPerfis("pegaAtlas()"); 43 core_pegaPerfis("pegaAtlas()");
@@ -64,10 +64,10 @@ function ativaBotaoAdicionaAtlas(sUrl,idBotao) @@ -64,10 +64,10 @@ function ativaBotaoAdicionaAtlas(sUrl,idBotao)
64 failure:core_handleFailure, 64 failure:core_handleFailure,
65 argument: { foo:"foo", bar:"bar" } 65 argument: { foo:"foo", bar:"bar" }
66 }; 66 };
67 - core_makeRequest(sUrl,callback) 67 + core_makeRequest(sUrl,callback);
68 }; 68 };
69 //cria o botão de adição de um novo menu 69 //cria o botão de adição de um novo menu
70 - var adiciona = new YAHOO.widget.Button(idBotao,{ onclick: { fn: adiciona } }); 70 + new YAHOO.widget.Button(idBotao,{ onclick: { fn: adiciona } });
71 } 71 }
72 /* 72 /*
73 Function: pegaAtlas 73 Function: pegaAtlas
@@ -78,7 +78,7 @@ Obtém a lista de atlas @@ -78,7 +78,7 @@ Obtém a lista de atlas
78 */ 78 */
79 function pegaAtlas() 79 function pegaAtlas()
80 { 80 {
81 - core_pegaDados("buscando atlas...","../php/atlas.php?funcao=pegaAtlas","montaArvore") 81 + core_pegaDados("buscando atlas...","../php/atlas.php?funcao=pegaAtlas","montaArvore");
82 } 82 }
83 /* 83 /*
84 Function: montaArvore 84 Function: montaArvore
@@ -91,13 +91,9 @@ function montaArvore(dados) @@ -91,13 +91,9 @@ function montaArvore(dados)
91 { 91 {
92 YAHOO.example.treeExample = new function() 92 YAHOO.example.treeExample = new function()
93 { 93 {
94 - var currentIconMode;  
95 tree = ""; 94 tree = "";
96 function changeIconMode() 95 function changeIconMode()
97 { 96 {
98 - var newVal = parseInt(this.value);  
99 - if (newVal != currentIconMode)  
100 - {currentIconMode = newVal;}  
101 buildTree(); 97 buildTree();
102 } 98 }
103 function loadNodeData(node, fnLoadComplete) 99 function loadNodeData(node, fnLoadComplete)
@@ -107,8 +103,8 @@ function montaArvore(dados) @@ -107,8 +103,8 @@ function montaArvore(dados)
107 { 103 {
108 success: function(oResponse) 104 success: function(oResponse)
109 { 105 {
110 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText)  
111 - adicionaNosPranchas(node,dados,false) 106 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
  107 + adicionaNosPranchas(node,dados,false);
112 oResponse.argument.fnLoadComplete(); 108 oResponse.argument.fnLoadComplete();
113 }, 109 },
114 failure: function(oResponse) 110 failure: function(oResponse)
@@ -127,7 +123,7 @@ function montaArvore(dados) @@ -127,7 +123,7 @@ function montaArvore(dados)
127 function buildTree() 123 function buildTree()
128 { 124 {
129 tree = new YAHOO.widget.TreeView("tabela"); 125 tree = new YAHOO.widget.TreeView("tabela");
130 - tree.setDynamicLoad(loadNodeData, currentIconMode); 126 + tree.setDynamicLoad(loadNodeData, 1);
131 var root = tree.getRoot(); 127 var root = tree.getRoot();
132 var tempNode = new YAHOO.widget.TextNode('', root, false); 128 var tempNode = new YAHOO.widget.TextNode('', root, false);
133 tempNode.isLeaf = true; 129 tempNode.isLeaf = true;
@@ -135,19 +131,19 @@ function montaArvore(dados) @@ -135,19 +131,19 @@ function montaArvore(dados)
135 } 131 }
136 buildTree(); 132 buildTree();
137 }(); 133 }();
138 - adicionaNosAtlas(dados) 134 + adicionaNosAtlas(dados);
139 tree.draw(); 135 tree.draw();
140 } 136 }
141 function testarMapfile(codigoMap) 137 function testarMapfile(codigoMap)
142 { 138 {
143 - window.open("../../testamapfile.php?map="+codigoMap+".map") 139 + window.open("../../testamapfile.php?map="+codigoMap+".map");
144 } 140 }
145 function adicionaNosTemas(no,dados,redesenha) 141 function adicionaNosTemas(no,dados,redesenha)
146 { 142 {
147 if(!redesenha) 143 if(!redesenha)
148 { 144 {
149 - var conteudo = "<span onclick=\"adicionarTema('"+no.data.id_prancha+"')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:0px\" width='10px' heigth='10px' src=\"../imagens/05.png\" /><i>Adicionar novo tema:</i></span>"  
150 - var d = {html:conteudo} 145 + var conteudo = "<span onclick=\"adicionarTema('"+no.data.id_prancha+"')\" style=\"cursor:pointer;\" ><img style=\"position:relative;top:0px\" width='10px' heigth='10px' src=\"../imagens/05.png\" /><i>Adicionar novo tema:</i></span>";
  146 + var d = {html:conteudo};
151 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 147 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
152 tempNode.isLeaf = true; 148 tempNode.isLeaf = true;
153 } 149 }
@@ -155,16 +151,16 @@ function adicionaNosTemas(no,dados,redesenha) @@ -155,16 +151,16 @@ function adicionaNosTemas(no,dados,redesenha)
155 { 151 {
156 if(dados[i].nome_tema == "null" || !dados[i].nome_tema || dados[i].codigo_tema == "") 152 if(dados[i].nome_tema == "null" || !dados[i].nome_tema || dados[i].codigo_tema == "")
157 {dados[i].nome_tema = "";} 153 {dados[i].nome_tema = "";}
158 - var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','tema','"+dados[i].id_tema+"')\" title=sobe src=\"../imagens/34.png\" />"  
159 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','tema','"+dados[i].id_tema+"')\" title=desce src=\"../imagens/33.png\" />"  
160 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('tema','"+dados[i].id_tema+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />"  
161 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"testarMapfile('"+dados[i].codigo_tema+"')\" title=testar width='10px' heigth='10px' src=\"../imagens/41.png\" />"  
162 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('tema','"+dados[i].id_tema+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />" 154 + var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','tema','"+dados[i].id_tema+"')\" title=sobe src=\"../imagens/34.png\" />";
  155 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','tema','"+dados[i].id_tema+"')\" title=desce src=\"../imagens/33.png\" />";
  156 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('tema','"+dados[i].id_tema+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";
  157 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"testarMapfile('"+dados[i].codigo_tema+"')\" title=testar width='10px' heigth='10px' src=\"../imagens/41.png\" />";
  158 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('tema','"+dados[i].id_tema+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />";
163 if(dados[i].codigo_tema != "") 159 if(dados[i].codigo_tema != "")
164 - {conteudo += "&nbsp;<span>"+dados[i].codigo_tema+" - </span><span style=color:gray >"+dados[i].nome_tema+"</span>"} 160 + {conteudo += "&nbsp;<span>"+dados[i].codigo_tema+" - </span><span style=color:gray >"+dados[i].nome_tema+"</span>";}
165 else 161 else
166 - {conteudo += "&nbsp;<span style=color:red >Edite para definir o tema!!!</span>"}  
167 - var d = {html:conteudo,id_tema:dados[i].id_tema,tipo:"tema"} 162 + {conteudo += "&nbsp;<span style=color:red >Edite para definir o tema!!!</span>";}
  163 + var d = {html:conteudo,id_tema:dados[i].id_tema,tipo:"tema"};
168 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 164 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
169 tempNode.isLeaf = true; 165 tempNode.isLeaf = true;
170 } 166 }
@@ -192,8 +188,8 @@ function adicionaNosPranchas(no,dados,redesenha) @@ -192,8 +188,8 @@ function adicionaNosPranchas(no,dados,redesenha)
192 { 188 {
193 success: function(oResponse) 189 success: function(oResponse)
194 { 190 {
195 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText)  
196 - adicionaNosTemas(node,dados,false) 191 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
  192 + adicionaNosTemas(node,dados,false);
197 oResponse.argument.fnLoadComplete(); 193 oResponse.argument.fnLoadComplete();
198 }, 194 },
199 failure: function(oResponse) 195 failure: function(oResponse)
@@ -211,22 +207,22 @@ function adicionaNosPranchas(no,dados,redesenha) @@ -211,22 +207,22 @@ function adicionaNosPranchas(no,dados,redesenha)
211 } 207 }
212 if(!redesenha) 208 if(!redesenha)
213 { 209 {
214 - var conteudo = "<span style=\"cursor:pointer;\" onclick=\"adicionarPrancha('"+no.data.id_atlas+"')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i>Adicionar nova prancha</i></span>"  
215 - var d = {html:conteudo} 210 + var conteudo = "<span style=\"cursor:pointer;\" onclick=\"adicionarPrancha('"+no.data.id_atlas+"')\" ><img style=\"position:relative;top:2px\" src=\"../imagens/05.png\" /><i>Adicionar nova prancha</i></span>";
  211 + var d = {html:conteudo};
216 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 212 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
217 tempNode.isLeaf = true; 213 tempNode.isLeaf = true;
218 } 214 }
219 for (var i=0, j=dados.length; i<j; i++) 215 for (var i=0, j=dados.length; i<j; i++)
220 { 216 {
221 - var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','prancha','"+dados[i].id_prancha+"')\" title=sobe src=\"../imagens/34.png\" />"  
222 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','prancha','"+dados[i].id_prancha+"')\" title=desce src=\"../imagens/33.png\" />"  
223 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('prancha','"+dados[i].id_prancha+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />"  
224 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('prancha','"+dados[i].id_prancha+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />" 217 + var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','prancha','"+dados[i].id_prancha+"')\" title=sobe src=\"../imagens/34.png\" />";
  218 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','prancha','"+dados[i].id_prancha+"')\" title=desce src=\"../imagens/33.png\" />";
  219 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('prancha','"+dados[i].id_prancha+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />";
  220 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('prancha','"+dados[i].id_prancha+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" />";
225 if(dados[i].titulo_prancha != "") 221 if(dados[i].titulo_prancha != "")
226 - {conteudo += "&nbsp;<span>"+dados[i].titulo_prancha+"</span>"} 222 + {conteudo += "&nbsp;<span>"+dados[i].titulo_prancha+"</span>";}
227 else 223 else
228 - {conteudo += "&nbsp;<span style=color:red >Edite para definir a prancha!!!</span>"}  
229 - var d = {html:conteudo,id_prancha:dados[i].id_prancha,tipo:"prancha"} 224 + {conteudo += "&nbsp;<span style=color:red >Edite para definir a prancha!!!</span>";}
  225 + var d = {html:conteudo,id_prancha:dados[i].id_prancha,tipo:"prancha"};
230 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); 226 var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true);
231 //tempNode.isLeaf = true; 227 //tempNode.isLeaf = true;
232 tempNode.setDynamicLoad(loadTemasData, temaIconMode); 228 tempNode.setDynamicLoad(loadTemasData, temaIconMode);
@@ -238,17 +234,17 @@ function adicionaNosAtlas(dados,redesenha) @@ -238,17 +234,17 @@ function adicionaNosAtlas(dados,redesenha)
238 var root = tree.getRoot(); 234 var root = tree.getRoot();
239 for (var i=0, j=dados.length; i<j; i++) 235 for (var i=0, j=dados.length; i<j; i++)
240 { 236 {
241 - var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','atlas','"+dados[i].id_atlas+"')\" title=sobe src=\"../imagens/34.png\" />"  
242 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','atlas','"+dados[i].id_atlas+"')\" title=desce src=\"../imagens/33.png\" />"  
243 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluir('atlas','"+dados[i].id_atlas+"')\" title=excluir src=\"../imagens/01.png\" />"  
244 - conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editar('atlas','"+dados[i].id_atlas+"')\" title=editar src=\"../imagens/06.png\" /><b>"  
245 - conteudo += "&nbsp;<img style=\"width:25px;position:relative;cursor:pointer;top:2px\" onclick=\"abreAtlas('"+dados[i].id_atlas+"')\" title=editar src=\"../../imagens/i3geo2.jpg\" /><b>" 237 + var conteudo = "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','atlas','"+dados[i].id_atlas+"')\" title=sobe src=\"../imagens/34.png\" />";
  238 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','atlas','"+dados[i].id_atlas+"')\" title=desce src=\"../imagens/33.png\" />";
  239 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluir('atlas','"+dados[i].id_atlas+"')\" title=excluir src=\"../imagens/01.png\" />";
  240 + conteudo += "&nbsp;<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"editar('atlas','"+dados[i].id_atlas+"')\" title=editar src=\"../imagens/06.png\" /><b>";
  241 + conteudo += "&nbsp;<img style=\"width:25px;position:relative;cursor:pointer;top:2px\" onclick=\"abreAtlas('"+dados[i].id_atlas+"')\" title=editar src=\"../../imagens/i3geo2.jpg\" /><b>";
246 if(dados[i].titulo_atlas != "") 242 if(dados[i].titulo_atlas != "")
247 - {conteudo += "&nbsp;<span>"+dados[i].titulo_atlas+"</span>"} 243 + {conteudo += "&nbsp;<span>"+dados[i].titulo_atlas+"</span>";}
248 else 244 else
249 - {conteudo += "&nbsp;<span style=color:red >Edite para definir o Atlas!!!</span>"} 245 + {conteudo += "&nbsp;<span style=color:red >Edite para definir o Atlas!!!</span>";}
250 var d = {html:conteudo,id_atlas:dados[i].id_atlas,tipo:"atlas"}; 246 var d = {html:conteudo,id_atlas:dados[i].id_atlas,tipo:"atlas"};
251 - var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 247 + new YAHOO.widget.HTMLNode(d, root, false,true);
252 } 248 }
253 if(redesenha){tree.draw();} 249 if(redesenha){tree.draw();}
254 } 250 }
@@ -267,6 +263,7 @@ function editar(tipo,id) @@ -267,6 +263,7 @@ function editar(tipo,id)
267 { 263 {
268 core_carregando("ativa"); 264 core_carregando("ativa");
269 core_carregando(" buscando dados"); 265 core_carregando(" buscando dados");
  266 + var sUrl = null;
270 var callback = 267 var callback =
271 { 268 {
272 success:function(o) 269 success:function(o)
@@ -276,25 +273,25 @@ function editar(tipo,id) @@ -276,25 +273,25 @@ function editar(tipo,id)
276 if(tipo == "atlas") 273 if(tipo == "atlas")
277 { 274 {
278 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 275 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
279 - core_montaEditor("gravaDados('atlas','"+id+"')")  
280 - $i("editor_bd").innerHTML = montaDivAtlas(dados) 276 + core_montaEditor("gravaDados('atlas','"+id+"')");
  277 + $i("editor_bd").innerHTML = montaDivAtlas(dados);
281 core_carregando("desativa"); 278 core_carregando("desativa");
282 - core_comboPranchas("comboPranchaIni","Epranchadefault_atlas",dados.pranchadefault_atlas,"",id) 279 + core_comboPranchas("comboPranchaIni","Epranchadefault_atlas",dados.pranchadefault_atlas,"",id);
283 } 280 }
284 if(tipo == "prancha") 281 if(tipo == "prancha")
285 { 282 {
286 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 283 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
287 - core_montaEditor("gravaDados('prancha','"+id+"')")  
288 - $i("editor_bd").innerHTML = montaDivPrancha(dados) 284 + core_montaEditor("gravaDados('prancha','"+id+"')");
  285 + $i("editor_bd").innerHTML = montaDivPrancha(dados);
289 core_carregando("desativa"); 286 core_carregando("desativa");
290 } 287 }
291 if(tipo == "tema") 288 if(tipo == "tema")
292 { 289 {
293 var dados = YAHOO.lang.JSON.parse(o.responseText)[0]; 290 var dados = YAHOO.lang.JSON.parse(o.responseText)[0];
294 - core_montaEditor("gravaDados('tema','"+id+"')")  
295 - $i("editor_bd").innerHTML = montaDivTema(dados) 291 + core_montaEditor("gravaDados('tema','"+id+"')");
  292 + $i("editor_bd").innerHTML = montaDivTema(dados);
296 core_carregando("desativa"); 293 core_carregando("desativa");
297 - core_comboMapfiles("comboTemaIni","Ecodigo_tema",dados.codigo_tema,"",true) 294 + core_comboMapfiles("comboTemaIni","Ecodigo_tema",dados.codigo_tema,"",true);
298 } 295 }
299 core_carregando("desativa"); 296 core_carregando("desativa");
300 } 297 }
@@ -304,25 +301,26 @@ function editar(tipo,id) @@ -304,25 +301,26 @@ function editar(tipo,id)
304 argument: { foo:"foo", bar:"bar" } 301 argument: { foo:"foo", bar:"bar" }
305 }; 302 };
306 if(tipo == "atlas") 303 if(tipo == "atlas")
307 - {var sUrl = "../php/atlas.php?funcao=pegaDadosAtlas&id_atlas="+id;} 304 + {sUrl = "../php/atlas.php?funcao=pegaDadosAtlas&id_atlas="+id;}
308 if(tipo == "prancha") 305 if(tipo == "prancha")
309 - {var sUrl = "../php/atlas.php?funcao=pegaDadosPrancha&id_prancha="+id;} 306 + {sUrl = "../php/atlas.php?funcao=pegaDadosPrancha&id_prancha="+id;}
310 if(tipo == "tema") 307 if(tipo == "tema")
311 - {var sUrl = "../php/atlas.php?funcao=pegaDadosTema&id_tema="+id;}  
312 - core_makeRequest(sUrl,callback) 308 + {sUrl = "../php/atlas.php?funcao=pegaDadosTema&id_tema="+id;}
  309 + if(sUrl)
  310 + {core_makeRequest(sUrl,callback);}
313 } 311 }
314 function montaDivTema(i) 312 function montaDivTema(i)
315 { 313 {
316 - var ins = ""  
317 - ins += "<br>Código do tema:<br>"  
318 - ins += "<div id=comboTemaIni ></div>"  
319 -  
320 - ins += "Ligado (ao abrir a prancha, esse tema estará visível)?<br>"  
321 - ins += "<select id='Eligado_tema' >"  
322 - ins += core_combosimnao(i.ligado_tema)  
323 - ins += "</select>"  
324 - ins += "<input type=hidden value='"+i.ordem_tema+"' id='Eordem_tema' />"  
325 - return(ins) 314 + var ins = "";
  315 + ins += "<br>Código do tema:<br>";
  316 + ins += "<div id=comboTemaIni ></div>";
  317 +
  318 + ins += "Ligado (ao abrir a prancha, esse tema estará visível)?<br>";
  319 + ins += "<select id='Eligado_tema' >";
  320 + ins += core_combosimnao(i.ligado_tema);
  321 + ins += "</select>";
  322 + ins += "<input type=hidden value='"+i.ordem_tema+"' id='Eordem_tema' />";
  323 + return(ins);
326 } 324 }
327 function montaDivPrancha(i) 325 function montaDivPrancha(i)
328 { 326 {
@@ -337,10 +335,10 @@ function montaDivPrancha(i) @@ -337,10 +335,10 @@ function montaDivPrancha(i)
337 {titulo:"(opcional) Ícone que será utilizado na apresentação da prancha:",id:"Eicone_prancha",size:"50",value:i.icone_prancha,tipo:"text",div:""}, 335 {titulo:"(opcional) Ícone que será utilizado na apresentação da prancha:",id:"Eicone_prancha",size:"50",value:i.icone_prancha,tipo:"text",div:""},
338 {titulo:"Extensão geográfica (xmin ymin xmax ymax):",id:"Emapext_prancha",size:"30",value:i.mapext_prancha,tipo:"text",div:""} 336 {titulo:"Extensão geográfica (xmin ymin xmax ymax):",id:"Emapext_prancha",size:"30",value:i.mapext_prancha,tipo:"text",div:""}
339 ] 337 ]
340 - }  
341 - var ins = ""  
342 - ins += core_geraLinhas(param)  
343 - ins += "<input type=hidden value='"+i.ordem_prancha+"' id='Eordem_prancha' />" 338 + };
  339 + var ins = "";
  340 + ins += core_geraLinhas(param);
  341 + ins += "<input type=hidden value='"+i.ordem_prancha+"' id='Eordem_prancha' />";
344 342
345 return(ins) 343 return(ins)
346 } 344 }
@@ -358,47 +356,48 @@ function montaDivAtlas(i) @@ -358,47 +356,48 @@ function montaDivAtlas(i)
358 {titulo:"(opcional) Ícone que será utilizado na montagem da lista de todos os Atlas:",id:"Eicone_atlas",size:"50",value:i.icone_atlas,tipo:"text",div:""}, 356 {titulo:"(opcional) Ícone que será utilizado na montagem da lista de todos os Atlas:",id:"Eicone_atlas",size:"50",value:i.icone_atlas,tipo:"text",div:""},
359 {titulo:"(opcional) Template HTML (se não for especificado, será usado o default do i3geo. Utilize o caminho completo do arquivo html no servidor):",id:"Etemplate_atlas",size:"50",value:i.template_atlas,tipo:"text",div:""} 357 {titulo:"(opcional) Template HTML (se não for especificado, será usado o default do i3geo. Utilize o caminho completo do arquivo html no servidor):",id:"Etemplate_atlas",size:"50",value:i.template_atlas,tipo:"text",div:""}
360 ] 358 ]
361 - }  
362 - var ins = ""  
363 - ins += core_geraLinhas(param)  
364 - ins += "Prancha inicial (será mostrada quando iniciar o atlas):<br>"  
365 - ins += "<div id=comboPranchaIni ></div><br>"  
366 - ins += "Tipo da apresentação das guias:<br>"  
367 - ins += "<select id='Etipoguias_atlas' />"  
368 - ins += "<option value='' >---</option>"  
369 - ins += "<option value='automatica' " 359 + };
  360 + var ins = "";
  361 + ins += core_geraLinhas(param);
  362 + ins += "Prancha inicial (será mostrada quando iniciar o atlas):<br>";
  363 + ins += "<div id=comboPranchaIni ></div><br>";
  364 + ins += "Tipo da apresentação das guias:<br>";
  365 + ins += "<select id='Etipoguias_atlas' />";
  366 + ins += "<option value='' >---</option>";
  367 + ins += "<option value='automatica' ";
370 if (i.tipoguias_atlas == "automatica"){ins += "selected";} 368 if (i.tipoguias_atlas == "automatica"){ins += "selected";}
371 - ins += " >automática</option>"  
372 - ins += "<option value='combo' " 369 + ins += " >automática</option>";
  370 + ins += "<option value='combo' ";
373 if (i.tipoguias_atlas == "combo"){ins += "selected";} 371 if (i.tipoguias_atlas == "combo"){ins += "selected";}
374 - ins += " >combo</option>"  
375 - ins += "<option value='expandida' " 372 + ins += " >combo</option>";
  373 + ins += "<option value='expandida' ";
376 if (i.tipoguias_atlas == "expandida"){ins += "selected";} 374 if (i.tipoguias_atlas == "expandida"){ins += "selected";}
377 - ins += " >expandida</option></select><br><br>"  
378 - ins += "Publicado (os não publicados são mostrados apenas para os usuários administradores)?<br>"  
379 - ins += "<select id='Epublicado_atlas' >"  
380 - ins += core_combosimnao(i.publicado_atlas)  
381 - ins += "</select>"  
382 - ins += "<input type=hidden value='"+i.ordem_atlas+"' id='Eordem_atlas' />"  
383 -  
384 - return(ins) 375 + ins += " >expandida</option></select><br><br>";
  376 + ins += "Publicado (os não publicados são mostrados apenas para os usuários administradores)?<br>";
  377 + ins += "<select id='Epublicado_atlas' >";
  378 + ins += core_combosimnao(i.publicado_atlas);
  379 + ins += "</select>";
  380 + ins += "<input type=hidden value='"+i.ordem_atlas+"' id='Eordem_atlas' />";
  381 +
  382 + return(ins);
385 } 383 }
386 function sobeDesce(movimento,tipo,id) 384 function sobeDesce(movimento,tipo,id)
387 { 385 {
  386 + var movimenta = null;
388 if(tipo == "atlas") 387 if(tipo == "atlas")
389 { 388 {
390 - var no = tree.getNodeByProperty("id_atlas",id)  
391 - var movimenta = core_movimentaNo(movimento,no) 389 + var no = tree.getNodeByProperty("id_atlas",id);
  390 + movimenta = core_movimentaNo(movimento,no);
392 } 391 }
393 if(tipo == "prancha") 392 if(tipo == "prancha")
394 { 393 {
395 - var no = tree.getNodeByProperty("id_prancha",id)  
396 - var movimenta = core_movimentaNo(movimento,no) 394 + var no = tree.getNodeByProperty("id_prancha",id);
  395 + movimenta = core_movimentaNo(movimento,no);
397 } 396 }
398 if(tipo == "tema") 397 if(tipo == "tema")
399 { 398 {
400 - var no = tree.getNodeByProperty("id_tema",id)  
401 - var movimenta = core_movimentaNo(movimento,no) 399 + var no = tree.getNodeByProperty("id_tema",id);
  400 + movimenta = core_movimentaNo(movimento,no);
402 } 401 }
403 var callback = 402 var callback =
404 { 403 {
@@ -407,12 +406,12 @@ function sobeDesce(movimento,tipo,id) @@ -407,12 +406,12 @@ function sobeDesce(movimento,tipo,id)
407 failure:core_handleFailure, 406 failure:core_handleFailure,
408 argument: { foo:"foo", bar:"bar" } 407 argument: { foo:"foo", bar:"bar" }
409 }; 408 };
410 - if (movimenta) 409 + if(movimenta)
411 { 410 {
412 var sUrl = "../php/atlas.php?funcao=movimentaNo&tipo="+tipo+"&movimento="+movimento+"&id="+id; 411 var sUrl = "../php/atlas.php?funcao=movimentaNo&tipo="+tipo+"&movimento="+movimento+"&id="+id;
413 core_carregando("ativa"); 412 core_carregando("ativa");
414 core_carregando(" modificando a ordem no banco de dados"); 413 core_carregando(" modificando a ordem no banco de dados");
415 - core_makeRequest(sUrl,callback) 414 + core_makeRequest(sUrl,callback);
416 } 415 }
417 } 416 }
418 /* 417 /*
@@ -429,22 +428,25 @@ Exclui um elemento do atlas @@ -429,22 +428,25 @@ Exclui um elemento do atlas
429 function excluir(tipo,id) 428 function excluir(tipo,id)
430 { 429 {
431 var mensagem = " excluindo o registro do id= "+id; 430 var mensagem = " excluindo o registro do id= "+id;
  431 + var no = null;
  432 + var sUrl = null;
432 if(tipo == "atlas") 433 if(tipo == "atlas")
433 { 434 {
434 - var no = tree.getNodeByProperty("id_atlas",id)  
435 - var sUrl = "../php/atlas.php?funcao=excluirAtlas&id="+id; 435 + no = tree.getNodeByProperty("id_atlas",id);
  436 + sUrl = "../php/atlas.php?funcao=excluirAtlas&id="+id;
436 } 437 }
437 if(tipo == "prancha") 438 if(tipo == "prancha")
438 { 439 {
439 - var no = tree.getNodeByProperty("id_prancha",id)  
440 - var sUrl = "../php/atlas.php?funcao=excluirPrancha&id="+id; 440 + no = tree.getNodeByProperty("id_prancha",id);
  441 + sUrl = "../php/atlas.php?funcao=excluirPrancha&id="+id;
441 } 442 }
442 if(tipo == "tema") 443 if(tipo == "tema")
443 { 444 {
444 - var no = tree.getNodeByProperty("id_tema",id)  
445 - var sUrl = "../php/atlas.php?funcao=excluirTema&id="+id; 445 + no = tree.getNodeByProperty("id_tema",id);
  446 + sUrl = "../php/atlas.php?funcao=excluirTema&id="+id;
446 } 447 }
447 - core_excluiNoTree(sUrl,no,mensagem) 448 + if(sUrl)
  449 + {core_excluiNoTree(sUrl,no,mensagem);}
448 } 450 }
449 /* 451 /*
450 Function: adicionarTema 452 Function: adicionarTema
@@ -455,21 +457,20 @@ Adiciona um novo tema @@ -455,21 +457,20 @@ Adiciona um novo tema
455 */ 457 */
456 function adicionarTema(id) 458 function adicionarTema(id)
457 { 459 {
458 - var mensagem = " adicionando tema...";  
459 - var no = tree.getNodeByProperty("id_prancha",id) 460 + var no = tree.getNodeByProperty("id_prancha",id);
460 var sUrl = "../php/atlas.php?funcao=alterarTema&id_prancha="+id; 461 var sUrl = "../php/atlas.php?funcao=alterarTema&id_prancha="+id;
461 var callback = 462 var callback =
462 { 463 {
463 success: function(oResponse) 464 success: function(oResponse)
464 { 465 {
465 var dados = YAHOO.lang.JSON.parse(oResponse.responseText); 466 var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
466 - adicionaNosTemas(no,dados,true) 467 + adicionaNosTemas(no,dados,true);
467 editar('tema',dados[dados.length-1].id_tema); 468 editar('tema',dados[dados.length-1].id_tema);
468 }, 469 },
469 failure:core_handleFailure, 470 failure:core_handleFailure,
470 argument: { foo:"foo", bar:"bar" } 471 argument: { foo:"foo", bar:"bar" }
471 }; 472 };
472 - core_makeRequest(sUrl,callback) 473 + core_makeRequest(sUrl,callback);
473 } 474 }
474 /* 475 /*
475 Function: adicionarPrancha 476 Function: adicionarPrancha
@@ -480,21 +481,20 @@ Adiciona uma nova prancha @@ -480,21 +481,20 @@ Adiciona uma nova prancha
480 */ 481 */
481 function adicionarPrancha(id) 482 function adicionarPrancha(id)
482 { 483 {
483 - var mensagem = " adicionando prancha...";  
484 - var no = tree.getNodeByProperty("id_atlas",id) 484 + var no = tree.getNodeByProperty("id_atlas",id);
485 var sUrl = "../php/atlas.php?funcao=alterarPrancha&id_atlas="+id; 485 var sUrl = "../php/atlas.php?funcao=alterarPrancha&id_atlas="+id;
486 var callback = 486 var callback =
487 { 487 {
488 success: function(oResponse) 488 success: function(oResponse)
489 { 489 {
490 - var dados = YAHOO.lang.JSON.parse(oResponse.responseText)  
491 - adicionaNosPranchas(no,dados,true) 490 + var dados = YAHOO.lang.JSON.parse(oResponse.responseText);
  491 + adicionaNosPranchas(no,dados,true);
492 editar('prancha',dados[dados.length-1].id_prancha); 492 editar('prancha',dados[dados.length-1].id_prancha);
493 }, 493 },
494 failure:core_handleFailure, 494 failure:core_handleFailure,
495 argument: { foo:"foo", bar:"bar" } 495 argument: { foo:"foo", bar:"bar" }
496 }; 496 };
497 - core_makeRequest(sUrl,callback) 497 + core_makeRequest(sUrl,callback);
498 } 498 }
499 /* 499 /*
500 Function: gravaDados 500 Function: gravaDados
@@ -509,29 +509,30 @@ Altera dados de um elemento do Atlas @@ -509,29 +509,30 @@ Altera dados de um elemento do Atlas
509 */ 509 */
510 function gravaDados(tipo,id) 510 function gravaDados(tipo,id)
511 { 511 {
  512 + var campos = null;
  513 + var par = null;
  514 + var prog = null;
512 if(tipo == "atlas") 515 if(tipo == "atlas")
513 { 516 {
514 - var campos = new Array("publicado_atlas","ordem_atlas","basemapfile_atlas","desc_atlas","h_atlas","w_atlas","icone_atlas","link_atlas","pranchadefault_atlas","template_atlas","tipoguias_atlas","titulo_atlas")  
515 - var par = "&id_atlas="+id  
516 - var prog = "../php/atlas.php?funcao=alterarAtlas" 517 + campos = new Array("publicado_atlas","ordem_atlas","basemapfile_atlas","desc_atlas","h_atlas","w_atlas","icone_atlas","link_atlas","pranchadefault_atlas","template_atlas","tipoguias_atlas","titulo_atlas");
  518 + par = "&id_atlas="+id;
  519 + prog = "../php/atlas.php?funcao=alterarAtlas";
517 } 520 }
518 if(tipo == "prancha") 521 if(tipo == "prancha")
519 { 522 {
520 - var campos = new Array("ordem_prancha","desc_prancha","h_prancha","icone_prancha","link_prancha","mapext_prancha","titulo_prancha","w_prancha");  
521 - var par = "&id_prancha="+id;  
522 - var prog = "../php/atlas.php?funcao=alterarPrancha" 523 + campos = new Array("ordem_prancha","desc_prancha","h_prancha","icone_prancha","link_prancha","mapext_prancha","titulo_prancha","w_prancha");
  524 + par = "&id_prancha="+id;
  525 + prog = "../php/atlas.php?funcao=alterarPrancha";
523 } 526 }
524 if(tipo == "tema") 527 if(tipo == "tema")
525 { 528 {
526 - var campos = new Array("codigo_tema","ordem_tema","ligado_tema");  
527 - var par = "&id_tema="+id;  
528 - var prog = "../php/atlas.php?funcao=alterarTema" 529 + campos = new Array("codigo_tema","ordem_tema","ligado_tema");
  530 + par = "&id_tema="+id;
  531 + prog = "../php/atlas.php?funcao=alterarTema";
529 } 532 }
530 - for (i=0;i<campos.length;i++)  
531 - {par += "&"+campos[i]+"="+($i("E"+campos[i]).value)}  
532 - core_carregando("ativa");  
533 - core_carregando(" gravando o registro do id= "+id);  
534 - var sUrl = prog+par; 533 + for (var i=0;i<campos.length;i++)
  534 + {par += "&"+campos[i]+"="+($i("E"+campos[i]).value);}
  535 +
535 var callback = 536 var callback =
536 { 537 {
537 success:function(o) 538 success:function(o)
@@ -541,28 +542,28 @@ function gravaDados(tipo,id) @@ -541,28 +542,28 @@ function gravaDados(tipo,id)
541 if(YAHOO.lang.JSON.parse(o.responseText) == "erro") 542 if(YAHOO.lang.JSON.parse(o.responseText) == "erro")
542 { 543 {
543 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem menus vinculados a este tema</span>"); 544 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem menus vinculados a este tema</span>");
544 - setTimeout("core_carregando('desativa')",3000) 545 + setTimeout("core_carregando('desativa')",3000);
545 } 546 }
546 else 547 else
547 { 548 {
548 if(tipo == "atlas") 549 if(tipo == "atlas")
549 { 550 {
550 - var no = tree.getNodeByProperty("id_atlas",id)  
551 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_atlas").value 551 + var no = tree.getNodeByProperty("id_atlas",id);
  552 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_atlas").value;
552 no.getContentEl().getElementsByTagName("span")[0].style.color = ""; 553 no.getContentEl().getElementsByTagName("span")[0].style.color = "";
553 no.html = no.getContentEl().innerHTML; 554 no.html = no.getContentEl().innerHTML;
554 } 555 }
555 if(tipo == "prancha") 556 if(tipo == "prancha")
556 { 557 {
557 - var no = tree.getNodeByProperty("id_prancha",id)  
558 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_prancha").value 558 + var no = tree.getNodeByProperty("id_prancha",id);
  559 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Etitulo_prancha").value;
559 no.getContentEl().getElementsByTagName("span")[0].style.color = ""; 560 no.getContentEl().getElementsByTagName("span")[0].style.color = "";
560 no.html = no.getContentEl().innerHTML; 561 no.html = no.getContentEl().innerHTML;
561 } 562 }
562 if(tipo == "tema") 563 if(tipo == "tema")
563 { 564 {
564 - var no = tree.getNodeByProperty("id_tema",id)  
565 - no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Ecodigo_tema").value 565 + var no = tree.getNodeByProperty("id_tema",id);
  566 + no.getContentEl().getElementsByTagName("span")[0].innerHTML = document.getElementById("Ecodigo_tema").value;
566 no.getContentEl().getElementsByTagName("span")[0].style.color = ""; 567 no.getContentEl().getElementsByTagName("span")[0].style.color = "";
567 no.html = no.getContentEl().innerHTML; 568 no.html = no.getContentEl().innerHTML;
568 } 569 }
@@ -575,8 +576,13 @@ function gravaDados(tipo,id) @@ -575,8 +576,13 @@ function gravaDados(tipo,id)
575 }, 576 },
576 failure:core_handleFailure, 577 failure:core_handleFailure,
577 argument: { foo:"foo", bar:"bar" } 578 argument: { foo:"foo", bar:"bar" }
578 - };  
579 - core_makeRequest(sUrl,callback,'POST') 579 + };
  580 + if(prog && par){
  581 + core_carregando("ativa");
  582 + core_carregando(" gravando o registro do id= "+id);
  583 + var sUrl = prog+par;
  584 + core_makeRequest(sUrl,callback,'POST');
  585 + }
580 } 586 }
581 /* 587 /*
582 Function: abreAtlas 588 Function: abreAtlas
admin/js/core.js
@@ -114,30 +114,30 @@ true|false - se o movimento ocorreu @@ -114,30 +114,30 @@ true|false - se o movimento ocorreu
114 */ 114 */
115 function core_movimentaNo(tipo,no) 115 function core_movimentaNo(tipo,no)
116 { 116 {
117 - var movimenta = false 117 + var movimenta = false;
118 if(tipo == "sobe") 118 if(tipo == "sobe")
119 { 119 {
120 - var noanterior = no.previousSibling 120 + var noanterior = no.previousSibling;
121 if(noanterior) 121 if(noanterior)
122 { 122 {
123 if(noanterior.previousSibling && noanterior.data.tipo != "etiqueta") 123 if(noanterior.previousSibling && noanterior.data.tipo != "etiqueta")
124 { 124 {
125 - tree.popNode(no)  
126 - no.insertBefore(noanterior)  
127 - tree.draw()  
128 - var movimenta = true 125 + tree.popNode(no);
  126 + no.insertBefore(noanterior);
  127 + tree.draw();
  128 + movimenta = true;
129 } 129 }
130 } 130 }
131 } 131 }
132 if(tipo == "desce") 132 if(tipo == "desce")
133 { 133 {
134 - var noseguinte = no.nextSibling 134 + var noseguinte = no.nextSibling;
135 if(noseguinte) 135 if(noseguinte)
136 { 136 {
137 - tree.popNode(no)  
138 - no.insertAfter(noseguinte)  
139 - tree.draw()  
140 - var movimenta = true 137 + tree.popNode(no);
  138 + no.insertAfter(noseguinte);
  139 + tree.draw();
  140 + movimenta = true;
141 } 141 }
142 } 142 }
143 return movimenta; 143 return movimenta;
@@ -219,18 +219,17 @@ tipo - GET ou POST @@ -219,18 +219,17 @@ tipo - GET ou POST
219 */ 219 */
220 function core_makeRequest(sUrl,callback,tipo) 220 function core_makeRequest(sUrl,callback,tipo)
221 { 221 {
222 - var sUrl = escape(sUrl); 222 + sUrl = escape(sUrl);
223 var re = new RegExp("%3F", "g"); 223 var re = new RegExp("%3F", "g");
224 - var sUrl = sUrl.replace(re,'?');  
225 - var re = new RegExp("%3D", "g");  
226 - var sUrl = sUrl.replace(re,'=');  
227 - var re = new RegExp("%26", "g");  
228 - var sUrl = sUrl.replace(re,'&'); 224 + sUrl = sUrl.replace(re,'?');
  225 + re = new RegExp("%3D", "g");
  226 + sUrl = sUrl.replace(re,'=');
  227 + re = new RegExp("%26", "g");
  228 + sUrl = sUrl.replace(re,'&');
229 //alert(sUrl) 229 //alert(sUrl)
230 if(arguments.length == 2) 230 if(arguments.length == 2)
231 - {var tipo = "GET";}  
232 - var request = YAHOO.util.Connect.asyncRequest(tipo, sUrl, callback);  
233 - //YAHOO.log("Initiating request; tId: " + request.tId + ".", "info", "example"); 231 + {tipo = "GET";}
  232 + YAHOO.util.Connect.asyncRequest(tipo, sUrl, callback);
234 } 233 }
235 /* 234 /*
236 Function: core_carregando 235 Function: core_carregando
@@ -389,7 +388,7 @@ $perfisArray - array com a lista de perfis @@ -389,7 +388,7 @@ $perfisArray - array com a lista de perfis
389 function core_pegaPerfis(funcao) 388 function core_pegaPerfis(funcao)
390 { 389 {
391 if(arguments.length == 0) 390 if(arguments.length == 0)
392 - {var funcao = "";} 391 + {funcao = "";}
393 //pega a lista de perfis 392 //pega a lista de perfis
394 var sUrl = "../php/menutemas.php?funcao=pegaPerfis"; 393 var sUrl = "../php/menutemas.php?funcao=pegaPerfis";
395 var callback = 394 var callback =
@@ -400,7 +399,7 @@ function core_pegaPerfis(funcao) @@ -400,7 +399,7 @@ function core_pegaPerfis(funcao)
400 { 399 {
401 $perfis = YAHOO.lang.JSON.parse(o.responseText); 400 $perfis = YAHOO.lang.JSON.parse(o.responseText);
402 $perfisArray = new Array(); 401 $perfisArray = new Array();
403 - for (i=0;i<$perfis.length;i++) 402 + for (var i=0;i<$perfis.length;i++)
404 {$perfisArray.push($perfis[i].perfil);} 403 {$perfisArray.push($perfis[i].perfil);}
405 if(funcao != "") 404 if(funcao != "")
406 eval(funcao); 405 eval(funcao);
@@ -410,7 +409,7 @@ function core_pegaPerfis(funcao) @@ -410,7 +409,7 @@ function core_pegaPerfis(funcao)
410 failure:core_handleFailure, 409 failure:core_handleFailure,
411 argument: { foo:"foo", bar:"bar" } 410 argument: { foo:"foo", bar:"bar" }
412 }; 411 };
413 - core_makeRequest(sUrl,callback) 412 + core_makeRequest(sUrl,callback);
414 } 413 }
415 /* 414 /*
416 function: core_pegaMapfiles 415 function: core_pegaMapfiles
@@ -421,7 +420,7 @@ Pega a lista de mapfiles @@ -421,7 +420,7 @@ Pega a lista de mapfiles
421 420
422 Parameters: 421 Parameters:
423 422
424 -funcao - (opcional) nome da funcao que será executada ao terminar a busca pelos dados 423 +funcaoM - (opcional) nome da funcao que será executada ao terminar a busca pelos dados
425 424
426 letra - (opcional) letra inicial utilizada para filtrar a lista 425 letra - (opcional) letra inicial utilizada para filtrar a lista
427 426
@@ -429,17 +428,17 @@ filtro - (opcional) string com o filtro, por exemplo, &quot;&#39;download_tema&#39; = &#39;SIM&#39;&quot; @@ -429,17 +428,17 @@ filtro - (opcional) string com o filtro, por exemplo, &quot;&#39;download_tema&#39; = &#39;SIM&#39;&quot;
429 */ 428 */
430 function core_pegaMapfiles(funcaoM,letra,filtro) 429 function core_pegaMapfiles(funcaoM,letra,filtro)
431 { 430 {
432 - if(arguments.length == 0){  
433 - var funcao = "";  
434 - var letra = "";  
435 - var filtro = ""; 431 + if(arguments.length == 0){
  432 + letra = "";
  433 + filtro = "";
  434 + funcaoM = "";
436 } 435 }
437 if(arguments.length == 1){ 436 if(arguments.length == 1){
438 - var letra = "";  
439 - var filtro = ""; 437 + letra = "";
  438 + filtro = "";
440 } 439 }
441 if(arguments.length == 2){ 440 if(arguments.length == 2){
442 - var filtro = ""; 441 + filtro = "";
443 } 442 }
444 var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra+"&filtro="+filtro; 443 var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra+"&filtro="+filtro;
445 var callbackM = 444 var callbackM =
@@ -457,7 +456,7 @@ function core_pegaMapfiles(funcaoM,letra,filtro) @@ -457,7 +456,7 @@ function core_pegaMapfiles(funcaoM,letra,filtro)
457 failure:core_handleFailure, 456 failure:core_handleFailure,
458 argument: { foo:"foo", bar:"bar" } 457 argument: { foo:"foo", bar:"bar" }
459 }; 458 };
460 - core_makeRequest(sUrl,callbackM) 459 + core_makeRequest(sUrl,callbackM);
461 } 460 }
462 /* 461 /*
463 Function: core_comboMapfiles 462 Function: core_comboMapfiles
@@ -479,20 +478,20 @@ recarrega {booblean} - força recarregar o combo de mapfiles @@ -479,20 +478,20 @@ recarrega {booblean} - força recarregar o combo de mapfiles
479 function core_comboMapfiles(onde,id,marcar,funcao,recarrega) 478 function core_comboMapfiles(onde,id,marcar,funcao,recarrega)
480 { 479 {
481 if(arguments.length == 3) 480 if(arguments.length == 3)
482 - {var funcao = "";} 481 + {funcao = "";}
483 if(!recarrega) 482 if(!recarrega)
484 {recarrega = false;} 483 {recarrega = false;}
485 if($mapfiles == "" || recarrega === true) 484 if($mapfiles == "" || recarrega === true)
486 { 485 {
487 - core_pegaMapfiles("core_comboMapfiles('"+onde+"','"+id+"','"+marcar+"','"+funcao+"')") 486 + core_pegaMapfiles("core_comboMapfiles('"+onde+"','"+id+"','"+marcar+"','"+funcao+"')");
488 } 487 }
489 else 488 else
490 { 489 {
491 if (funcao != "") 490 if (funcao != "")
492 - {var funcao = "onchange='"+funcao+"'";}  
493 - ins = "<select id='"+id+"' "+funcao+" >"  
494 - ins += core_comboObjeto($mapfiles,"codigo","codigo",marcar)  
495 - ins += "</select></p>" 491 + {funcao = "onchange='"+funcao+"'";}
  492 + ins = "<select id='"+id+"' "+funcao+" >";
  493 + ins += core_comboObjeto($mapfiles,"codigo","codigo",marcar);
  494 + ins += "</select></p>";
496 $i(onde).innerHTML = ins; 495 $i(onde).innerHTML = ins;
497 } 496 }
498 } 497 }
@@ -514,18 +513,18 @@ funcao - string com o nome da função que será executada no evento onchange @@ -514,18 +513,18 @@ funcao - string com o nome da função que será executada no evento onchange
514 function core_comboPerfis(onde,id,marcar,funcao) 513 function core_comboPerfis(onde,id,marcar,funcao)
515 { 514 {
516 if(arguments.length == 3) 515 if(arguments.length == 3)
517 - {var funcao = "";} 516 + {funcao = "";}
518 if($perfis == "") 517 if($perfis == "")
519 { 518 {
520 - core_pegaPerfis("core_comboPerfis('"+onde+"','"+id+"','"+marcar+"','"+funcao+"')") 519 + core_pegaPerfis("core_comboPerfis('"+onde+"','"+id+"','"+marcar+"','"+funcao+"')");
521 } 520 }
522 else 521 else
523 { 522 {
524 if (funcao != "") 523 if (funcao != "")
525 - {var funcao = "onchange='"+funcao+"'";}  
526 - ins = "<select id='"+id+"' "+funcao+" >"  
527 - ins += core_comboObjeto($perfis,"perfil","perfil",marcar)  
528 - ins += "</select></p>" 524 + {funcao = "onchange='"+funcao+"'";}
  525 + ins = "<select id='"+id+"' "+funcao+" >";
  526 + ins += core_comboObjeto($perfis,"perfil","perfil",marcar);
  527 + ins += "</select></p>";
529 $i(onde).innerHTML = ins; 528 $i(onde).innerHTML = ins;
530 } 529 }
531 } 530 }
@@ -557,12 +556,12 @@ function core_comboPranchas(onde,id,marcar,funcao,id_atlas) @@ -557,12 +556,12 @@ function core_comboPranchas(onde,id,marcar,funcao,id_atlas)
557 { 556 {
558 var valores = YAHOO.lang.JSON.parse(o.responseText); 557 var valores = YAHOO.lang.JSON.parse(o.responseText);
559 if(arguments.length == 3) 558 if(arguments.length == 3)
560 - {var funcao = "";} 559 + {funcao = "";}
561 if (funcao != "") 560 if (funcao != "")
562 - {var funcao = "onchange='"+funcao+"'";}  
563 - ins = "<select id='"+id+"' "+funcao+" >"  
564 - ins += core_comboObjeto(valores,"id_prancha","titulo_prancha",marcar)  
565 - ins += "</select></p>" 561 + {funcao = "onchange='"+funcao+"'";}
  562 + ins = "<select id='"+id+"' "+funcao+" >";
  563 + ins += core_comboObjeto(valores,"id_prancha","titulo_prancha",marcar);
  564 + ins += "</select></p>";
566 $i(onde).innerHTML = ins; 565 $i(onde).innerHTML = ins;
567 } 566 }
568 catch(e){core_handleFailure(e,o.responseText);} 567 catch(e){core_handleFailure(e,o.responseText);}
@@ -570,7 +569,7 @@ function core_comboPranchas(onde,id,marcar,funcao,id_atlas) @@ -570,7 +569,7 @@ function core_comboPranchas(onde,id,marcar,funcao,id_atlas)
570 failure:core_handleFailure, 569 failure:core_handleFailure,
571 argument: { foo:"foo", bar:"bar" } 570 argument: { foo:"foo", bar:"bar" }
572 }; 571 };
573 - core_makeRequest(sUrl,callback) 572 + core_makeRequest(sUrl,callback);
574 } 573 }
575 /* 574 /*
576 Function: core_comboGrupos 575 Function: core_comboGrupos
@@ -600,12 +599,12 @@ function core_comboGrupos(onde,id,marcar,funcao) @@ -600,12 +599,12 @@ function core_comboGrupos(onde,id,marcar,funcao)
600 { 599 {
601 var valores = YAHOO.lang.JSON.parse(o.responseText); 600 var valores = YAHOO.lang.JSON.parse(o.responseText);
602 if(arguments.length == 3) 601 if(arguments.length == 3)
603 - {var funcao = "";} 602 + {funcao = "";}
604 if (funcao != "") 603 if (funcao != "")
605 - {var funcao = "onchange='"+funcao+"'";}  
606 - ins = "<select size=6 style='width:370px' id='"+id+"' "+funcao+" >"  
607 - ins += core_comboObjeto(valores,"id_grupo","nome_grupo",marcar)  
608 - ins += "</select></p>" 604 + {funcao = "onchange='"+funcao+"'";}
  605 + ins = "<select size=6 style='width:370px' id='"+id+"' "+funcao+" >";
  606 + ins += core_comboObjeto(valores,"id_grupo","nome_grupo",marcar);
  607 + ins += "</select></p>";
609 $i(onde).innerHTML = ins; 608 $i(onde).innerHTML = ins;
610 } 609 }
611 catch(e){core_handleFailure(e,o.responseText);} 610 catch(e){core_handleFailure(e,o.responseText);}
@@ -613,7 +612,7 @@ function core_comboGrupos(onde,id,marcar,funcao) @@ -613,7 +612,7 @@ function core_comboGrupos(onde,id,marcar,funcao)
613 failure:core_handleFailure, 612 failure:core_handleFailure,
614 argument: { foo:"foo", bar:"bar" } 613 argument: { foo:"foo", bar:"bar" }
615 }; 614 };
616 - core_makeRequest(sUrl,callback) 615 + core_makeRequest(sUrl,callback);
617 } 616 }
618 /* 617 /*
619 Function: core_comboSubGrupos 618 Function: core_comboSubGrupos
@@ -643,12 +642,12 @@ function core_comboSubGrupos(onde,id,marcar,funcao) @@ -643,12 +642,12 @@ function core_comboSubGrupos(onde,id,marcar,funcao)
643 { 642 {
644 var valores = YAHOO.lang.JSON.parse(o.responseText); 643 var valores = YAHOO.lang.JSON.parse(o.responseText);
645 if(arguments.length == 3) 644 if(arguments.length == 3)
646 - {var funcao = "";} 645 + {funcao = "";}
647 if (funcao != "") 646 if (funcao != "")
648 - {var funcao = "onchange='"+funcao+"'";}  
649 - ins = "<select size=6 style='width:370px' id='"+id+"' "+funcao+" >"  
650 - ins += core_comboObjeto(valores,"id_subgrupo","nome_subgrupo",marcar)  
651 - ins += "</select></p>" 647 + {funcao = "onchange='"+funcao+"'";}
  648 + ins = "<select size=6 style='width:370px' id='"+id+"' "+funcao+" >";
  649 + ins += core_comboObjeto(valores,"id_subgrupo","nome_subgrupo",marcar);
  650 + ins += "</select></p>";
652 $i(onde).innerHTML = ins; 651 $i(onde).innerHTML = ins;
653 } 652 }
654 catch(e){core_handleFailure(e,o.responseText);} 653 catch(e){core_handleFailure(e,o.responseText);}
@@ -656,7 +655,7 @@ function core_comboSubGrupos(onde,id,marcar,funcao) @@ -656,7 +655,7 @@ function core_comboSubGrupos(onde,id,marcar,funcao)
656 failure:core_handleFailure, 655 failure:core_handleFailure,
657 argument: { foo:"foo", bar:"bar" } 656 argument: { foo:"foo", bar:"bar" }
658 }; 657 };
659 - core_makeRequest(sUrl,callback) 658 + core_makeRequest(sUrl,callback);
660 } 659 }
661 /* 660 /*
662 Function: core_comboTemas 661 Function: core_comboTemas
@@ -686,12 +685,12 @@ function core_comboTemas(onde,id,marcar,funcao) @@ -686,12 +685,12 @@ function core_comboTemas(onde,id,marcar,funcao)
686 { 685 {
687 var valores = YAHOO.lang.JSON.parse(o.responseText); 686 var valores = YAHOO.lang.JSON.parse(o.responseText);
688 if(arguments.length == 3) 687 if(arguments.length == 3)
689 - {var funcao = "";} 688 + {funcao = "";}
690 if (funcao != "") 689 if (funcao != "")
691 - {var funcao = "onchange='"+funcao+"'";}  
692 - ins = "<select size=6 style='width:370px' id='"+id+"' "+funcao+" >"  
693 - ins += core_comboObjeto(valores,"id_tema","nome_tema",marcar,"codigo_tema")  
694 - ins += "</select></p>" 690 + {funcao = "onchange='"+funcao+"'";}
  691 + ins = "<select size=6 style='width:370px' id='"+id+"' "+funcao+" >";
  692 + ins += core_comboObjeto(valores,"id_tema","nome_tema",marcar,"codigo_tema");
  693 + ins += "</select></p>";
695 $i(onde).innerHTML = ins; 694 $i(onde).innerHTML = ins;
696 } 695 }
697 catch(e){core_handleFailure(e,o.responseText);} 696 catch(e){core_handleFailure(e,o.responseText);}
@@ -699,7 +698,7 @@ function core_comboTemas(onde,id,marcar,funcao) @@ -699,7 +698,7 @@ function core_comboTemas(onde,id,marcar,funcao)
699 failure:core_handleFailure, 698 failure:core_handleFailure,
700 argument: { foo:"foo", bar:"bar" } 699 argument: { foo:"foo", bar:"bar" }
701 }; 700 };
702 - core_makeRequest(sUrl,callback) 701 + core_makeRequest(sUrl,callback);
703 } 702 }
704 703
705 /* 704 /*
@@ -716,7 +715,7 @@ funcao - (opcional) nome da funcao que será executada ao terminar a busca pelos @@ -716,7 +715,7 @@ funcao - (opcional) nome da funcao que será executada ao terminar a busca pelos
716 function core_pegaTags(funcao) 715 function core_pegaTags(funcao)
717 { 716 {
718 if(arguments.length == 0) 717 if(arguments.length == 0)
719 - {var funcao = "";} 718 + {funcao = "";}
720 var sUrl = "../php/menutemas.php?funcao=pegaTags"; 719 var sUrl = "../php/menutemas.php?funcao=pegaTags";
721 var callback = 720 var callback =
722 { 721 {
@@ -734,7 +733,7 @@ function core_pegaTags(funcao) @@ -734,7 +733,7 @@ function core_pegaTags(funcao)
734 failure:core_handleFailure, 733 failure:core_handleFailure,
735 argument: { foo:"foo", bar:"bar" } 734 argument: { foo:"foo", bar:"bar" }
736 }; 735 };
737 - core_makeRequest(sUrl,callback) 736 + core_makeRequest(sUrl,callback);
738 } 737 }
739 /* 738 /*
740 Function: core_comboTags 739 Function: core_comboTags
@@ -755,13 +754,13 @@ function core_comboTags(onde,id,change) @@ -755,13 +754,13 @@ function core_comboTags(onde,id,change)
755 { 754 {
756 if($tags == "") 755 if($tags == "")
757 { 756 {
758 - core_pegaTags("core_comboTags('"+onde+"','"+id+"','"+change+"')") 757 + core_pegaTags("core_comboTags('"+onde+"','"+id+"','"+change+"')");
759 } 758 }
760 else 759 else
761 { 760 {
762 - ins = "<select onchange=\""+change+"(this.value)\" id='"+id+"' >"  
763 - ins += core_comboObjeto($tags,"nome","nome","")  
764 - ins += "</select></p>" 761 + ins = "<select onchange=\""+change+"(this.value)\" id='"+id+"' >";
  762 + ins += core_comboObjeto($tags,"nome","nome","");
  763 + ins += "</select></p>";
765 $i(onde).innerHTML = ins; 764 $i(onde).innerHTML = ins;
766 } 765 }
767 } 766 }
@@ -786,17 +785,16 @@ function core_menuCheckBox(valores,textos,selecionados,target,record,key) @@ -786,17 +785,16 @@ function core_menuCheckBox(valores,textos,selecionados,target,record,key)
786 { 785 {
787 function on_menuCheckBoxChange(p_oEvent) 786 function on_menuCheckBoxChange(p_oEvent)
788 { 787 {
789 - var ins = "";  
790 if(p_oEvent.newValue.get("value") == "OK") 788 if(p_oEvent.newValue.get("value") == "OK")
791 { 789 {
792 var cks = $i("core_menuCK_bd").getElementsByTagName("input"); 790 var cks = $i("core_menuCK_bd").getElementsByTagName("input");
793 - var ins = new Array();  
794 - for (i=0;i<cks.length;i++) 791 + var ins = [];
  792 + for (var i=0;i<cks.length;i++)
795 { 793 {
796 if(cks[i].checked) 794 if(cks[i].checked)
797 - ins.push(cks[i].value) 795 + ins.push(cks[i].value);
798 } 796 }
799 - target.innerHTML = "<pre ><p>"+ins.toString()+"</pre>" 797 + target.innerHTML = "<pre ><p>"+ins.toString()+"</pre>";
800 record.setData(key,ins.toString()); 798 record.setData(key,ins.toString());
801 } 799 }
802 YAHOO.example.container.panelCK.destroy(); 800 YAHOO.example.container.panelCK.destroy();
@@ -824,14 +822,14 @@ function core_menuCheckBox(valores,textos,selecionados,target,record,key) @@ -824,14 +822,14 @@ function core_menuCheckBox(valores,textos,selecionados,target,record,key)
824 } 822 }
825 var onde = $i("core_menuCK_bd"); 823 var onde = $i("core_menuCK_bd");
826 onde.innerHTML = ""; 824 onde.innerHTML = "";
827 - for (i=0;i<valores.length;i++) 825 + for (var i=0;i<valores.length;i++)
828 { 826 {
829 var novoCK = document.createElement("div"); 827 var novoCK = document.createElement("div");
830 var ck = ""; 828 var ck = "";
831 - for(j=0;j<selecionados.length;j++) 829 + for(var j=0;j<selecionados.length;j++)
832 { 830 {
833 if(selecionados[j] == valores[i]) 831 if(selecionados[j] == valores[i])
834 - var ck = "CHECKED"; 832 + ck = "CHECKED";
835 } 833 }
836 var ins = "<input type=checkbox id='CK_"+valores[i]+"' value='"+valores[i]+"' "+ck+" />"+textos[i]+"<br>"; 834 var ins = "<input type=checkbox id='CK_"+valores[i]+"' value='"+valores[i]+"' "+ck+" />"+textos[i]+"<br>";
837 novoCK.innerHTML = ins; 835 novoCK.innerHTML = ins;
@@ -847,16 +845,16 @@ Retorna os itens option de um combo sim nao @@ -847,16 +845,16 @@ Retorna os itens option de um combo sim nao
847 */ 845 */
848 function core_combosimnao(marcar) 846 function core_combosimnao(marcar)
849 { 847 {
850 - var ins = "<option value='' "  
851 - if (marcar == ""){ins += "selected"} 848 + var ins = "<option value='' ";
  849 + if (marcar == ""){ins += "selected";}
852 ins += ">---</option>"; 850 ins += ">---</option>";
853 - ins += "<option value='SIM' "  
854 - if (marcar == "sim" || marcar == "SIM"){ins += "selected"} 851 + ins += "<option value='SIM' ";
  852 + if (marcar == "sim" || marcar == "SIM"){ins += "selected";}
855 ins += ">sim</option>"; 853 ins += ">sim</option>";
856 - ins += "<option value='NAO' "  
857 - if (marcar == "nao" || marcar == "NAO"){ins += "selected"} 854 + ins += "<option value='NAO' ";
  855 + if (marcar == "nao" || marcar == "NAO"){ins += "selected";}
858 ins += ">nao</option>"; 856 ins += ">nao</option>";
859 - return(ins) 857 + return(ins);
860 } 858 }
861 /* 859 /*
862 Function: core_comboObjeto 860 Function: core_comboObjeto
@@ -865,28 +863,30 @@ Retorna os itens option de um combo baseado em um objeto json @@ -865,28 +863,30 @@ Retorna os itens option de um combo baseado em um objeto json
865 */ 863 */
866 function core_comboObjeto(obj,valor,texto,marcar,texto2) 864 function core_comboObjeto(obj,valor,texto,marcar,texto2)
867 { 865 {
868 - var ins = "<option value='' " 866 + var ins = "<option value='' ";
  867 + var v;
  868 + var t;
869 ins += ">---</option>"; 869 ins += ">---</option>";
870 for (var k=0;k<obj.length;k++) 870 for (var k=0;k<obj.length;k++)
871 { 871 {
872 if(valor != "") 872 if(valor != "")
873 - var v = eval("obj[k]."+valor); 873 + v = eval("obj[k]."+valor);
874 else 874 else
875 - var v = obj[k]; 875 + v = obj[k];
876 if(texto != "") 876 if(texto != "")
877 - var t = eval("obj[k]."+texto); 877 + t = eval("obj[k]."+texto);
878 else 878 else
879 - var t = obj[k]; 879 + t = obj[k];
880 880
881 if(texto2){ 881 if(texto2){
882 t += " ("+eval("obj[k]."+texto2)+")"; 882 t += " ("+eval("obj[k]."+texto2)+")";
883 } 883 }
884 884
885 - ins += "<option value='"+v+"' "  
886 - if (marcar == v){ins += "selected"} 885 + ins += "<option value='"+v+"' ";
  886 + if (marcar == v){ins += "selected";}
887 ins += " title='"+t+"' >"+t+"</option>"; 887 ins += " title='"+t+"' >"+t+"</option>";
888 } 888 }
889 - return(ins) 889 + return(ins);
890 } 890 }
891 /* 891 /*
892 Function: core_geraLinhas 892 Function: core_geraLinhas
@@ -900,7 +900,7 @@ dados - objeto no formato {&quot;linhas&quot;:[{titulo:&quot;Nome do tema:&quot;,size:&quot;50&quot;,id:&quot;Enome @@ -900,7 +900,7 @@ dados - objeto no formato {&quot;linhas&quot;:[{titulo:&quot;Nome do tema:&quot;,size:&quot;50&quot;,id:&quot;Enome
900 function core_geraLinhas(dados) 900 function core_geraLinhas(dados)
901 { 901 {
902 var nparam = dados.linhas.length; 902 var nparam = dados.linhas.length;
903 - var contaParam = 0 903 + var contaParam = 0;
904 var resultado = ""; 904 var resultado = "";
905 core_geralinhasEscondeAjuda = function(id){ 905 core_geralinhasEscondeAjuda = function(id){
906 var a = $i(id+"_ajuda"), 906 var a = $i(id+"_ajuda"),
@@ -923,24 +923,25 @@ function core_geraLinhas(dados) @@ -923,24 +923,25 @@ function core_geraLinhas(dados)
923 if(!p.size){p.size = "50";} 923 if(!p.size){p.size = "50";}
924 if(p.ajuda) 924 if(p.ajuda)
925 { 925 {
  926 + var idajuda;
926 if(p.id !== "") 927 if(p.id !== "")
927 - {var idajuda = p.id + contaParam;} 928 + {idajuda = p.id + contaParam;}
928 else{ 929 else{
929 - var idajuda = "a"+parseInt(255*(Math.random()),10); 930 + idajuda = "a"+parseInt(255*(Math.random()),10);
930 } 931 }
931 //var temp = "$i('"+idajuda+"_ajuda').style.display='block' " 932 //var temp = "$i('"+idajuda+"_ajuda').style.display='block' "
932 - resultado += "<p><div onclick='core_geralinhasEscondeAjuda(\""+idajuda+"\")' style=cursor:pointer title='ajuda' ><img id='"+idajuda+"_imgajuda' src='../../imagens/desce.gif' >&nbsp;<b>"+p.titulo+"</b></div>"  
933 - resultado += "<div id='"+idajuda+"_ajuda' style=display:none >"+p.ajuda+"</div>" 933 + resultado += "<p><div onclick='core_geralinhasEscondeAjuda(\""+idajuda+"\")' style=cursor:pointer title='ajuda' ><img id='"+idajuda+"_imgajuda' src='../../imagens/desce.gif' >&nbsp;<b>"+p.titulo+"</b></div>";
  934 + resultado += "<div id='"+idajuda+"_ajuda' style=display:none >"+p.ajuda+"</div>";
934 } 935 }
935 else 936 else
936 resultado += "<p><b>"+p.titulo+"</b><br>"; 937 resultado += "<p><b>"+p.titulo+"</b><br>";
937 if(p.texto) 938 if(p.texto)
938 - resultado += "<span style=color:gray >"+p.texto+"</span</p>" 939 + resultado += "<span style=color:gray >"+p.texto+"</span</p>";
939 if(p.id != "") 940 if(p.id != "")
940 { 941 {
941 if(!p.value) 942 if(!p.value)
942 - p.value = ""  
943 - resultado += "<input size="+p.size+" type=text id="+p.id+" value=\""+p.value+"\" />" 943 + p.value = "";
  944 + resultado += "<input size="+p.size+" type=text id="+p.id+" value=\""+p.value+"\" />";
944 if(p.tipo == "cor") 945 if(p.tipo == "cor")
945 { 946 {
946 resultado += "&nbsp;<img src='../../imagens/aquarela.gif' style='cursor:pointer;' onclick='core_abreCor(\"\",\""+p.id+"\");' />"; 947 resultado += "&nbsp;<img src='../../imagens/aquarela.gif' style='cursor:pointer;' onclick='core_abreCor(\"\",\""+p.id+"\");' />";
@@ -950,10 +951,10 @@ function core_geraLinhas(dados) @@ -950,10 +951,10 @@ function core_geraLinhas(dados)
950 if(p.div) 951 if(p.div)
951 {resultado += p.div;} 952 {resultado += p.div;}
952 } 953 }
953 - contaParam++ 954 + contaParam++;
954 } 955 }
955 while(contaParam < nparam) 956 while(contaParam < nparam)
956 - return(resultado) 957 + return(resultado);
957 } 958 }
958 /* 959 /*
959 Function: core_ativaBotaoAdicionaLinha 960 Function: core_ativaBotaoAdicionaLinha
@@ -975,9 +976,9 @@ nomeFuncao - nome da função que será executada ao concluir a adição da linha @@ -975,9 +976,9 @@ nomeFuncao - nome da função que será executada ao concluir a adição da linha
975 function core_ativaBotaoAdicionaLinha(sUrl,idBotao,nomeFuncao) 976 function core_ativaBotaoAdicionaLinha(sUrl,idBotao,nomeFuncao)
976 { 977 {
977 if(arguments.length == 1) 978 if(arguments.length == 1)
978 - {var idBotao = "adiciona";} 979 + {idBotao = "adiciona";}
979 if(arguments.length < 3) 980 if(arguments.length < 3)
980 - var nomeFuncao = ""; 981 + nomeFuncao = "";
981 var adicionalinha = function() 982 var adicionalinha = function()
982 { 983 {
983 core_carregando("ativa"); 984 core_carregando("ativa");
@@ -1004,10 +1005,10 @@ function core_ativaBotaoAdicionaLinha(sUrl,idBotao,nomeFuncao) @@ -1004,10 +1005,10 @@ function core_ativaBotaoAdicionaLinha(sUrl,idBotao,nomeFuncao)
1004 failure:core_handleFailure, 1005 failure:core_handleFailure,
1005 argument: { foo:"foo", bar:"bar" } 1006 argument: { foo:"foo", bar:"bar" }
1006 }; 1007 };
1007 - core_makeRequest(sUrl,callback) 1008 + core_makeRequest(sUrl,callback);
1008 }; 1009 };
1009 //cria o botão de adição de um novo menu 1010 //cria o botão de adição de um novo menu
1010 - var adiciona = new YAHOO.widget.Button(idBotao,{ onclick: { fn: adicionalinha } }); 1011 + new YAHOO.widget.Button(idBotao,{ onclick: { fn: adicionalinha } });
1011 } 1012 }
1012 /* 1013 /*
1013 Function: core_pegaDados 1014 Function: core_pegaDados
@@ -1046,7 +1047,7 @@ function core_pegaDados(mensagem,sUrl,funcaoRetorno) @@ -1046,7 +1047,7 @@ function core_pegaDados(mensagem,sUrl,funcaoRetorno)
1046 failure:core_handleFailure, 1047 failure:core_handleFailure,
1047 argument: { foo:"foo", bar:"bar" } 1048 argument: { foo:"foo", bar:"bar" }
1048 }; 1049 };
1049 - core_makeRequest(sUrl,callback) 1050 + core_makeRequest(sUrl,callback);
1050 } 1051 }
1051 /* 1052 /*
1052 Function: core_gravaLinha 1053 Function: core_gravaLinha
@@ -1070,7 +1071,7 @@ function core_gravaLinha(mensagem,row,sUrl,nomeFuncao) @@ -1070,7 +1071,7 @@ function core_gravaLinha(mensagem,row,sUrl,nomeFuncao)
1070 core_carregando("ativa"); 1071 core_carregando("ativa");
1071 core_carregando(mensagem); 1072 core_carregando(mensagem);
1072 if(arguments.length < 4) 1073 if(arguments.length < 4)
1073 - var nomeFuncao = ""; 1074 + nomeFuncao = "";
1074 var callback = 1075 var callback =
1075 { 1076 {
1076 success:function(o) 1077 success:function(o)
@@ -1080,14 +1081,14 @@ function core_gravaLinha(mensagem,row,sUrl,nomeFuncao) @@ -1080,14 +1081,14 @@ function core_gravaLinha(mensagem,row,sUrl,nomeFuncao)
1080 var linha = myDataTable.getTrEl(rec); 1081 var linha = myDataTable.getTrEl(rec);
1081 if(nomeFuncao != "") 1082 if(nomeFuncao != "")
1082 { 1083 {
1083 - eval(nomeFuncao+"()") 1084 + eval(nomeFuncao+"()");
1084 try 1085 try
1085 - {myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0])} 1086 + {myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);}
1086 catch(e){} 1087 catch(e){}
1087 } 1088 }
1088 else 1089 else
1089 { 1090 {
1090 - myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]) 1091 + myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);
1091 } 1092 }
1092 linha.style.color = ""; 1093 linha.style.color = "";
1093 linha.style.textDecoration = "none"; 1094 linha.style.textDecoration = "none";
@@ -1095,7 +1096,7 @@ function core_gravaLinha(mensagem,row,sUrl,nomeFuncao) @@ -1095,7 +1096,7 @@ function core_gravaLinha(mensagem,row,sUrl,nomeFuncao)
1095 failure:core_handleFailure, 1096 failure:core_handleFailure,
1096 argument: { foo:"foo", bar:"bar" } 1097 argument: { foo:"foo", bar:"bar" }
1097 }; 1098 };
1098 - core_makeRequest(sUrl,callback) 1099 + core_makeRequest(sUrl,callback);
1099 } 1100 }
1100 /* 1101 /*
1101 Function: core_excluiLinha 1102 Function: core_excluiLinha
@@ -1130,7 +1131,7 @@ function core_excluiLinha(sUrl,row,mensagem) @@ -1130,7 +1131,7 @@ function core_excluiLinha(sUrl,row,mensagem)
1130 if(YAHOO.lang.JSON.parse(o.responseText) == "erro") 1131 if(YAHOO.lang.JSON.parse(o.responseText) == "erro")
1131 { 1132 {
1132 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem outras tabelas com registros vinculados a este</span>"); 1133 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem outras tabelas com registros vinculados a este</span>");
1133 - setTimeout("core_carregando('desativa')",3000) 1134 + setTimeout("core_carregando('desativa')",3000);
1134 } 1135 }
1135 else 1136 else
1136 { 1137 {
@@ -1143,15 +1144,15 @@ function core_excluiLinha(sUrl,row,mensagem) @@ -1143,15 +1144,15 @@ function core_excluiLinha(sUrl,row,mensagem)
1143 failure:core_handleFailure, 1144 failure:core_handleFailure,
1144 argument: { foo:"foo", bar:"bar" } 1145 argument: { foo:"foo", bar:"bar" }
1145 }; 1146 };
1146 - core_makeRequest(sUrl,callback) 1147 + core_makeRequest(sUrl,callback);
1147 }; 1148 };
1148 var handleNo = function() 1149 var handleNo = function()
1149 { 1150 {
1150 this.hide(); 1151 this.hide();
1151 }; 1152 };
1152 var mensagem = "Exclui o registro?"; 1153 var mensagem = "Exclui o registro?";
1153 - var largura = "300"  
1154 - core_dialogoContinua(handleYes,handleNo,mensagem,largura) 1154 + var largura = "300";
  1155 + core_dialogoContinua(handleYes,handleNo,mensagem,largura);
1155 } 1156 }
1156 /* 1157 /*
1157 Function: core_excluiNoTree 1158 Function: core_excluiNoTree
@@ -1186,7 +1187,7 @@ function core_excluiNoTree(sUrl,no,mensagem) @@ -1186,7 +1187,7 @@ function core_excluiNoTree(sUrl,no,mensagem)
1186 if(YAHOO.lang.JSON.parse(o.responseText) == "erro") 1187 if(YAHOO.lang.JSON.parse(o.responseText) == "erro")
1187 { 1188 {
1188 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem outras tabelas com registros vinculados a este</span>"); 1189 core_carregando("<span style=color:red >Não foi possível excluir. Verifique se não existem outras tabelas com registros vinculados a este</span>");
1189 - setTimeout("core_carregando('desativa')",3000) 1190 + setTimeout("core_carregando('desativa')",3000);
1190 } 1191 }
1191 else 1192 else
1192 { 1193 {
@@ -1202,15 +1203,15 @@ function core_excluiNoTree(sUrl,no,mensagem) @@ -1202,15 +1203,15 @@ function core_excluiNoTree(sUrl,no,mensagem)
1202 failure:core_handleFailure, 1203 failure:core_handleFailure,
1203 argument: { foo:"foo", bar:"bar" } 1204 argument: { foo:"foo", bar:"bar" }
1204 }; 1205 };
1205 - core_makeRequest(sUrl,callback) 1206 + core_makeRequest(sUrl,callback);
1206 }; 1207 };
1207 var handleNo = function() 1208 var handleNo = function()
1208 { 1209 {
1209 this.hide(); 1210 this.hide();
1210 }; 1211 };
1211 var mensagem = "Exclui o registro?"; 1212 var mensagem = "Exclui o registro?";
1212 - var largura = "300"  
1213 - core_dialogoContinua(handleYes,handleNo,mensagem,largura) 1213 + var largura = "300";
  1214 + core_dialogoContinua(handleYes,handleNo,mensagem,largura);
1214 } 1215 }
1215 /** 1216 /**
1216 Function: core_montaEditor 1217 Function: core_montaEditor
@@ -1229,14 +1230,14 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose) @@ -1229,14 +1230,14 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose)
1229 { 1230 {
1230 if(arguments.length == 0) 1231 if(arguments.length == 0)
1231 { 1232 {
1232 - var funcaoOK = "";  
1233 - var w = "400px";  
1234 - var h = w; 1233 + funcaoOK = "";
  1234 + w = "400px";
  1235 + h = w;
1235 } 1236 }
1236 if(arguments.length < 2) 1237 if(arguments.length < 2)
1237 { 1238 {
1238 - var w = "400px";  
1239 - var h = w; 1239 + w = "400px";
  1240 + h = w;
1240 } 1241 }
1241 if(!$i("janela_editor")) 1242 if(!$i("janela_editor"))
1242 { 1243 {
@@ -1285,7 +1286,7 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose) @@ -1285,7 +1286,7 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose)
1285 eval(funcaoClose+"()"); 1286 eval(funcaoClose+"()");
1286 } 1287 }
1287 catch(e){}; 1288 catch(e){};
1288 - } 1289 + };
1289 YAHOO.util.Event.addListener(YAHOO.example.container.panelEditor.close, "click", fecha); 1290 YAHOO.util.Event.addListener(YAHOO.example.container.panelEditor.close, "click", fecha);
1290 YAHOO.example.container.panelEditor.show(); 1291 YAHOO.example.container.panelEditor.show();
1291 } 1292 }
@@ -1330,8 +1331,7 @@ function core_ativaforms(lista){ @@ -1330,8 +1331,7 @@ function core_ativaforms(lista){
1330 // 1331 //
1331 var scriptLocation = ""; 1332 var scriptLocation = "";
1332 var scripts = document.getElementsByTagName('script'); 1333 var scripts = document.getElementsByTagName('script');
1333 -var i = 0;  
1334 -for (i = 0; i < scripts.length; i++) { 1334 +for (var i = 0; i < scripts.length; i++) {
1335 var src = scripts[i].getAttribute('src'); 1335 var src = scripts[i].getAttribute('src');
1336 if (src) { 1336 if (src) {
1337 var index = src.lastIndexOf("core.js"); 1337 var index = src.lastIndexOf("core.js");
@@ -1380,7 +1380,7 @@ var cssfiles =new Array( @@ -1380,7 +1380,7 @@ var cssfiles =new Array(
1380 //carrega os arquivos js 1380 //carrega os arquivos js
1381 // 1381 //
1382 var allScriptTags = ""; 1382 var allScriptTags = "";
1383 -for (i = 0; i < jsfiles.length; i++) 1383 +for (var i = 0; i < jsfiles.length; i++)
1384 { 1384 {
1385 var currentScriptTag = "<script src='" + scriptLocation + jsfiles[i] + "'></script>"; 1385 var currentScriptTag = "<script src='" + scriptLocation + jsfiles[i] + "'></script>";
1386 allScriptTags += currentScriptTag; 1386 allScriptTags += currentScriptTag;
@@ -1390,7 +1390,7 @@ document.write(allScriptTags); @@ -1390,7 +1390,7 @@ document.write(allScriptTags);
1390 //carrega os arquivos css 1390 //carrega os arquivos css
1391 // 1391 //
1392 var allCssTags = ""; 1392 var allCssTags = "";
1393 -for (i = 0; i < cssfiles.length; i++) 1393 +for (var i = 0; i < cssfiles.length; i++)
1394 { 1394 {
1395 var currentCssTag = "<link rel='stylesheet' type='text/css' href='" + scriptLocation + cssfiles[i] + "'/>"; 1395 var currentCssTag = "<link rel='stylesheet' type='text/css' href='" + scriptLocation + cssfiles[i] + "'/>";
1396 allCssTags += currentCssTag; 1396 allCssTags += currentCssTag;
admin/js/editormapfile.js
@@ -146,7 +146,7 @@ function initMenu() @@ -146,7 +146,7 @@ function initMenu()
146 core_carregando("ativa"); 146 core_carregando("ativa");
147 core_carregando("buscando temas..."); 147 core_carregando("buscando temas...");
148 core_ativaPainelAjuda("ajuda","botaoAjuda"); 148 core_ativaPainelAjuda("ajuda","botaoAjuda");
149 - core_pegaMapfiles("montaArvore()") 149 + core_pegaMapfiles("montaArvore()");
150 } 150 }
151 function ativaBotaoVerificarOrfaos(idBotao) 151 function ativaBotaoVerificarOrfaos(idBotao)
152 { 152 {
@@ -155,28 +155,28 @@ function ativaBotaoVerificarOrfaos(idBotao) @@ -155,28 +155,28 @@ function ativaBotaoVerificarOrfaos(idBotao)
155 verificaOrfaos(); 155 verificaOrfaos();
156 }; 156 };
157 //cria o botão de adição de um novo menu 157 //cria o botão de adição de um novo menu
158 - var verifica = new YAHOO.widget.Button(idBotao,{ onclick: { fn: temp } }); 158 + new YAHOO.widget.Button(idBotao,{ onclick: { fn: temp } });
159 } 159 }
160 function ativaBotaoAdicionaMapfile(idBotao) 160 function ativaBotaoAdicionaMapfile(idBotao)
161 { 161 {
162 var adiciona = function() 162 var adiciona = function()
163 { 163 {
164 - core_montaEditor("adicionaNovoMapfile()","450px","660px")  
165 - ins = "<p><b>Título do novo tema</b></p>" 164 + core_montaEditor("adicionaNovoMapfile()","450px","660px");
  165 + ins = "<p><b>Título do novo tema</b></p>";
166 ins += "<p>Em português: </p>"; 166 ins += "<p>Em português: </p>";
167 - ins += "<input size=50 type=text id='Etitulo' value='' /></p>" 167 + ins += "<input size=50 type=text id='Etitulo' value='' /></p>";
168 ins += "<p>Espanhol (opcional): </p>"; 168 ins += "<p>Espanhol (opcional): </p>";
169 - ins += "<input size=50 type=text id='EtituloES' value='' /></p>" 169 + ins += "<input size=50 type=text id='EtituloES' value='' /></p>";
170 ins += "<p>Inglês: (opcional)</p>"; 170 ins += "<p>Inglês: (opcional)</p>";
171 - ins += "<input size=50 type=text id='EtituloEN' value='' /></p>" 171 + ins += "<input size=50 type=text id='EtituloEN' value='' /></p>";
172 ins += "<p>Italiano: (opcional)</p>"; 172 ins += "<p>Italiano: (opcional)</p>";
173 - ins += "<input size=50 type=text id='EtituloIT' value='' /></p>"  
174 - ins += "<p>Nome do arquivo mapfile (sem .map): </p>"  
175 - ins += "<input size=50 type=text id='Ecodigo' value='' /></p>"  
176 - $i("editor_bd").innerHTML = ins 173 + ins += "<input size=50 type=text id='EtituloIT' value='' /></p>";
  174 + ins += "<p>Nome do arquivo mapfile (sem .map): </p>";
  175 + ins += "<input size=50 type=text id='Ecodigo' value='' /></p>";
  176 + $i("editor_bd").innerHTML = ins;
177 }; 177 };
178 //cria o botão de adição de um novo menu 178 //cria o botão de adição de um novo menu
179 - var adiciona = new YAHOO.widget.Button(idBotao,{ onclick: { fn: adiciona } }); 179 + new YAHOO.widget.Button(idBotao,{ onclick: { fn: adiciona } });
180 } 180 }
181 /* 181 /*
182 Function: montaArvore 182 Function: montaArvore