Commit 3bc9ba2e5efb4a2feaea5fad1e8afefec37bb3f1
1 parent
db20d659
Exists in
master
and in
7 other branches
Atualização admin1
Showing
21 changed files
with
1929 additions
and
77 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/html/admin.css
| ... | ... | @@ -9,7 +9,6 @@ |
| 9 | 9 | width: 100%; |
| 10 | 10 | text-align: left; |
| 11 | 11 | background-color: #4682b4; |
| 12 | - display: none; | |
| 13 | 12 | } |
| 14 | 13 | .yui-button#okcancel_checkboxOK button { |
| 15 | 14 | background: url(../../imagens/oxygen/16x16/document-save.png) 5% 50% no-repeat; |
| ... | ... | @@ -239,7 +238,7 @@ select{ |
| 239 | 238 | |
| 240 | 239 | .mascaraPrincipal { |
| 241 | 240 | position: relative; |
| 242 | - top: 10px; | |
| 241 | + top: -15px; | |
| 243 | 242 | width: 100%; |
| 244 | 243 | max-width:650pt; |
| 245 | 244 | text-align: left; |
| ... | ... | @@ -247,20 +246,19 @@ select{ |
| 247 | 246 | margin: 0px auto; |
| 248 | 247 | box-shadow: 0px 8px 10px 0px #888; |
| 249 | 248 | padding: 15px |
| 250 | - | |
| 251 | 249 | } |
| 252 | 250 | |
| 253 | 251 | .fundoPonto { |
| 254 | 252 | padding-top: 0px; |
| 255 | 253 | COLOR: #2F4632; |
| 256 | 254 | font-family: Verdana, Arial, Helvetica, sans-serif; |
| 255 | + background-color: rgb(250, 250, 250); | |
| 257 | 256 | margin: auto; |
| 258 | 257 | font-size: 12px; |
| 259 | 258 | } |
| 260 | 259 | |
| 261 | 260 | .cabecalhoGeral { |
| 262 | 261 | margin: 0px; |
| 263 | - display: none; | |
| 264 | 262 | } |
| 265 | 263 | |
| 266 | 264 | .yui-skin-sam .yui-panel .bd { | ... | ... |
admin/html/arvore.html
| ... | ... | @@ -47,7 +47,9 @@ body { |
| 47 | 47 | </head> |
| 48 | 48 | <body class=" yui-skin-sam fundoPonto"> |
| 49 | 49 | <center> |
| 50 | + <div class="bordaSuperior"> </div> | |
| 50 | 51 | <div class="mascaraPrincipal" id="divGeral"> |
| 52 | + <div id=cabecalhoPrincipal></div> | |
| 51 | 53 | <h1> |
| 52 | 54 | {{arvoreTemas}}<img |
| 53 | 55 | src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> | ... | ... |
admin/html/atlas.html
| ... | ... | @@ -22,7 +22,9 @@ body { |
| 22 | 22 | </head> |
| 23 | 23 | <body class=" yui-skin-sam fundoPonto"> |
| 24 | 24 | <center> |
| 25 | + <div class="bordaSuperior"> </div> | |
| 25 | 26 | <div class="mascaraPrincipal" id="divGeral"> |
| 27 | + <div id=cabecalhoPrincipal></div> | |
| 26 | 28 | <h1> |
| 27 | 29 | {{{adminAtlas}}}<img src="../imagens/04.png" |
| 28 | 30 | style="cursor: pointer" id=botaoAjuda /> | ... | ... |
admin/html/editormapfile.html
| ... | ... | @@ -50,7 +50,9 @@ table.ygtvtable { |
| 50 | 50 | </head> |
| 51 | 51 | <body class=" yui-skin-sam fundoPonto"> |
| 52 | 52 | <center> |
| 53 | + <div class="bordaSuperior"> </div> | |
| 53 | 54 | <div class="mascaraPrincipal" id="divGeral"> |
| 55 | + <div id=cabecalhoPrincipal></div> | |
| 54 | 56 | <h1> |
| 55 | 57 | {{{adminMapfile}}} |
| 56 | 58 | <img src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> |
| ... | ... | @@ -124,7 +126,7 @@ table.ygtvtable { |
| 124 | 126 | i3geo/admin/html/editormapfile.html |
| 125 | 127 | */ |
| 126 | 128 | core_parseMustacheBody(i3GEOadmin.editormapfile.dicionario); |
| 127 | - | |
| 129 | + | |
| 128 | 130 | if (i3GEO.util.pegaCookie("I3GEOletraAdmin")) { |
| 129 | 131 | letraAtual = i3GEO.util.pegaCookie("I3GEOletraAdmin"); |
| 130 | 132 | } else { |
| ... | ... | @@ -189,5 +191,5 @@ table.ygtvtable { |
| 189 | 191 | initMenu(); |
| 190 | 192 | }; |
| 191 | 193 | i3GEO.login.verificaOperacao("admin/html/editormapfile", i3GEO.configura.locaplic, temp, "sessao", i3GEO.login.dialogo.abreLogin); |
| 192 | - | |
| 194 | + | |
| 193 | 195 | </script> | ... | ... |
admin/html/estat_editor.html
| ... | ... | @@ -22,7 +22,9 @@ body { |
| 22 | 22 | |
| 23 | 23 | </head> |
| 24 | 24 | <body class=" yui-skin-sam fundoPonto"> |
| 25 | + <div class="bordaSuperior"> </div> | |
| 25 | 26 | <div class="mascaraPrincipal" id="divGeral"> |
| 27 | + <div id=cabecalhoPrincipal></div> | |
| 26 | 28 | <h1> |
| 27 | 29 | {{{estatEditor}}} <img src="../imagens/04.png" style="cursor: pointer" |
| 28 | 30 | id=botaoAjuda /> | ... | ... |
admin/html/gruposusuarios.html
| ... | ... | @@ -22,7 +22,9 @@ body { |
| 22 | 22 | </head> |
| 23 | 23 | <body class=" yui-skin-sam fundoPonto"> |
| 24 | 24 | <center> |
| 25 | + <div class="bordaSuperior"> </div> | |
| 25 | 26 | <div class="mascaraPrincipal" id="divGeral"> |
| 27 | + <div id=cabecalhoPrincipal></div> | |
| 26 | 28 | <h1> |
| 27 | 29 | {{{gruposusuarios}}} <img |
| 28 | 30 | src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> | ... | ... |
admin/html/mapas.html
| ... | ... | @@ -22,7 +22,9 @@ body { |
| 22 | 22 | </head> |
| 23 | 23 | <body class=" yui-skin-sam fundoPonto"> |
| 24 | 24 | <center> |
| 25 | + <div class="bordaSuperior"> </div> | |
| 25 | 26 | <div class="mascaraPrincipal" id="divGeral"> |
| 27 | + <div id=cabecalhoPrincipal></div> | |
| 26 | 28 | <h1> |
| 27 | 29 | {{{mapas}}}<img |
| 28 | 30 | src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> | ... | ... |
admin/html/menus.html
| ... | ... | @@ -21,6 +21,15 @@ body { |
| 21 | 21 | </head> |
| 22 | 22 | <body class=" yui-skin-sam"> |
| 23 | 23 | <div style="margin: 20px"> |
| 24 | + <div id=cabecalhoPrincipal style="width: 80%; text-align: left;"> | |
| 25 | + </div> | |
| 26 | + <div style="width: 80%; text-align: center;"> | |
| 27 | + <h1> | |
| 28 | + {{{menus}}} <img | |
| 29 | + src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> | |
| 30 | + </h1> | |
| 31 | + | |
| 32 | + </div> | |
| 24 | 33 | <div id="formulario" style="display: none"> |
| 25 | 34 | <div id="ajuda" style="display: none"> |
| 26 | 35 | <div class="hd">{{{ajuda}}}</div> | ... | ... |
admin/html/perfis.html
| ... | ... | @@ -22,7 +22,9 @@ body { |
| 22 | 22 | </head> |
| 23 | 23 | <body class=" yui-skin-sam fundoPonto"> |
| 24 | 24 | <center> |
| 25 | + <div class="bordaSuperior"> </div> | |
| 25 | 26 | <div class="mascaraPrincipal" id="divGeral"> |
| 27 | + <div id=cabecalhoPrincipal></div> | |
| 26 | 28 | <h1> |
| 27 | 29 | {{{perfis}}} <img src="../imagens/04.png" |
| 28 | 30 | style="cursor: pointer" id=botaoAjuda /> | ... | ... |
admin/html/subirshapefile.html
| ... | ... | @@ -21,9 +21,11 @@ body { |
| 21 | 21 | <script type="text/javascript" src="../dicionario/core.js"></script> |
| 22 | 22 | <link rel="stylesheet" type="text/css" href="admin.css"> |
| 23 | 23 | </head> |
| 24 | -<body class=" yui-skin-sam fundoPonto" style="background: none"> | |
| 24 | +<body class=" yui-skin-sam fundoPonto"> | |
| 25 | 25 | <center> |
| 26 | + <div class="bordaSuperior"> </div> | |
| 26 | 27 | <div class="mascaraPrincipal" id="divGeral"> |
| 28 | + <div id=cabecalhoPrincipal></div> | |
| 27 | 29 | <div id="formulario" style="display: none"> |
| 28 | 30 | <div id="conteudo" style="width: 500px"></div> |
| 29 | 31 | </div> | ... | ... |
admin/html/subirsimbolo.html
| ... | ... | @@ -22,9 +22,11 @@ body { |
| 22 | 22 | <script type="text/javascript" src="../dicionario/core.js"></script> |
| 23 | 23 | <link rel="stylesheet" type="text/css" href="admin.css"> |
| 24 | 24 | </head> |
| 25 | -<body class=" yui-skin-sam fundoPonto" style="background-color: white;"> | |
| 25 | +<body class=" yui-skin-sam fundoPonto"> | |
| 26 | 26 | <center> |
| 27 | + <div class="bordaSuperior"> </div> | |
| 27 | 28 | <div class="mascaraPrincipal" id="divGeral"> |
| 29 | + <div id=cabecalhoPrincipal></div> | |
| 28 | 30 | <div id="formulario" style="display: none"> |
| 29 | 31 | <div id="conteudo" style="width: 500px"></div> |
| 30 | 32 | </div> | ... | ... |
admin/html/tags.html
| ... | ... | @@ -22,7 +22,9 @@ body { |
| 22 | 22 | </head> |
| 23 | 23 | <body class=" yui-skin-sam fundoPonto"> |
| 24 | 24 | <center> |
| 25 | + <div class="bordaSuperior"> </div> | |
| 25 | 26 | <div class="mascaraPrincipal" id="divGeral"> |
| 27 | + <div id=cabecalhoPrincipal></div> | |
| 26 | 28 | <h1> |
| 27 | 29 | {{{tags}}} <img |
| 28 | 30 | src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> | ... | ... |
admin/html/usuarios.html
| ... | ... | @@ -22,7 +22,9 @@ body { |
| 22 | 22 | </head> |
| 23 | 23 | <body class=" yui-skin-sam fundoPonto"> |
| 24 | 24 | <center> |
| 25 | + <div class="bordaSuperior"> </div> | |
| 25 | 26 | <div class="mascaraPrincipal" id="divGeral"> |
| 27 | + <div id=cabecalhoPrincipal></div> | |
| 26 | 28 | <h1> |
| 27 | 29 | {{{usuarios}}}<img |
| 28 | 30 | src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> | ... | ... |
| ... | ... | @@ -0,0 +1,98 @@ |
| 1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
| 2 | +<html> | |
| 3 | +<head> | |
| 4 | +<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | |
| 5 | +<title>Usuarios</title> | |
| 6 | +<style type="text/css"> | |
| 7 | +/*margin and padding on body element | |
| 8 | + can introduce errors in determining | |
| 9 | + element position and are not recommended; | |
| 10 | + we turn them off as a foundation for YUI | |
| 11 | + CSS treatments. */ | |
| 12 | +body { | |
| 13 | + margin: 0; | |
| 14 | + padding: 0; | |
| 15 | +} | |
| 16 | +</style> | |
| 17 | +<script type="text/javascript" src="../js/core_.js"></script> | |
| 18 | +<script type="text/javascript" src="../dicionario/core.js"></script> | |
| 19 | +<script type="text/javascript" src="../dicionario/usuarios.js"></script> | |
| 20 | +<script type="text/javascript" src="../js/usuarios.js"></script> | |
| 21 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 22 | +</head> | |
| 23 | +<body class=" yui-skin-sam fundoPonto" style="background-color: white; margin-top: 20px;"> | |
| 24 | + <center> | |
| 25 | + <div class="mascaraPrincipal" id="divGeral"> | |
| 26 | + <h1> | |
| 27 | + {{{usuarios}}}<img | |
| 28 | + src="../imagens/04.png" style="cursor: pointer" id=botaoAjuda /> | |
| 29 | + </h1> | |
| 30 | + {{{txtUsuarios}}} | |
| 31 | + <div id="formulario" style="display: none"> | |
| 32 | + <div id="ajuda"> | |
| 33 | + <div class="hd">{{{ajuda}}}</div> | |
| 34 | + <div class="bd" style="height: 144px; overflow: auto"> | |
| 35 | + {{{txtAjuda}}} | |
| 36 | + </div> | |
| 37 | + <div class="ft"></div> | |
| 38 | + </div> | |
| 39 | + <input onclick="adicionaLinha()" type=button id=adiciona | |
| 40 | + value="{{{adicionaUsuario}}}" /> <br> | |
| 41 | + <p>{{{usuariosCadastrados}}}</p> | |
| 42 | + <div id="tabela" style="left: -5px;"></div> | |
| 43 | + <div id=logajax style="display: block"></div> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + </center> | |
| 47 | + <script> | |
| 48 | + /* | |
| 49 | + Title: Cadastro de usuarios | |
| 50 | + | |
| 51 | + Veja também: | |
| 52 | + | |
| 53 | + <core.js> | |
| 54 | + | |
| 55 | + <usuarios.js> | |
| 56 | + | |
| 57 | + Licenca: | |
| 58 | + | |
| 59 | + GPL2 | |
| 60 | + | |
| 61 | + i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 62 | + | |
| 63 | + Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 64 | + Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 65 | + | |
| 66 | + Este programa é software livre; você pode redistribuí-lo | |
| 67 | + e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 68 | + GNU conforme publicada pela Free Software Foundation; | |
| 69 | + | |
| 70 | + Este programa é distribuído na expectativa de que seja útil, | |
| 71 | + porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 72 | + de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 73 | + Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 74 | + Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 75 | + GNU junto com este programa; se não, escreva para a | |
| 76 | + Free Software Foundation, Inc., no endereço | |
| 77 | + 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 78 | + | |
| 79 | + Arquivo: | |
| 80 | + | |
| 81 | + i3geo/admin/html/usuarios.html | |
| 82 | + */ | |
| 83 | + //necessario para a ferramenta login e outras | |
| 84 | + i3GEO.configura = { | |
| 85 | + locaplic : "../.." | |
| 86 | + }; | |
| 87 | + // | |
| 88 | + core_parseMustacheBody(i3GEOadmin.usuarios.dicionario); | |
| 89 | + cabecalhoUsuarios("cabecalhoPrincipal", "usuarios"); | |
| 90 | + temp = function() { | |
| 91 | + document.getElementById("formulario").style.display = "block"; | |
| 92 | + initMenu(); | |
| 93 | + top.window.scroll(0,0); | |
| 94 | + }; | |
| 95 | + i3GEO.login.verificaOperacao("admin/html/usuarios", | |
| 96 | + i3GEO.configura.locaplic, temp, "sessao",i3GEO.login.dialogo.abreLogin); | |
| 97 | + </script> | |
| 98 | +</body> | ... | ... |
admin/js/core.js
| ... | ... | @@ -88,22 +88,20 @@ function cabecalhoMetaestat(id,excluir){ |
| 88 | 88 | ins += "<div id='i3GEONomeLogin' style=width:100%; > Login: "+u+"</div>"; |
| 89 | 89 | ins += "</fieldset>"; |
| 90 | 90 | temp = $i(id); |
| 91 | - if(temp){ | |
| 92 | - temp.innerHTML = ins; | |
| 93 | - for(i=0;i<n;i++){ | |
| 94 | - if(excluir === "principal" && botoes[i].link) | |
| 95 | - {botoes[i].link = "html/"+botoes[i].link;} | |
| 96 | - if(botoes[i].id !== excluir){ | |
| 97 | - botao = new YAHOO.widget.Button(botoes[i].id); | |
| 98 | - botao.addClass("abrir150"); | |
| 99 | - if(botoes[i].link){ | |
| 100 | - eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){window.location = \''+botoes[i].link+'\';}'); | |
| 101 | - } | |
| 102 | - else{ | |
| 103 | - eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){'+botoes[i].js+';}'); | |
| 104 | - } | |
| 105 | - | |
| 91 | + temp.innerHTML = ins; | |
| 92 | + for(i=0;i<n;i++){ | |
| 93 | + if(excluir === "principal" && botoes[i].link) | |
| 94 | + {botoes[i].link = "html/"+botoes[i].link;} | |
| 95 | + if(botoes[i].id !== excluir){ | |
| 96 | + botao = new YAHOO.widget.Button(botoes[i].id); | |
| 97 | + botao.addClass("abrir150"); | |
| 98 | + if(botoes[i].link){ | |
| 99 | + eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){window.location = \''+botoes[i].link+'\';}'); | |
| 100 | + } | |
| 101 | + else{ | |
| 102 | + eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){'+botoes[i].js+';}'); | |
| 106 | 103 | } |
| 104 | + | |
| 107 | 105 | } |
| 108 | 106 | } |
| 109 | 107 | try{ |
| ... | ... | @@ -135,22 +133,20 @@ function cabecalhoUsuarios(id,excluir){ |
| 135 | 133 | ins += "<div id='i3GEONomeLogin' style=width:100%; > Login: "+u+"</div>"; |
| 136 | 134 | ins += "</fieldset>"; |
| 137 | 135 | temp = $i(id); |
| 138 | - if(temp){ | |
| 139 | - temp.innerHTML = ins; | |
| 140 | - for(i=0;i<n;i++){ | |
| 141 | - if(excluir === "principal" && botoes[i].link) | |
| 142 | - {botoes[i].link = "html/"+botoes[i].link;} | |
| 143 | - if(botoes[i].id !== excluir){ | |
| 144 | - botao = new YAHOO.widget.Button(botoes[i].id); | |
| 145 | - botao.addClass("abrir150"); | |
| 146 | - if(botoes[i].link){ | |
| 147 | - eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){window.location = \''+botoes[i].link+'\';}'); | |
| 148 | - } | |
| 149 | - else{ | |
| 150 | - eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){'+botoes[i].js+';}'); | |
| 151 | - } | |
| 152 | - | |
| 136 | + temp.innerHTML = ins; | |
| 137 | + for(i=0;i<n;i++){ | |
| 138 | + if(excluir === "principal" && botoes[i].link) | |
| 139 | + {botoes[i].link = "html/"+botoes[i].link;} | |
| 140 | + if(botoes[i].id !== excluir){ | |
| 141 | + botao = new YAHOO.widget.Button(botoes[i].id); | |
| 142 | + botao.addClass("abrir150"); | |
| 143 | + if(botoes[i].link){ | |
| 144 | + eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){window.location = \''+botoes[i].link+'\';}'); | |
| 145 | + } | |
| 146 | + else{ | |
| 147 | + eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){'+botoes[i].js+';}'); | |
| 153 | 148 | } |
| 149 | + | |
| 154 | 150 | } |
| 155 | 151 | } |
| 156 | 152 | try{ |
| ... | ... | @@ -186,22 +182,20 @@ function cabecalhoGeral(id,excluir,prefixo){ |
| 186 | 182 | ins += "<div id='i3GEONomeLogin' style=width:100%; > Login: "+u+"</div>"; |
| 187 | 183 | ins += "</fieldset>"; |
| 188 | 184 | temp = $i(id); |
| 189 | - if(temp){ | |
| 190 | - temp.innerHTML = ins; | |
| 191 | - for(i=0;i<n;i++){ | |
| 192 | - if(excluir === "principal" && botoes[i].link) | |
| 193 | - {botoes[i].link = "html/"+botoes[i].link;} | |
| 194 | - if(botoes[i].id !== excluir){ | |
| 195 | - botao = new YAHOO.widget.Button(botoes[i].id); | |
| 196 | - botao.addClass("abrir150"); | |
| 197 | - if(botoes[i].link){ | |
| 198 | - eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){window.location = \''+botoes[i].link+'\';}'); | |
| 199 | - } | |
| 200 | - else{ | |
| 201 | - eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){'+botoes[i].js+';}'); | |
| 202 | - } | |
| 203 | - | |
| 185 | + temp.innerHTML = ins; | |
| 186 | + for(i=0;i<n;i++){ | |
| 187 | + if(excluir === "principal" && botoes[i].link) | |
| 188 | + {botoes[i].link = "html/"+botoes[i].link;} | |
| 189 | + if(botoes[i].id !== excluir){ | |
| 190 | + botao = new YAHOO.widget.Button(botoes[i].id); | |
| 191 | + botao.addClass("abrir150"); | |
| 192 | + if(botoes[i].link){ | |
| 193 | + eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){window.location = \''+botoes[i].link+'\';}'); | |
| 204 | 194 | } |
| 195 | + else{ | |
| 196 | + eval('$i("'+botoes[i].id+'-button'+'").onclick = function(){'+botoes[i].js+';}'); | |
| 197 | + } | |
| 198 | + | |
| 205 | 199 | } |
| 206 | 200 | } |
| 207 | 201 | try{ |
| ... | ... | @@ -366,7 +360,7 @@ function core_handleFailure(o,texto) |
| 366 | 360 | } |
| 367 | 361 | if (!YAHOO.carregando.container.wait) |
| 368 | 362 | { |
| 369 | - YAHOO.carregando.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",fixedcenter: false,close: true,draggable: false,zindex:4,modal: true,visible: false}); | |
| 363 | + YAHOO.carregando.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",fixedcenter: true,close: true,draggable: false,zindex:4,modal: true,visible: false}); | |
| 370 | 364 | YAHOO.carregando.container.wait.setHeader("Aguarde..."); |
| 371 | 365 | YAHOO.carregando.container.wait.render(document.body); |
| 372 | 366 | } |
| ... | ... | @@ -429,7 +423,7 @@ function core_carregando(tipo) |
| 429 | 423 | YAHOO.namespace("carregando.container"); |
| 430 | 424 | if (!YAHOO.carregando.container.wait) |
| 431 | 425 | { |
| 432 | - YAHOO.carregando.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",fixedcenter: false,close: true,draggable: false,zindex:4,modal: true,visible: false}); | |
| 426 | + YAHOO.carregando.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",fixedcenter: true,close: true,draggable: false,zindex:4,modal: true,visible: false}); | |
| 433 | 427 | YAHOO.carregando.container.wait.setHeader("Aguarde..."); |
| 434 | 428 | |
| 435 | 429 | YAHOO.carregando.container.wait.setBody("<img src=\""+img+"\"/>"); |
| ... | ... | @@ -470,7 +464,7 @@ function core_dialogoContinua(handleYes,handleNo,mensagem,largura,cabecalho) |
| 470 | 464 | YAHOO.continua.container.simpledialog1 = |
| 471 | 465 | new YAHOO.widget.SimpleDialog("simpledialog1", |
| 472 | 466 | { width: largura+"px", |
| 473 | - fixedcenter: false, | |
| 467 | + fixedcenter: true, | |
| 474 | 468 | visible: false, |
| 475 | 469 | draggable: false, |
| 476 | 470 | close: true, |
| ... | ... | @@ -507,7 +501,7 @@ function core_dialogoPergunta(handleYes,handleNo,mensagem,largura) |
| 507 | 501 | YAHOO.continua.container.simpledialog1 = |
| 508 | 502 | new YAHOO.widget.SimpleDialog("simpledialog1", |
| 509 | 503 | { width: largura+"px", |
| 510 | - fixedcenter: false, | |
| 504 | + fixedcenter: true, | |
| 511 | 505 | visible: false, |
| 512 | 506 | draggable: false, |
| 513 | 507 | close: true, |
| ... | ... | @@ -1585,7 +1579,7 @@ function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal,bsalva,bcancela) |
| 1585 | 1579 | ); |
| 1586 | 1580 | } |
| 1587 | 1581 | } |
| 1588 | - YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:false,close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } ); | |
| 1582 | + YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { fixedcenter:"contained",close:true,width:w, overflow:"auto",modal: modal,visible:false,constraintoviewport:true } ); | |
| 1589 | 1583 | YAHOO.admin.container.panelEditor.render(); |
| 1590 | 1584 | } |
| 1591 | 1585 | else | ... | ... |
| ... | ... | @@ -0,0 +1,1735 @@ |
| 1 | +/* | |
| 2 | +Title: core.js | |
| 3 | + | |
| 4 | +Funções de uso comum das interfaces dos editores | |
| 5 | + | |
| 6 | +Licenca: | |
| 7 | + | |
| 8 | +GPL2 | |
| 9 | + | |
| 10 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | + | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma copia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | + | |
| 28 | +Arquivo: | |
| 29 | + | |
| 30 | +i3geo/admin/js/core.js | |
| 31 | +*/ | |
| 32 | + | |
| 33 | +/* | |
| 34 | +Function: $i | |
| 35 | + | |
| 36 | +Pega um objeto do documento. | |
| 37 | + | |
| 38 | +Exemplo: $i("box1") | |
| 39 | + | |
| 40 | +Parâmetros: | |
| 41 | + | |
| 42 | +id - id do objeto | |
| 43 | + | |
| 44 | +Retorno: | |
| 45 | + | |
| 46 | +object - objeto javaScript | |
| 47 | +*/ | |
| 48 | +$i = function(id) | |
| 49 | +{return document.getElementById(id);}; | |
| 50 | +/* | |
| 51 | +Variable: $mapfiles | |
| 52 | + | |
| 53 | +Armazena o objeto com a lista de mapfiles | |
| 54 | +*/ | |
| 55 | +$mapfiles = ""; | |
| 56 | +/* | |
| 57 | +Variable: $tags | |
| 58 | + | |
| 59 | +Armazena o objeto com a lista de tags | |
| 60 | +*/ | |
| 61 | +$tags = ""; | |
| 62 | +/* | |
| 63 | +Variable: $perfis | |
| 64 | + | |
| 65 | +Armazena o objeto com a lista de perfis | |
| 66 | +*/ | |
| 67 | +$perfis = ""; | |
| 68 | +function cabecalhoMetaestat(id,excluir){ | |
| 69 | + | |
| 70 | + try{ | |
| 71 | + i3GEO.login.recarrega = true; | |
| 72 | + } | |
| 73 | + catch(e){ } | |
| 74 | +} | |
| 75 | + | |
| 76 | +function cabecalhoUsuarios(id,excluir){ | |
| 77 | + try{ | |
| 78 | + i3GEO.login.recarrega = true; | |
| 79 | + } | |
| 80 | + catch(e){ } | |
| 81 | + //temp.style.border = "solid 1px gray"; | |
| 82 | + //temp.style.padding = "10px"; | |
| 83 | +} | |
| 84 | +function cabecalhoGeral(id,excluir,prefixo){ | |
| 85 | + | |
| 86 | + try{ | |
| 87 | + i3GEO.login.recarrega = true; | |
| 88 | + } | |
| 89 | + catch(e){ } | |
| 90 | +} | |
| 91 | +/* | |
| 92 | +Function: core_arvore | |
| 93 | + | |
| 94 | +Cria uma arvore com base em um objeto contendo as propriedades. | |
| 95 | + | |
| 96 | +No objeto com as propriedades, se "url" for igual a "", sera incluido o texto original definido em "text". | |
| 97 | + | |
| 98 | +Parametros: | |
| 99 | + | |
| 100 | +titulo - {String} cabecalho da arvore | |
| 101 | + | |
| 102 | +onde - {String} nome do id doelemento que contera a arvore | |
| 103 | + | |
| 104 | +obj - {Object} objeto contendo os parametros, exemplo | |
| 105 | + | |
| 106 | + g_listaPropriedades = { | |
| 107 | + | |
| 108 | + "propriedades": [ | |
| 109 | + | |
| 110 | + { text: "p2", url: "javascript:tipoimagem()" } | |
| 111 | + | |
| 112 | + ]} | |
| 113 | + | |
| 114 | +*/ | |
| 115 | +function core_arvore(titulo,onde,obj){ | |
| 116 | + var arvore,root,tempNode,d,c,i,linha,conteudo,j,temaNode; | |
| 117 | + if(!$i(onde)){return;} | |
| 118 | + arvore = new YAHOO.widget.TreeView(onde); | |
| 119 | + root = arvore.getRoot(); | |
| 120 | + try{ | |
| 121 | + tempNode = new YAHOO.widget.TextNode('', root, false); | |
| 122 | + tempNode.isLeaf = false; | |
| 123 | + tempNode.enableHighlight = false; | |
| 124 | + } | |
| 125 | + catch(e){ | |
| 126 | + if(typeof(console) !== 'undefined'){console.error(e);} | |
| 127 | + } | |
| 128 | + titulo = "<table><tr><td><b>"+titulo+"</b></td><td></td></tr></table>"; | |
| 129 | + d = {html:titulo}; | |
| 130 | + tempNode = new YAHOO.widget.HTMLNode(d, root, true,true); | |
| 131 | + tempNode.enableHighlight = false; | |
| 132 | + c = obj.propriedades.length; | |
| 133 | + for (i=0, j=c; i<j; i++){ | |
| 134 | + linha = obj.propriedades[i]; | |
| 135 | + if(linha.url !== "") | |
| 136 | + {conteudo = "<a href='#' onclick='"+linha.url+"'>"+linha.text+"</a>";} | |
| 137 | + else | |
| 138 | + {conteudo = linha.text;} | |
| 139 | + d = {html:conteudo}; | |
| 140 | + temaNode = new YAHOO.widget.HTMLNode(d, tempNode, false,true); | |
| 141 | + temaNode.enableHighlight = false; | |
| 142 | + } | |
| 143 | + arvore.collapseAll(); | |
| 144 | + arvore.draw(); | |
| 145 | +} | |
| 146 | +/* | |
| 147 | +Function: core_movimentaNo | |
| 148 | + | |
| 149 | +Movimenta um no para cima ou para baixo na árvore. | |
| 150 | + | |
| 151 | +Essa função utiliza uma árvore que deve estar armazenada no objeto tree | |
| 152 | + | |
| 153 | +Parameters: | |
| 154 | + | |
| 155 | +tipo - sobe|desce | |
| 156 | + | |
| 157 | +no - objeto no que será movimentado | |
| 158 | + | |
| 159 | +Return: | |
| 160 | + | |
| 161 | +true|false - se o movimento ocorreu | |
| 162 | +*/ | |
| 163 | +function core_movimentaNo(tipo,no) | |
| 164 | +{ | |
| 165 | + var movimenta = false; | |
| 166 | + if(tipo == "sobe") | |
| 167 | + { | |
| 168 | + var noanterior = no.previousSibling; | |
| 169 | + if(noanterior) | |
| 170 | + { | |
| 171 | + if(noanterior.previousSibling && noanterior.data.tipo != "etiqueta") | |
| 172 | + { | |
| 173 | + tree.popNode(no); | |
| 174 | + no.insertBefore(noanterior); | |
| 175 | + tree.draw(); | |
| 176 | + movimenta = true; | |
| 177 | + } | |
| 178 | + } | |
| 179 | + } | |
| 180 | + if(tipo == "desce") | |
| 181 | + { | |
| 182 | + var noseguinte = no.nextSibling; | |
| 183 | + if(noseguinte) | |
| 184 | + { | |
| 185 | + tree.popNode(no); | |
| 186 | + no.insertAfter(noseguinte); | |
| 187 | + tree.draw(); | |
| 188 | + movimenta = true; | |
| 189 | + } | |
| 190 | + } | |
| 191 | + return movimenta; | |
| 192 | +} | |
| 193 | +/* | |
| 194 | +Function: core_handleSuccess | |
| 195 | + | |
| 196 | +Processa o retorno da chamada em ajax quando tiver sucesso. Esta é uma | |
| 197 | +função genérica, pouco usada. | |
| 198 | + | |
| 199 | +Parameters: | |
| 200 | + | |
| 201 | +o - string retornada pelo ajax | |
| 202 | +*/ | |
| 203 | +function core_handleSuccess(o) | |
| 204 | +{ | |
| 205 | + //div onde será mostrado o log | |
| 206 | + if(!$i('logajax')) | |
| 207 | + {document.body.innerHTML += "<div id=logajax ></div>";} | |
| 208 | + log = $i('logajax'); | |
| 209 | + YAHOO.log("The success handler was called. tId: " + o.tId + ".", "info", "example"); | |
| 210 | + if(o.responseText !== undefined) | |
| 211 | + { | |
| 212 | + log.innerHTML = "<li>Transaction id: " + o.tId + "</li>"; | |
| 213 | + log.innerHTML += "<li>HTTP status: " + o.status + "</li>"; | |
| 214 | + log.innerHTML += "<li>Status code message: " + o.statusText + "</li>"; | |
| 215 | + log.innerHTML += "<li>HTTP headers: <ul>" + o.getAllResponseHeaders + "</ul></li>"; | |
| 216 | + log.innerHTML += "<li>Server response: " + o.responseText + "</li>"; | |
| 217 | + log.innerHTML += "<li>Argument object: Object ( [foo] => " + o.argument.foo + " [bar] => " + o.argument.bar +" )</li>"; | |
| 218 | + } | |
| 219 | +} | |
| 220 | +/* | |
| 221 | +Function: core_handleFailure | |
| 222 | + | |
| 223 | +Processa o retorno da chamada em ajax quando tiver falhado. | |
| 224 | + | |
| 225 | +Parameters: | |
| 226 | + | |
| 227 | +o - string retornada pelo ajax | |
| 228 | +*/ | |
| 229 | +function core_handleFailure(o,texto) | |
| 230 | +{ | |
| 231 | + //div onde será mostrado o log | |
| 232 | + //alert(texto) | |
| 233 | + if(!$i('logajax')) | |
| 234 | + {return;} | |
| 235 | + log = $i('logajax'); | |
| 236 | + //YAHOO.log("The failure handler was called. tId: " + o.tId + ".", "info", "example"); | |
| 237 | + if(o.responseText !== undefined) | |
| 238 | + { | |
| 239 | + if(o.statusText != "OK"){ | |
| 240 | + log.innerHTML = "<ul><li>Transaction id: " + o.tId + "</li>"; | |
| 241 | + log.innerHTML += "<li>HTTP status: " + o.status + "</li>"; | |
| 242 | + log.innerHTML += "<li>Status code message: " + o.statusText + "</li>"; | |
| 243 | + log.innerHTML += "<li>PHP message: " + texto + "</li></ul>"; | |
| 244 | + } | |
| 245 | + } | |
| 246 | + if (!YAHOO.carregando.container.wait) | |
| 247 | + { | |
| 248 | + YAHOO.carregando.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",y: 50,fixedcenter: false,close: true,draggable: false,zindex:4,modal: false,visible: false}); | |
| 249 | + YAHOO.carregando.container.wait.setHeader("Aguarde..."); | |
| 250 | + YAHOO.carregando.container.wait.render(document.body); | |
| 251 | + } | |
| 252 | + else | |
| 253 | + {YAHOO.carregando.container.wait.setBody(log.innerHTML);} | |
| 254 | +} | |
| 255 | +/* | |
| 256 | +Function: core_makeRequest | |
| 257 | + | |
| 258 | +Executa uma chamada em ajax. | |
| 259 | + | |
| 260 | +Parameters: | |
| 261 | + | |
| 262 | +sUrl - url que será executada | |
| 263 | + | |
| 264 | +callback - função que processará o retorno | |
| 265 | + | |
| 266 | +tipo - GET ou POST | |
| 267 | + | |
| 268 | +postpar - parametros quando o tipo for post | |
| 269 | +*/ | |
| 270 | +function core_makeRequest(sUrl,callback,tipo,postpar) | |
| 271 | +{ | |
| 272 | + sUrl = escape(sUrl); | |
| 273 | + re = new RegExp("%3F", "g"); | |
| 274 | + sUrl = sUrl.replace(re,'?'); | |
| 275 | + re = new RegExp("%3D", "g"); | |
| 276 | + sUrl = sUrl.replace(re,'='); | |
| 277 | + re = new RegExp("%26", "g"); | |
| 278 | + sUrl = sUrl.replace(re,'&'); | |
| 279 | + | |
| 280 | + re = new RegExp("%3A", "g"); | |
| 281 | + sUrl = sUrl.replace(re,':'); | |
| 282 | + | |
| 283 | + if(arguments.length == 2) | |
| 284 | + {tipo = "GET";} | |
| 285 | + if(postpar){ | |
| 286 | + //YAHOO.util.Connect.setDefaultPostHeader('application/json;charset=ISO-8859-1'); | |
| 287 | + YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postpar); | |
| 288 | + } | |
| 289 | + else{ | |
| 290 | + YAHOO.util.Connect.asyncRequest(tipo, sUrl, callback); | |
| 291 | + } | |
| 292 | +} | |
| 293 | +/* | |
| 294 | +Function: core_carregando | |
| 295 | + | |
| 296 | +Mostra uma janela de aguarde | |
| 297 | + | |
| 298 | +Parameters: | |
| 299 | + | |
| 300 | +tipo - ativa|desativa|string com uma mensagem | |
| 301 | +*/ | |
| 302 | +function core_carregando(tipo) | |
| 303 | +{ | |
| 304 | + var img = "../../imagens/aguarde.gif"; | |
| 305 | + if(i3GEO && i3GEO.configura.locaplic){ | |
| 306 | + img = i3GEO.configura.locaplic+"/imagens/aguarde.gif"; | |
| 307 | + } | |
| 308 | + YAHOO.namespace("carregando.container"); | |
| 309 | + if (!YAHOO.carregando.container.wait) | |
| 310 | + { | |
| 311 | + YAHOO.carregando.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",fixedcenter: false, y: 50,close: true,draggable: false,zindex:4,modal: false,visible: false}); | |
| 312 | + YAHOO.carregando.container.wait.setHeader("Aguarde..."); | |
| 313 | + | |
| 314 | + YAHOO.carregando.container.wait.setBody("<img src=\""+img+"\"/>"); | |
| 315 | + YAHOO.carregando.container.wait.render(document.body); | |
| 316 | + } | |
| 317 | + else | |
| 318 | + {YAHOO.carregando.container.wait.show();} | |
| 319 | + YAHOO.carregando.container.wait.setBody("<img src=\""+img+"\"/>"); | |
| 320 | + if(tipo == "ativa") | |
| 321 | + {YAHOO.carregando.container.wait.show();} | |
| 322 | + if(tipo == "desativa") | |
| 323 | + {YAHOO.carregando.container.wait.hide();} | |
| 324 | + if(tipo != "ativa" && tipo != "desativa") | |
| 325 | + {YAHOO.carregando.container.wait.setBody("<img src=\""+img+"\"/> "+tipo);} | |
| 326 | +} | |
| 327 | +/* | |
| 328 | +Function: core_dialogoContinua | |
| 329 | + | |
| 330 | +Mostra um diálogo do tipo sim não | |
| 331 | + | |
| 332 | +Parameters: | |
| 333 | + | |
| 334 | +handleYes - função para sim | |
| 335 | + | |
| 336 | +handleNo - função para não | |
| 337 | + | |
| 338 | +mensagem - mensagem do diálogo | |
| 339 | + | |
| 340 | +largura - largura do diálogo em px | |
| 341 | +*/ | |
| 342 | +function core_dialogoContinua(handleYes,handleNo,mensagem,largura,cabecalho) | |
| 343 | +{ | |
| 344 | + if(!cabecalho || cabecalho === ""){ | |
| 345 | + cabecalho = "Tem certeza?"; | |
| 346 | + } | |
| 347 | + // Instantiate the Dialog | |
| 348 | + YAHOO.namespace("continua.container"); | |
| 349 | + YAHOO.continua.container.simpledialog1 = | |
| 350 | + new YAHOO.widget.SimpleDialog("simpledialog1", | |
| 351 | + { width: largura+"px", | |
| 352 | + fixedcenter: false, y: 50, | |
| 353 | + visible: false, | |
| 354 | + draggable: false, | |
| 355 | + close: true, | |
| 356 | + text: mensagem, | |
| 357 | + icon: YAHOO.widget.SimpleDialog.ICON_HELP, | |
| 358 | + modal: false, | |
| 359 | + constraintoviewport: true, | |
| 360 | + buttons: [ { text:"Sim", handler:handleYes, isDefault:true }, | |
| 361 | + { text:"Não", handler:handleNo } ] | |
| 362 | + } ); | |
| 363 | + YAHOO.continua.container.simpledialog1.setHeader(cabecalho); | |
| 364 | + YAHOO.continua.container.simpledialog1.render(document.body); | |
| 365 | + YAHOO.continua.container.simpledialog1.show(); | |
| 366 | +} | |
| 367 | +/* | |
| 368 | +Function: core_dialogoPergunta | |
| 369 | + | |
| 370 | +Mostra um diálogo do tipo sim não com uma pergunta | |
| 371 | + | |
| 372 | +Parameters: | |
| 373 | + | |
| 374 | +handleYes - função para sim | |
| 375 | + | |
| 376 | +handleNo - função para não | |
| 377 | + | |
| 378 | +mensagem - mensagem do diálogo | |
| 379 | + | |
| 380 | +largura - largura do diálogo em px | |
| 381 | +*/ | |
| 382 | +function core_dialogoPergunta(handleYes,handleNo,mensagem,largura) | |
| 383 | +{ | |
| 384 | + // Instantiate the Dialog | |
| 385 | + YAHOO.namespace("continua.container"); | |
| 386 | + YAHOO.continua.container.simpledialog1 = | |
| 387 | + new YAHOO.widget.SimpleDialog("simpledialog1", | |
| 388 | + { width: largura+"px", | |
| 389 | + fixedcenter: false, y: 50, | |
| 390 | + visible: false, | |
| 391 | + draggable: false, | |
| 392 | + close: true, | |
| 393 | + text: mensagem, | |
| 394 | + icon: "", | |
| 395 | + modal: false, | |
| 396 | + constraintoviewport: true, | |
| 397 | + buttons: [ { text:"Continua", handler:handleYes, isDefault:true }, | |
| 398 | + { text:"Cancela", handler:handleNo } ] | |
| 399 | + } ); | |
| 400 | + //YAHOO.continua.container.simpledialog1.setHeader("Tem certeza?"); | |
| 401 | + YAHOO.continua.container.simpledialog1.render(document.body); | |
| 402 | + YAHOO.continua.container.simpledialog1.show(); | |
| 403 | +} | |
| 404 | +/* | |
| 405 | +Function: core_ativaPainelAjuda | |
| 406 | + | |
| 407 | +Parameters: | |
| 408 | + | |
| 409 | +id - id do elemento que receberá o painel | |
| 410 | + | |
| 411 | +botao - id do elemento que deverá ser lcicado para abrir o painel | |
| 412 | +*/ | |
| 413 | +function core_ativaPainelAjuda(id,botao) | |
| 414 | +{ | |
| 415 | + $i(id).style.display = "block"; | |
| 416 | + if(!YAHOO.admin.container.panelAjuda) | |
| 417 | + { | |
| 418 | + YAHOO.admin.container.panelAjuda = new YAHOO.widget.Panel(id, { width:"350px", height:"200px",overflow:"auto", visible:false,constraintoviewport:true } ); | |
| 419 | + YAHOO.admin.container.panelAjuda.render(); | |
| 420 | + } | |
| 421 | + if(arguments.length == 2) | |
| 422 | + YAHOO.util.Event.addListener(botao, "click", YAHOO.admin.container.panelAjuda.show, YAHOO.admin.container.panelAjuda, true); | |
| 423 | + else | |
| 424 | + YAHOO.admin.container.panelAjuda.show(); | |
| 425 | +} | |
| 426 | +/* | |
| 427 | +Function: core_ativaPainelTexto | |
| 428 | + | |
| 429 | +Parameters: | |
| 430 | + | |
| 431 | +id - id do elemento que receberá o painel | |
| 432 | +*/ | |
| 433 | +function core_ativaPainelTexto(id) | |
| 434 | +{ | |
| 435 | + YAHOO.admin.container.panelTexto = new YAHOO.widget.Panel(id, { width:"350px", height:"200px",overflow:"auto", visible:false,constraintoviewport:true } ); | |
| 436 | + YAHOO.admin.container.panelTexto.render(); | |
| 437 | + YAHOO.admin.container.panelTexto.show(); | |
| 438 | +} | |
| 439 | +/* | |
| 440 | +function: core_pegaPerfis | |
| 441 | + | |
| 442 | +Pega a lista de perfis | |
| 443 | + | |
| 444 | +<PEGAPERFIS> | |
| 445 | + | |
| 446 | +Parameters: | |
| 447 | + | |
| 448 | +funcao - (opcional) string com o nome da funcao que será executada apos a chamada ajax ter tido sucesso | |
| 449 | + | |
| 450 | +Return | |
| 451 | + | |
| 452 | +$perfis - variável global com o objeto perfis | |
| 453 | + | |
| 454 | +$perfisArray - array com a lista de perfis | |
| 455 | +*/ | |
| 456 | +function core_pegaPerfis(funcao) | |
| 457 | +{ | |
| 458 | + if(arguments.length == 0) | |
| 459 | + {funcao = "";} | |
| 460 | + //pega a lista de perfis | |
| 461 | + var sUrl = "../php/menutemas.php?funcao=pegaPerfis"; | |
| 462 | + var callback = | |
| 463 | + { | |
| 464 | + success:function(o) | |
| 465 | + { | |
| 466 | + try | |
| 467 | + { | |
| 468 | + $perfis = YAHOO.lang.JSON.parse(o.responseText); | |
| 469 | + $perfisArray = new Array(); | |
| 470 | + for (var i=0;i<$perfis.length;i++) | |
| 471 | + {$perfisArray.push($perfis[i].perfil);} | |
| 472 | + if(funcao != "") | |
| 473 | + eval(funcao); | |
| 474 | + } | |
| 475 | + catch(e){core_handleFailure(o,o.responseText);} | |
| 476 | + }, | |
| 477 | + failure:core_handleFailure, | |
| 478 | + argument: { foo:"foo", bar:"bar" } | |
| 479 | + }; | |
| 480 | + core_makeRequest(sUrl,callback); | |
| 481 | +} | |
| 482 | +/* | |
| 483 | +function: core_pegaMapfiles | |
| 484 | + | |
| 485 | +Pega a lista de mapfiles | |
| 486 | + | |
| 487 | +<LISTAMAPSTEMAS> | |
| 488 | + | |
| 489 | +Parameters: | |
| 490 | + | |
| 491 | +funcaoM - (opcional) nome da funcao que será executada ao terminar a busca pelos dados | |
| 492 | + | |
| 493 | +letra - (opcional) letra inicial utilizada para filtrar a lista | |
| 494 | + | |
| 495 | +filtro - (opcional) string com o filtro, por exemplo, "'download_tema' = 'SIM'" | |
| 496 | + | |
| 497 | +checaNomes - (0pcional) bate o nome do mapfile (tema) com o registro no banco | |
| 498 | + | |
| 499 | +checaNames - (opcional) bate o nome do mapfile com o nome do layer | |
| 500 | +*/ | |
| 501 | +function core_pegaMapfiles(funcaoM,letra,filtro,checaNomes,checaNames) | |
| 502 | +{ | |
| 503 | + if(!letra){ | |
| 504 | + letra = ""; | |
| 505 | + } | |
| 506 | + if(!filtro){ | |
| 507 | + filtro = ""; | |
| 508 | + } | |
| 509 | + if(!funcaoM){ | |
| 510 | + funcaoM = ""; | |
| 511 | + } | |
| 512 | + if(!checaNomes){ | |
| 513 | + checaNomes = "false"; | |
| 514 | + } | |
| 515 | + if(!checaNames){ | |
| 516 | + checaNames = "false"; | |
| 517 | + } | |
| 518 | + if($i("iniciaisLetras")){ | |
| 519 | + $i("iniciaisLetras").value = letra; | |
| 520 | + } | |
| 521 | + var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra+"&filtro="+filtro+"&checaNomes="+checaNomes+"&checaNames="+checaNames; | |
| 522 | + var callbackM = | |
| 523 | + { | |
| 524 | + success:function(o) | |
| 525 | + { | |
| 526 | + try | |
| 527 | + { | |
| 528 | + $mapfiles = YAHOO.lang.JSON.parse(o.responseText); | |
| 529 | + if(funcaoM != "") | |
| 530 | + eval(funcaoM); | |
| 531 | + } | |
| 532 | + catch(e){core_handleFailure(o,o.responseText);} | |
| 533 | + }, | |
| 534 | + failure:core_handleFailure, | |
| 535 | + argument: { foo:"foo", bar:"bar" } | |
| 536 | + }; | |
| 537 | + core_makeRequest(sUrl,callbackM); | |
| 538 | +} | |
| 539 | +/* | |
| 540 | +Function: core_comboMapfiles | |
| 541 | + | |
| 542 | +Cria um combo para escolha do mapfile | |
| 543 | + | |
| 544 | +Parameters: | |
| 545 | + | |
| 546 | +onde - id do elemento que receberá o combo | |
| 547 | + | |
| 548 | +id - id do combo que será criado | |
| 549 | + | |
| 550 | +marcar - valor que será marcado como selecionado | |
| 551 | + | |
| 552 | +funcao - string com o nome da função que será executada no evento onchange | |
| 553 | + | |
| 554 | +recarrega {booblean} - força recarregar o combo de mapfiles | |
| 555 | +*/ | |
| 556 | +function core_comboMapfiles(onde,id,marcar,funcao,recarrega) | |
| 557 | +{ | |
| 558 | + if(arguments.length == 3) | |
| 559 | + {funcao = "";} | |
| 560 | + if(!recarrega) | |
| 561 | + {recarrega = false;} | |
| 562 | + if($mapfiles == "" || recarrega === true) | |
| 563 | + { | |
| 564 | + core_pegaMapfiles("core_comboMapfiles('"+onde+"','"+id+"','"+marcar+"','"+funcao+"')"); | |
| 565 | + } | |
| 566 | + else | |
| 567 | + { | |
| 568 | + if (funcao != "") | |
| 569 | + {funcao = "onchange='"+funcao+"'";} | |
| 570 | + ins = "<div class='styled-select'><select id='"+id+"' "+funcao+" >"; | |
| 571 | + ins += core_comboObjeto($mapfiles,"codigo","codigo",marcar); | |
| 572 | + ins += "</select></div>"; | |
| 573 | + $i(onde).innerHTML = ins; | |
| 574 | + } | |
| 575 | +} | |
| 576 | +/* | |
| 577 | +Function: core_comboPerfis | |
| 578 | + | |
| 579 | +Cria um combo para escolha de perfil | |
| 580 | + | |
| 581 | +Parameters: | |
| 582 | + | |
| 583 | +onde - id do elemento que receberá o combo | |
| 584 | + | |
| 585 | +id - id do combo que será criado | |
| 586 | + | |
| 587 | +marcar - valor que será marcado como selecionado | |
| 588 | + | |
| 589 | +funcao - string com o nome da função que será executada no evento onchange | |
| 590 | +*/ | |
| 591 | +function core_comboPerfis(onde,id,marcar,funcao) | |
| 592 | +{ | |
| 593 | + if(arguments.length == 3) | |
| 594 | + {funcao = "";} | |
| 595 | + if($perfis == "") | |
| 596 | + { | |
| 597 | + core_pegaPerfis("core_comboPerfis('"+onde+"','"+id+"','"+marcar+"','"+funcao+"')"); | |
| 598 | + } | |
| 599 | + else | |
| 600 | + { | |
| 601 | + if (funcao != "") | |
| 602 | + {funcao = "onchange='"+funcao+"'";} | |
| 603 | + ins = "<div class='styled-select150'><select id='"+id+"' "+funcao+" >"; | |
| 604 | + ins += core_comboObjeto($perfis,"perfil","perfil",marcar); | |
| 605 | + ins += "</select></div>"; | |
| 606 | + $i(onde).innerHTML = ins; | |
| 607 | + } | |
| 608 | +} | |
| 609 | +/* | |
| 610 | +Function: core_comboPranchas | |
| 611 | + | |
| 612 | +Cria um combo para escolha de pranchas de um atlas | |
| 613 | + | |
| 614 | +<PEGAPRANCHAS> | |
| 615 | + | |
| 616 | +Parameters: | |
| 617 | + | |
| 618 | +onde - id do elemento que receberá o combo | |
| 619 | + | |
| 620 | +id - id do combo que será criado | |
| 621 | + | |
| 622 | +marcar - valor que será marcado como selecionado | |
| 623 | + | |
| 624 | +funcao - string com o nome da função que será executada no evento onchange | |
| 625 | +*/ | |
| 626 | +function core_comboPranchas(onde,id,marcar,funcao,id_atlas) | |
| 627 | +{ | |
| 628 | + var sUrl = "../php/atlas.php?funcao=pegaPranchas&id_atlas="+id_atlas; | |
| 629 | + var callback = | |
| 630 | + { | |
| 631 | + success:function(o) | |
| 632 | + { | |
| 633 | + try | |
| 634 | + { | |
| 635 | + var valores = YAHOO.lang.JSON.parse(o.responseText); | |
| 636 | + if(arguments.length == 3) | |
| 637 | + {funcao = "";} | |
| 638 | + if (funcao != "") | |
| 639 | + {funcao = "onchange='"+funcao+"'";} | |
| 640 | + ins = "<div class='styled-select150'><select id='"+id+"' "+funcao+" >"; | |
| 641 | + ins += core_comboObjeto(valores,"id_prancha","titulo_prancha",marcar); | |
| 642 | + ins += "</select></div>"; | |
| 643 | + $i(onde).innerHTML = ins; | |
| 644 | + } | |
| 645 | + catch(e){core_handleFailure(e,o.responseText);} | |
| 646 | + }, | |
| 647 | + failure:core_handleFailure, | |
| 648 | + argument: { foo:"foo", bar:"bar" } | |
| 649 | + }; | |
| 650 | + core_makeRequest(sUrl,callback); | |
| 651 | +} | |
| 652 | +/* | |
| 653 | +Function: core_comboGrupos | |
| 654 | + | |
| 655 | +Cria um combo para escolha de um grupo | |
| 656 | + | |
| 657 | +<PEGAGRUPOS> | |
| 658 | + | |
| 659 | +Parameters: | |
| 660 | + | |
| 661 | +onde - id do elemento que receberá o combo | |
| 662 | + | |
| 663 | +id - id do combo que será criado | |
| 664 | + | |
| 665 | +marcar - valor que será marcado como selecionado | |
| 666 | + | |
| 667 | +funcao - string com o nome da função que será executada no evento onchange | |
| 668 | +*/ | |
| 669 | +function core_comboGrupos(onde,id,marcar,funcao) | |
| 670 | +{ | |
| 671 | + var sUrl = "../php/menutemas.php?funcao=pegaGrupos"; | |
| 672 | + var callback = | |
| 673 | + { | |
| 674 | + success:function(o) | |
| 675 | + { | |
| 676 | + try | |
| 677 | + { | |
| 678 | + var valores = YAHOO.lang.JSON.parse(o.responseText); | |
| 679 | + if(arguments.length == 3) | |
| 680 | + {funcao = "";} | |
| 681 | + if (funcao != "") | |
| 682 | + {funcao = "onchange='"+funcao+"'";} | |
| 683 | + ins = "<select size=6 style='width:370px;font-size:12px; margin: 0px;' id='"+id+"' "+funcao+" >"; | |
| 684 | + ins += core_comboObjeto(valores,"id_grupo","nome_grupo",marcar); | |
| 685 | + ins += "</select>"; | |
| 686 | + $i(onde).innerHTML = ins; | |
| 687 | + } | |
| 688 | + catch(e){core_handleFailure(e,o.responseText);} | |
| 689 | + }, | |
| 690 | + failure:core_handleFailure, | |
| 691 | + argument: { foo:"foo", bar:"bar" } | |
| 692 | + }; | |
| 693 | + core_makeRequest(sUrl,callback); | |
| 694 | +} | |
| 695 | +/* | |
| 696 | +Function: core_comboSubGrupos | |
| 697 | + | |
| 698 | +Cria um combo para escolha de um sub-grupo | |
| 699 | + | |
| 700 | +<PEGASUBGRUPOS> | |
| 701 | + | |
| 702 | +Parameters: | |
| 703 | + | |
| 704 | +onde - id do elemento que receberá o combo | |
| 705 | + | |
| 706 | +id - id do combo que será criado | |
| 707 | + | |
| 708 | +marcar - valor que será marcado como selecionado | |
| 709 | + | |
| 710 | +funcao - string com o nome da função que será executada no evento onchange | |
| 711 | +*/ | |
| 712 | +function core_comboSubGrupos(onde,id,marcar,funcao) | |
| 713 | +{ | |
| 714 | + var sUrl = "../php/menutemas.php?funcao=pegaSubGrupos"; | |
| 715 | + var callback = | |
| 716 | + { | |
| 717 | + success:function(o) | |
| 718 | + { | |
| 719 | + try | |
| 720 | + { | |
| 721 | + var valores = YAHOO.lang.JSON.parse(o.responseText); | |
| 722 | + if(arguments.length == 3) | |
| 723 | + {funcao = "";} | |
| 724 | + if (funcao != "") | |
| 725 | + {funcao = "onchange='"+funcao+"'";} | |
| 726 | + ins = "<select size=6 style='width:370px; font-size:12px; margin: 0px;' id='"+id+"' "+funcao+" >"; | |
| 727 | + ins += core_comboObjeto(valores,"id_subgrupo","nome_subgrupo",marcar); | |
| 728 | + ins += "</select>"; | |
| 729 | + $i(onde).innerHTML = ins; | |
| 730 | + } | |
| 731 | + catch(e){core_handleFailure(e,o.responseText);} | |
| 732 | + }, | |
| 733 | + failure:core_handleFailure, | |
| 734 | + argument: { foo:"foo", bar:"bar" } | |
| 735 | + }; | |
| 736 | + core_makeRequest(sUrl,callback); | |
| 737 | +} | |
| 738 | +/* | |
| 739 | +Function: core_comboTemas | |
| 740 | + | |
| 741 | +Cria um combo para escolha de um tema | |
| 742 | + | |
| 743 | +<PEGATEMAS2> | |
| 744 | + | |
| 745 | +Parameters: | |
| 746 | + | |
| 747 | +onde - id do elemento que receberá o combo | |
| 748 | + | |
| 749 | +id - id do combo que será criado | |
| 750 | + | |
| 751 | +marcar - valor que será marcado como selecionado | |
| 752 | + | |
| 753 | +funcao - string com o nome da função que será executada no evento onchange | |
| 754 | +*/ | |
| 755 | +function core_comboTemas(onde,id,marcar,funcao) | |
| 756 | +{ | |
| 757 | + var sUrl = "../php/menutemas.php?funcao=pegaTemas2"; | |
| 758 | + var callback = | |
| 759 | + { | |
| 760 | + success:function(o) | |
| 761 | + { | |
| 762 | + try | |
| 763 | + { | |
| 764 | + var valores = YAHOO.lang.JSON.parse(o.responseText); | |
| 765 | + if(arguments.length == 3) | |
| 766 | + {funcao = "";} | |
| 767 | + if (funcao != "") | |
| 768 | + {funcao = "onchange='"+funcao+"'";} | |
| 769 | + ins = "<select size=6 style='width:355px;font-size:12px; margin: 0px;' id='"+id+"' "+funcao+" >"; | |
| 770 | + ins += core_comboObjeto(valores,"id_tema","nome_tema",marcar,"codigo_tema"); | |
| 771 | + ins += "</select>"; | |
| 772 | + $i(onde).innerHTML = ins; | |
| 773 | + } | |
| 774 | + catch(e){core_handleFailure(e,o.responseText);} | |
| 775 | + }, | |
| 776 | + failure:core_handleFailure, | |
| 777 | + argument: { foo:"foo", bar:"bar" } | |
| 778 | + }; | |
| 779 | + core_makeRequest(sUrl,callback); | |
| 780 | +} | |
| 781 | + | |
| 782 | +/* | |
| 783 | +function: core_pegaTags | |
| 784 | + | |
| 785 | +Pega a lista de tags | |
| 786 | + | |
| 787 | +<PEGATAGS> | |
| 788 | + | |
| 789 | +Parameters: | |
| 790 | + | |
| 791 | +funcao - (opcional) nome da funcao que será executada ao terminar a busca pelos dados | |
| 792 | +*/ | |
| 793 | +function core_pegaTags(funcao) | |
| 794 | +{ | |
| 795 | + if(arguments.length == 0) | |
| 796 | + {funcao = "";} | |
| 797 | + var sUrl = "../php/menutemas.php?funcao=pegaTags"; | |
| 798 | + var callback = | |
| 799 | + { | |
| 800 | + success:function(o) | |
| 801 | + { | |
| 802 | + try | |
| 803 | + { | |
| 804 | + $tags = YAHOO.lang.JSON.parse(o.responseText); | |
| 805 | + if($tags == ""){$tags = " ";} | |
| 806 | + if(funcao != "") | |
| 807 | + eval(funcao); | |
| 808 | + } | |
| 809 | + catch(e){core_handleFailure(e,o.responseText);} | |
| 810 | + }, | |
| 811 | + failure:core_handleFailure, | |
| 812 | + argument: { foo:"foo", bar:"bar" } | |
| 813 | + }; | |
| 814 | + core_makeRequest(sUrl,callback); | |
| 815 | +} | |
| 816 | +/* | |
| 817 | +Function: core_comboTags | |
| 818 | + | |
| 819 | +Cria um combo para escolha de tags | |
| 820 | + | |
| 821 | +Parameters: | |
| 822 | + | |
| 823 | +onde - id do elemento que receberá o combo | |
| 824 | + | |
| 825 | +id - id do combo que será criado | |
| 826 | + | |
| 827 | +marcar - valor que será marcado como selecionado | |
| 828 | + | |
| 829 | +change - nome da função do evento onchange | |
| 830 | +*/ | |
| 831 | +function core_comboTags(onde,id,change) | |
| 832 | +{ | |
| 833 | + if($tags == "") | |
| 834 | + { | |
| 835 | + core_pegaTags("core_comboTags('"+onde+"','"+id+"','"+change+"')"); | |
| 836 | + } | |
| 837 | + else | |
| 838 | + { | |
| 839 | + ins = "<div class='styled-select'><select onchange=\""+change+"(this.value)\" id='"+id+"' >"; | |
| 840 | + ins += core_comboObjeto($tags,"nome","nome",""); | |
| 841 | + ins += "</select></div>"; | |
| 842 | + $i(onde).innerHTML = ins; | |
| 843 | + } | |
| 844 | +} | |
| 845 | +/* | |
| 846 | +Function: gera uma janela flutuante com opções de escolha baseadas em checkbox | |
| 847 | + | |
| 848 | +Parameters: | |
| 849 | + | |
| 850 | +valores - array com os valores de cada checkbox | |
| 851 | + | |
| 852 | +textos - array com os nomes de cada checkbox | |
| 853 | + | |
| 854 | +selecionados - array com os valores marcados | |
| 855 | + | |
| 856 | +target - objeto para receber o resultado | |
| 857 | + | |
| 858 | +record - objeto record (utilize "" para escapar) | |
| 859 | + | |
| 860 | +key - chave (nome do item) (utilize "" para escapar) | |
| 861 | + | |
| 862 | +unico - sim|nao indicando se apenas um pode ser escolhido | |
| 863 | + | |
| 864 | +funcaoFinal - (opcional) funcao que sera executada no final do processo | |
| 865 | +*/ | |
| 866 | +function core_menuCheckBox(valores,textos,selecionados,target,record,key,unico,funcaoFinal){ | |
| 867 | + if(!unico){ | |
| 868 | + unico = "nao"; | |
| 869 | + } | |
| 870 | + function on_menuCheckBoxChange(p_oEvent){ | |
| 871 | + var cks,i, | |
| 872 | + ins = [], | |
| 873 | + status = "OK"; | |
| 874 | + if(p_oEvent && p_oEvent.newValue){ | |
| 875 | + status = p_oEvent.newValue.get("value"); | |
| 876 | + } | |
| 877 | + if(status == "OK") { | |
| 878 | + cks = $i("core_menuCK_bd").getElementsByTagName("input"); | |
| 879 | + ins = []; | |
| 880 | + for (i=0;i<cks.length;i++){ | |
| 881 | + if(cks[i].checked){ | |
| 882 | + ins.push(cks[i].value); | |
| 883 | + } | |
| 884 | + } | |
| 885 | + if(record && record != ""){ | |
| 886 | + target.innerHTML = "<pre ><p>"+ins.toString()+"</pre>"; | |
| 887 | + record.setData(key,ins.toString()); | |
| 888 | + } | |
| 889 | + else{ | |
| 890 | + target.value = ins.toString(); | |
| 891 | + } | |
| 892 | + } | |
| 893 | + YAHOO.admin.container.panelCK.destroy(); | |
| 894 | + YAHOO.admin.container.panelCK = null; | |
| 895 | + if(funcaoFinal){ | |
| 896 | + funcaoFinal.call(); | |
| 897 | + } | |
| 898 | + }; | |
| 899 | + var novoel,ndiv,og_core,onde,ins,i,novoCK,ck,j; | |
| 900 | + if(!YAHOO.admin.container.panelCK){ | |
| 901 | + novoel = document.createElement("div"); | |
| 902 | + novoel.id = "core_menuCK"; | |
| 903 | + ndiv = document.createElement("div"); | |
| 904 | + ndiv.className= "yui-dt-editor"; | |
| 905 | + ndiv.style.backgroundColor = "white"; | |
| 906 | + ndiv.style.height = "144px"; | |
| 907 | + ndiv.style.width = "100%"; | |
| 908 | + ndiv.style.overflow = "auto"; | |
| 909 | + ndiv.innerHTML = "<div id='core_botoesCabecalho' ></div><br>" + | |
| 910 | + "<div id='core_menuCK_bd' style='background:white;text-align:left;border:1px solid gray'></div>"; | |
| 911 | + novoel.appendChild(ndiv); | |
| 912 | + document.body.appendChild(novoel); | |
| 913 | + og_core = new YAHOO.widget.ButtonGroup({id:"okcancel_checkbox_id", name:"okcancel_checkbox_id", container:"core_botoesCabecalho" }); | |
| 914 | + og_core.addButtons([ | |
| 915 | + { label: "OK", value: "OK", checked: false}, | |
| 916 | + { label: "Fecha", value: "CANCEL", checked: false } | |
| 917 | + ]); | |
| 918 | + og_core.on("checkedButtonChange", on_menuCheckBoxChange); | |
| 919 | + YAHOO.admin.container.panelCK = new YAHOO.widget.Panel("core_menuCK", { draggable:false,modal:false,zindex:"100",close:false,underlay:false,width:"200px", height:"158px",overflow:"auto", visible:false,constraintoviewport:false } ); | |
| 920 | + YAHOO.admin.container.panelCK.render(); | |
| 921 | + } | |
| 922 | + onde = $i("core_menuCK_bd"); | |
| 923 | + ins = []; | |
| 924 | + onde.innerHTML = ""; | |
| 925 | + for (i=0;i<valores.length;i++){ | |
| 926 | + novoCK = document.createElement("div"); | |
| 927 | + novoCK.onclick = on_menuCheckBoxChange; | |
| 928 | + ck = ""; | |
| 929 | + for(j=0;j<selecionados.length;j++){ | |
| 930 | + if(selecionados[j] == valores[i]) | |
| 931 | + ck = "CHECKED"; | |
| 932 | + } | |
| 933 | + if(unico === "nao"){ | |
| 934 | + ins.push("<input style='cursor:pointer;' type=checkbox id='CK_"+valores[i]+"' value='"+valores[i]+"' "+ck+" />"+textos[i]+"<br>"); | |
| 935 | + } | |
| 936 | + else{ | |
| 937 | + ins.push("<input style='position:relative;top:2px;cursor:pointer;' type=radio name=escolha_core_menuCheckBox id='CK_"+valores[i]+"' value='"+valores[i]+"' "+ck+" />"+textos[i]+"<br>"); | |
| 938 | + } | |
| 939 | + } | |
| 940 | + if(valores.length > 0){ | |
| 941 | + ins.push("<br>"); | |
| 942 | + novoCK.innerHTML = ins.join(" "); | |
| 943 | + novoCK.style.width = "100%"; | |
| 944 | + onde.appendChild(novoCK); | |
| 945 | + } | |
| 946 | + YAHOO.admin.container.panelCK.moveTo(YAHOO.util.Dom.getX(target),YAHOO.util.Dom.getY(target)); | |
| 947 | + YAHOO.admin.container.panelCK.show(); | |
| 948 | + $i("core_menuCK_bd").getElementsByTagName("div")[0].style.textAlign = "left"; | |
| 949 | +} | |
| 950 | +/* | |
| 951 | +Function: core_combosimnao | |
| 952 | + | |
| 953 | +Retorna os itens option de um combo sim nao | |
| 954 | +*/ | |
| 955 | +function core_combosimnao(marcar) | |
| 956 | +{ | |
| 957 | + var ins = "<option value='' "; | |
| 958 | + if (marcar == ""){ins += "selected";} | |
| 959 | + ins += ">---</option>"; | |
| 960 | + ins += "<option value='SIM' "; | |
| 961 | + if (marcar == "sim" || marcar == "SIM"){ins += "selected";} | |
| 962 | + ins += ">sim</option>"; | |
| 963 | + ins += "<option value='NAO' "; | |
| 964 | + if (marcar == "nao" || marcar == "NAO"){ins += "selected";} | |
| 965 | + ins += ">nao</option>"; | |
| 966 | + return(ins); | |
| 967 | +} | |
| 968 | +/* | |
| 969 | +Function: core_comboObjeto | |
| 970 | + | |
| 971 | +Retorna os itens option de um combo baseado em um objeto json | |
| 972 | +*/ | |
| 973 | +function core_comboObjeto(obj,valor,texto,marcar,texto2,texto3) | |
| 974 | +{ | |
| 975 | + var ins = "<option value='' "; | |
| 976 | + var v; | |
| 977 | + var t; | |
| 978 | + if(!marcar && marcar != ""){ | |
| 979 | + marcar = 0; | |
| 980 | + } | |
| 981 | + ins += ">---</option>"; | |
| 982 | + for (var k=0;k<obj.length;k++){ | |
| 983 | + if(valor != ""){ | |
| 984 | + v = obj[k][valor]; | |
| 985 | + } | |
| 986 | + else{ | |
| 987 | + v = obj[k]; | |
| 988 | + } | |
| 989 | + if(texto != ""){ | |
| 990 | + t = obj[k][texto]; | |
| 991 | + } | |
| 992 | + else{ | |
| 993 | + t = obj[k]; | |
| 994 | + } | |
| 995 | + if(texto2){ | |
| 996 | + t += " ("+eval("obj[k]."+texto2)+")"; | |
| 997 | + } | |
| 998 | + if(texto3){ | |
| 999 | + t += " ("+eval("obj[k]."+texto3)+")"; | |
| 1000 | + } | |
| 1001 | + ins += "<option value='"+v+"' "; | |
| 1002 | + if (marcar == v){ | |
| 1003 | + ins += "selected"; | |
| 1004 | + } | |
| 1005 | + ins += " title='"+t+"' >"+t+"</option>"; | |
| 1006 | + } | |
| 1007 | + return(ins); | |
| 1008 | +} | |
| 1009 | +/* | |
| 1010 | +Function: core_geraLinhas | |
| 1011 | + | |
| 1012 | +Gera campos de formulário | |
| 1013 | + | |
| 1014 | +Parameters: | |
| 1015 | + | |
| 1016 | +dados - objeto no formato {"linhas":[{titulo:"Nome do tema:",size:"50",id:"Enome_tema",value:i.nome_tema,tipo:"text",div:""}]} | |
| 1017 | +*/ | |
| 1018 | +function core_geraLinhas(dados) | |
| 1019 | +{ | |
| 1020 | + var nparam = dados.linhas.length; | |
| 1021 | + var contaParam = 0; | |
| 1022 | + var resultado = ""; | |
| 1023 | + core_geralinhasEscondeAjuda = function(id){ | |
| 1024 | + var a = $i(id+"_ajuda"), | |
| 1025 | + i = $i(id+"_imgajuda"); | |
| 1026 | + | |
| 1027 | + if(a.style.display == "block"){ | |
| 1028 | + a.style.display = "none"; | |
| 1029 | + i. src = "../../imagens/oxygen/16x16/help-about.png"; | |
| 1030 | + } | |
| 1031 | + else{ | |
| 1032 | + a.style.display = "block"; | |
| 1033 | + i. src = "../../imagens/oxygen/16x16/help-about.png"; | |
| 1034 | + } | |
| 1035 | + }; | |
| 1036 | + do{ | |
| 1037 | + var p = dados.linhas[contaParam]; | |
| 1038 | + if(p.tipo == "text" || p.tipo == "cor" || p.tipo == "textarea"){ | |
| 1039 | + if(!p.size){ | |
| 1040 | + p.size = "50"; | |
| 1041 | + } | |
| 1042 | + if(p.ajuda){ | |
| 1043 | + var idajuda; | |
| 1044 | + if(p.id !== ""){ | |
| 1045 | + idajuda = p.id + contaParam; | |
| 1046 | + } | |
| 1047 | + else{ | |
| 1048 | + idajuda = "a"+parseInt(255*(Math.random()),10); | |
| 1049 | + } | |
| 1050 | + resultado += "<div onclick='core_geralinhasEscondeAjuda(\""+idajuda+"\")' style='margin-bottom:6px;cursor:pointer' title='ajuda' ><p><img style='position:relative;top:3px;' id='"+idajuda+"_imgajuda' src='../../imagens/oxygen/16x16/help-about.png' >"+p.titulo+"</p></div>"; | |
| 1051 | + resultado += "<div id='"+idajuda+"_ajuda' style=display:none >"+p.ajuda+"</div>"; | |
| 1052 | + } | |
| 1053 | + else{ | |
| 1054 | + resultado += "<div><p>"+p.titulo+"</p>"; | |
| 1055 | + } | |
| 1056 | + if(p.texto){ | |
| 1057 | + resultado += "<span style=color:gray ><p>"+p.texto+"</p></span>"; | |
| 1058 | + } | |
| 1059 | + if(p.id != ""){ | |
| 1060 | + if(!p.value){ | |
| 1061 | + p.value = ""; | |
| 1062 | + } | |
| 1063 | + if(p.tipo == "textarea"){ | |
| 1064 | + resultado += "<textarea style=width:90%; id="+p.id+" >"+p.value+"</textarea>"; | |
| 1065 | + } | |
| 1066 | + else{ | |
| 1067 | + if(p.tipo == "cor"){ | |
| 1068 | + resultado += "<div class='i3geoForm i3geoFormSemIcone'><input type=text id="+p.id+" value=\""+p.value+"\" style='width:90%;'/>"; | |
| 1069 | + } | |
| 1070 | + else{ | |
| 1071 | + resultado += "<div class='i3geoForm i3geoFormSemIcone'><input type=text id="+p.id+" value=\""+p.value+"\" />"; | |
| 1072 | + } | |
| 1073 | + } | |
| 1074 | + if(p.tipo == "cor"){ | |
| 1075 | + resultado += " <img class='lupaBuscar' src='../../imagens/aquarela.gif' style='cursor:pointer;' onclick='core_abreCor(\"\",\""+p.id+"\");' />"; | |
| 1076 | + } | |
| 1077 | + resultado += "</div>"; | |
| 1078 | + } | |
| 1079 | + if(p.div){ | |
| 1080 | + resultado += p.div; | |
| 1081 | + } | |
| 1082 | + resultado += "</div>"; | |
| 1083 | + } | |
| 1084 | + contaParam++; | |
| 1085 | + } | |
| 1086 | + while(contaParam < nparam); | |
| 1087 | + return(resultado); | |
| 1088 | +} | |
| 1089 | +/* | |
| 1090 | +Function: core_ativaBotaoAdicionaLinha | |
| 1091 | + | |
| 1092 | +Ativa o botão que adiciona uma linha em uma tabela no banco de dados e na interface HTML | |
| 1093 | + | |
| 1094 | +Essa função utiliza o objeto datatable que deve estar armazenado na variável myDataTable | |
| 1095 | + | |
| 1096 | +Parameters: | |
| 1097 | + | |
| 1098 | +myDataTable - objeto dataTable do YUI | |
| 1099 | + | |
| 1100 | +sUrl - url com o programa que será executado no servidor | |
| 1101 | + | |
| 1102 | +idBotao - id do elemento com o botão | |
| 1103 | + | |
| 1104 | +nomeFuncao - nome da função que será executada ao concluir a adição da linha | |
| 1105 | +*/ | |
| 1106 | +function core_ativaBotaoAdicionaLinha(sUrl,idBotao,nomeFuncao) | |
| 1107 | +{ | |
| 1108 | + if(arguments.length == 1){ | |
| 1109 | + idBotao = "adiciona"; | |
| 1110 | + } | |
| 1111 | + if(arguments.length < 3){ | |
| 1112 | + nomeFuncao = ""; | |
| 1113 | + } | |
| 1114 | + var botao, adicionalinha = function(){ | |
| 1115 | + core_carregando("ativa"); | |
| 1116 | + core_carregando(" adicionando um novo registro"); | |
| 1117 | + var callback = { | |
| 1118 | + success:function(o){ | |
| 1119 | + var texto = ""; | |
| 1120 | + try{ | |
| 1121 | + core_carregando("desativa"); | |
| 1122 | + if(nomeFuncao != ""){ | |
| 1123 | + if(YAHOO.lang.isFunction(nomeFuncao)){ | |
| 1124 | + nomeFuncao.call(o); | |
| 1125 | + } | |
| 1126 | + else{ | |
| 1127 | + eval(nomeFuncao+"()"); | |
| 1128 | + } | |
| 1129 | + } | |
| 1130 | + else{ | |
| 1131 | + texto = YAHOO.lang.JSON.parse(o.responseText)[0]; | |
| 1132 | + if(texto === ""){ | |
| 1133 | + texto = "Clique para editar"; | |
| 1134 | + } | |
| 1135 | + myDataTable.addRow(texto,0); | |
| 1136 | + } | |
| 1137 | + } | |
| 1138 | + catch(e){ | |
| 1139 | + core_handleFailure(e,o.responseText); | |
| 1140 | + } | |
| 1141 | + }, | |
| 1142 | + failure:core_handleFailure, | |
| 1143 | + argument: { foo:"foo", bar:"bar" } | |
| 1144 | + }; | |
| 1145 | + core_makeRequest(sUrl,callback); | |
| 1146 | + }; | |
| 1147 | + //cria o botão de adição de um novo menu | |
| 1148 | + botao = new YAHOO.widget.Button(idBotao,{ onclick: { fn: adicionalinha } }); | |
| 1149 | + botao.addClass("rodar"); | |
| 1150 | +} | |
| 1151 | +/* | |
| 1152 | +Function: core_pegaDados | |
| 1153 | + | |
| 1154 | +Busca dados no servidor via Ajax e executa uma função de retorno com os daods | |
| 1155 | + | |
| 1156 | +Parameters: | |
| 1157 | + | |
| 1158 | +mensagem - mensagem que será mostrada na tela | |
| 1159 | + | |
| 1160 | +sUrl - url do programa que será executado no servidor | |
| 1161 | + | |
| 1162 | +funcaoRetorno - funcao que será executada ao terminar a busca pelos dados | |
| 1163 | +*/ | |
| 1164 | +function core_pegaDados(mensagem,sUrl,funcaoRetorno) | |
| 1165 | +{ | |
| 1166 | + if("mensagem" != "") | |
| 1167 | + core_carregando(mensagem); | |
| 1168 | + var callback = | |
| 1169 | + { | |
| 1170 | + success:function(o) | |
| 1171 | + { | |
| 1172 | + try | |
| 1173 | + { | |
| 1174 | + if(funcaoRetorno != ""){ | |
| 1175 | + if(YAHOO.lang.isFunction(funcaoRetorno)){ | |
| 1176 | + funcaoRetorno.call("",YAHOO.lang.JSON.parse(o.responseText)); | |
| 1177 | + } | |
| 1178 | + else{ | |
| 1179 | + eval(funcaoRetorno+"(YAHOO.lang.JSON.parse(o.responseText))"); | |
| 1180 | + } | |
| 1181 | + } | |
| 1182 | + core_carregando("desativa"); | |
| 1183 | + } | |
| 1184 | + catch(e) | |
| 1185 | + { | |
| 1186 | + if("mensagem" != "") | |
| 1187 | + {core_carregando("desativa");} | |
| 1188 | + core_handleFailure(o,o.responseText); | |
| 1189 | + } | |
| 1190 | + }, | |
| 1191 | + failure:core_handleFailure, | |
| 1192 | + argument: { foo:"foo", bar:"bar" } | |
| 1193 | + }; | |
| 1194 | + core_makeRequest(sUrl,callback); | |
| 1195 | +} | |
| 1196 | +/* | |
| 1197 | +Function: core_gravaLinha | |
| 1198 | + | |
| 1199 | +Grava um registro no banco de dados e atualiza o datatable atual | |
| 1200 | + | |
| 1201 | +Essa função utiliza o objeto datatable que deve estar armazenado na variável myDataTable | |
| 1202 | + | |
| 1203 | +Parameters: | |
| 1204 | + | |
| 1205 | +mensagem - mensagem que será mostrada na tela | |
| 1206 | + | |
| 1207 | +row - objeto row que foi clicado pelo usuário. Utilizado para se obter os daods do recordset | |
| 1208 | + | |
| 1209 | +sUrl - url do programa que será executado | |
| 1210 | + | |
| 1211 | +nomeFuncao - nome da funcao que sera executada apos gravar os dados (opcional) | |
| 1212 | +*/ | |
| 1213 | +function core_gravaLinha(mensagem,row,sUrl,nomeFuncao) | |
| 1214 | +{ | |
| 1215 | + core_carregando("ativa"); | |
| 1216 | + core_carregando(mensagem); | |
| 1217 | + if(arguments.length < 4) | |
| 1218 | + nomeFuncao = ""; | |
| 1219 | + var callback = | |
| 1220 | + { | |
| 1221 | + success:function(o) | |
| 1222 | + { | |
| 1223 | + core_carregando("desativa"); | |
| 1224 | + var rec = myDataTable.getRecordSet().getRecord(row); | |
| 1225 | + var linha = myDataTable.getTrEl(rec); | |
| 1226 | + if(nomeFuncao != "") | |
| 1227 | + { | |
| 1228 | + eval(nomeFuncao+"()"); | |
| 1229 | + try | |
| 1230 | + {myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]);} | |
| 1231 | + catch(e){} | |
| 1232 | + } | |
| 1233 | + else | |
| 1234 | + { | |
| 1235 | + myDataTable.updateRow(rec,YAHOO.lang.JSON.parse(o.responseText)[0]); | |
| 1236 | + } | |
| 1237 | + linha.style.color = ""; | |
| 1238 | + linha.style.textDecoration = "none"; | |
| 1239 | + }, | |
| 1240 | + failure:core_handleFailure, | |
| 1241 | + argument: { foo:"foo", bar:"bar" } | |
| 1242 | + }; | |
| 1243 | + core_makeRequest(sUrl,callback); | |
| 1244 | +} | |
| 1245 | +/* | |
| 1246 | +Function: core_excluiLinha | |
| 1247 | + | |
| 1248 | +Excluí um registro no banco de dados e atualiza o datatable. | |
| 1249 | + | |
| 1250 | +Essa função utiliza o objeto datatable que deve estar armazenado na variável myDataTable | |
| 1251 | + | |
| 1252 | +Parameters: | |
| 1253 | + | |
| 1254 | +sUrl - url do programa que será executado | |
| 1255 | + | |
| 1256 | +row - objeto row de um datatable | |
| 1257 | + | |
| 1258 | +mensagem - | |
| 1259 | +*/ | |
| 1260 | +function core_excluiLinha(sUrl,row,mensagem,cabecalho,tabela) | |
| 1261 | +{ | |
| 1262 | + if(!cabecalho){ | |
| 1263 | + cabecalho = ""; | |
| 1264 | + } | |
| 1265 | + //dialogo | |
| 1266 | + // Define various event handlers for Dialog | |
| 1267 | + var handleYes = function() | |
| 1268 | + { | |
| 1269 | + this.hide(); | |
| 1270 | + core_carregando("ativa"); | |
| 1271 | + core_carregando(mensagem); | |
| 1272 | + var callback = | |
| 1273 | + { | |
| 1274 | + success:function(o) | |
| 1275 | + { | |
| 1276 | + try | |
| 1277 | + { | |
| 1278 | + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") | |
| 1279 | + { | |
| 1280 | + 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>"); | |
| 1281 | + setTimeout("core_carregando('desativa')",3000); | |
| 1282 | + } | |
| 1283 | + else | |
| 1284 | + { | |
| 1285 | + if(tabela){ | |
| 1286 | + tabela.deleteRow(row); | |
| 1287 | + } | |
| 1288 | + else{ | |
| 1289 | + myDataTable.deleteRow(row); | |
| 1290 | + } | |
| 1291 | + core_carregando("desativa"); | |
| 1292 | + } | |
| 1293 | + } | |
| 1294 | + catch(e){core_handleFailure(o,o.responseText);} | |
| 1295 | + }, | |
| 1296 | + failure:core_handleFailure, | |
| 1297 | + argument: { foo:"foo", bar:"bar" } | |
| 1298 | + }; | |
| 1299 | + core_makeRequest(sUrl,callback); | |
| 1300 | + }; | |
| 1301 | + var handleNo = function(){ | |
| 1302 | + this.hide(); | |
| 1303 | + }; | |
| 1304 | + var mensagem = "Exclui o registro?"; | |
| 1305 | + var largura = "300"; | |
| 1306 | + core_dialogoContinua(handleYes,handleNo,mensagem,largura,cabecalho); | |
| 1307 | +} | |
| 1308 | +/* | |
| 1309 | +Function: core_excluiNoTree | |
| 1310 | + | |
| 1311 | +Excluí um registro no banco de dados e atualiza o treeview. | |
| 1312 | + | |
| 1313 | +Essa função utiliza o objeto treeview que deve estar armazenado na variável tree | |
| 1314 | + | |
| 1315 | +Parameters: | |
| 1316 | + | |
| 1317 | +sUrl - url do programa que será executado | |
| 1318 | + | |
| 1319 | +no - objeto no de um treeview | |
| 1320 | + | |
| 1321 | +mensagem - | |
| 1322 | +*/ | |
| 1323 | +function core_excluiNoTree(sUrl,no,mensagem,cabecalho) | |
| 1324 | +{ | |
| 1325 | + if(!cabecalho){ | |
| 1326 | + cabecalho = ""; | |
| 1327 | + } | |
| 1328 | + //dialogo | |
| 1329 | + // Define various event handlers for Dialog | |
| 1330 | + var handleYes = function() | |
| 1331 | + { | |
| 1332 | + this.hide(); | |
| 1333 | + core_carregando("ativa"); | |
| 1334 | + core_carregando(mensagem); | |
| 1335 | + var callback = | |
| 1336 | + { | |
| 1337 | + success:function(o) | |
| 1338 | + { | |
| 1339 | + try | |
| 1340 | + { | |
| 1341 | + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") | |
| 1342 | + { | |
| 1343 | + 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>"); | |
| 1344 | + setTimeout("core_carregando('desativa')",3000); | |
| 1345 | + } | |
| 1346 | + else | |
| 1347 | + { | |
| 1348 | + if(no){ | |
| 1349 | + tree.removeNode(no); | |
| 1350 | + tree.draw(); | |
| 1351 | + } | |
| 1352 | + core_carregando("desativa"); | |
| 1353 | + } | |
| 1354 | + } | |
| 1355 | + catch(e){core_handleFailure(o,o.responseText);} | |
| 1356 | + }, | |
| 1357 | + failure:core_handleFailure, | |
| 1358 | + argument: { foo:"foo", bar:"bar" } | |
| 1359 | + }; | |
| 1360 | + core_makeRequest(sUrl,callback); | |
| 1361 | + }; | |
| 1362 | + var handleNo = function() | |
| 1363 | + { | |
| 1364 | + this.hide(); | |
| 1365 | + }; | |
| 1366 | + var mensagem = "Exclui o registro?"; | |
| 1367 | + var largura = "300"; | |
| 1368 | + core_dialogoContinua(handleYes,handleNo,mensagem,largura,cabecalho); | |
| 1369 | +} | |
| 1370 | +/** | |
| 1371 | +Function: core_montaEditor | |
| 1372 | + | |
| 1373 | +Monta uma janela flutuante com um formulário. | |
| 1374 | + | |
| 1375 | +O editor possui um div com id=editor_bd que deve ser usado para incluir o formulário. | |
| 1376 | + | |
| 1377 | +Parameters: | |
| 1378 | + | |
| 1379 | +funcaoOK - string com o nome da função que será executada quando o botão OK for pressionado. | |
| 1380 | + | |
| 1381 | +funcaoClose - nome da funcao que será executada quando a janela for fechada. Pode ser "" para escapar. | |
| 1382 | + | |
| 1383 | +titulo - titulo da janela | |
| 1384 | + | |
| 1385 | +modal - boolean | |
| 1386 | + | |
| 1387 | +bsalva - boolean botao salvar | |
| 1388 | + | |
| 1389 | +bcancela - boolean botao cancelar | |
| 1390 | +*/ | |
| 1391 | +function core_montaEditor(funcaoOK,w,h,funcaoClose,titulo,modal,bsalva,bcancela) | |
| 1392 | +{ | |
| 1393 | + if(!funcaoOK){ | |
| 1394 | + funcaoOK = ""; | |
| 1395 | + } | |
| 1396 | + if(!w){ | |
| 1397 | + w = "400px"; | |
| 1398 | + } | |
| 1399 | + if(!h){ | |
| 1400 | + h = "354px"; | |
| 1401 | + } | |
| 1402 | + if(modal == undefined){ | |
| 1403 | + modal = false; | |
| 1404 | + } | |
| 1405 | + if(bsalva == undefined){ | |
| 1406 | + bsalva = true; | |
| 1407 | + } | |
| 1408 | + if(bcancela == undefined){ | |
| 1409 | + bcancela = true; | |
| 1410 | + } | |
| 1411 | + if(!titulo){ | |
| 1412 | + titulo = "Editor"; | |
| 1413 | + } | |
| 1414 | + if(!funcaoClose){ | |
| 1415 | + funcaoClose = ""; | |
| 1416 | + } | |
| 1417 | + if(!$i("janela_editor")) | |
| 1418 | + { | |
| 1419 | + var ins = "", temp = "", lb, | |
| 1420 | + salvai = "<input id=okcancel_checkboxOK type='buttom' value='Salva' />", | |
| 1421 | + cancelai = "<input id=okcancel_checkboxCANCEL type='buttom' value='Cancela' />", | |
| 1422 | + novoel = document.createElement("div"); | |
| 1423 | + novoel.id = "janela_editor"; | |
| 1424 | + ins = '<div class="hd"><div id="okcancel_checkbox" ></div></div>' + | |
| 1425 | + "<div class='bd' style='height:"+h+";overflow:auto'>" + | |
| 1426 | + "<div id='editor_bd'></div>"; | |
| 1427 | + novoel.innerHTML = ins; | |
| 1428 | + document.body.appendChild(novoel); | |
| 1429 | + if(funcaoOK != "") | |
| 1430 | + { | |
| 1431 | + lb = $i("okcancel_checkbox"); | |
| 1432 | + if(bsalva === true){ | |
| 1433 | + temp += salvai; | |
| 1434 | + } | |
| 1435 | + if(bcancela === true){ | |
| 1436 | + temp += cancelai; | |
| 1437 | + } | |
| 1438 | + lb.innerHTML = temp + '<span style="margin-left:10px;position:relative;top:-5px">'+titulo+'</span>'; | |
| 1439 | + if(bsalva === true){ | |
| 1440 | + new YAHOO.widget.Button( | |
| 1441 | + "okcancel_checkboxOK", | |
| 1442 | + {onclick:{fn: function(){ | |
| 1443 | + if(YAHOO.lang.isFunction(funcaoOK)){ | |
| 1444 | + funcaoOK.call(); | |
| 1445 | + } | |
| 1446 | + else{ | |
| 1447 | + eval(funcaoOK); | |
| 1448 | + } | |
| 1449 | + }}} | |
| 1450 | + ); | |
| 1451 | + var temp = $i("okcancel_checkbox"); | |
| 1452 | + temp.style.top = "2px"; | |
| 1453 | + temp.style.position = "relative"; | |
| 1454 | + var temp = $i("okcancel_checkboxOK-button"); | |
| 1455 | + temp.style.height = "23px"; | |
| 1456 | + } | |
| 1457 | + if(bcancela === true){ | |
| 1458 | + new YAHOO.widget.Button( | |
| 1459 | + "okcancel_checkboxCANCEL", | |
| 1460 | + {onclick:{fn: function(){ | |
| 1461 | + YAHOO.admin.container.panelEditor.destroy(); | |
| 1462 | + YAHOO.admin.container.panelEditor = null; | |
| 1463 | + }}} | |
| 1464 | + ); | |
| 1465 | + } | |
| 1466 | + } | |
| 1467 | + YAHOO.admin.container.panelEditor = new YAHOO.widget.Panel("janela_editor", { y: 0, fixedcenter:false,close:true,width:w, overflow:"auto",modal: false,visible:false,constraintoviewport:false } ); | |
| 1468 | + YAHOO.admin.container.panelEditor.render(); | |
| 1469 | + } | |
| 1470 | + else | |
| 1471 | + { | |
| 1472 | + if($i("editor_bd")) | |
| 1473 | + {$i("editor_bd").innerHTML == "?";} | |
| 1474 | + } | |
| 1475 | + var fecha = function() | |
| 1476 | + { | |
| 1477 | + try{ | |
| 1478 | + YAHOO.admin.container.panelEditor.destroy(); | |
| 1479 | + YAHOO.admin.container.panelEditor = null; | |
| 1480 | + } | |
| 1481 | + catch(e){} | |
| 1482 | + try{ | |
| 1483 | + if(YAHOO.lang.isFunction(funcaoClose)){ | |
| 1484 | + funcaoClose.call(); | |
| 1485 | + } | |
| 1486 | + else if(funcaoClose != ""){ | |
| 1487 | + eval(funcaoClose+"()"); | |
| 1488 | + } | |
| 1489 | + } | |
| 1490 | + catch(e){}; | |
| 1491 | + }; | |
| 1492 | + YAHOO.util.Event.addListener(YAHOO.admin.container.panelEditor.close, "click", fecha); | |
| 1493 | + YAHOO.admin.container.panelEditor.show(); | |
| 1494 | + //registra a janela no gerenciador de janelas default da classe i3GEO.janela caso ela exista | |
| 1495 | + try{ | |
| 1496 | + YAHOO.i3GEO.janela.manager.register(YAHOO.admin.container.panelEditor); | |
| 1497 | + } | |
| 1498 | + catch(e){} | |
| 1499 | +} | |
| 1500 | +/* | |
| 1501 | +Function idiomaSel | |
| 1502 | + | |
| 1503 | +Retorna o idioma selecionado pesquisando no elemento select com id = "idioma" | |
| 1504 | +*/ | |
| 1505 | +function idiomaSel(){ | |
| 1506 | + var idioma = "pt"; | |
| 1507 | + if($i("idioma")) | |
| 1508 | + {idioma = $i("idioma").value;} | |
| 1509 | + return idioma; | |
| 1510 | +} | |
| 1511 | +function core_abreCor(janela,elemento) | |
| 1512 | +{ | |
| 1513 | + if(i3GEO.configura == undefined ) | |
| 1514 | + {i3GEO.configura = {locaplic: "../.."};} | |
| 1515 | + i3GEO.util.abreCor("",elemento,"rgb"); | |
| 1516 | + $i("i3geo_janelaCori").style.width = "350px"; | |
| 1517 | + $i("i3geo_janelaCori").style.height = "290px"; | |
| 1518 | + //i3GEO.janela.cria("350px","250px","../../ferramentas/colorpicker/index.htm?doc=&elemento="+elemento+"&tipo=rgb","","","Cor","i3geo_janelaCor",true); | |
| 1519 | +} | |
| 1520 | +function core_desativaforms(lista){ | |
| 1521 | + var n = lista.length, | |
| 1522 | + i,t; | |
| 1523 | + for (i=0;i<n;i++){ | |
| 1524 | + t = $i(lista[i]); | |
| 1525 | + if(t){ | |
| 1526 | + //t.style.background = "pink"; | |
| 1527 | + t.disabled = true; | |
| 1528 | + } | |
| 1529 | + } | |
| 1530 | +} | |
| 1531 | +function core_ativaforms(lista){ | |
| 1532 | + var n = lista.length, | |
| 1533 | + i,t; | |
| 1534 | + for (i=0;i<n;i++){ | |
| 1535 | + t = $i(lista[i]); | |
| 1536 | + if(t){ | |
| 1537 | + //t.style.background = "white"; | |
| 1538 | + t.disabled = false; | |
| 1539 | + } | |
| 1540 | + } | |
| 1541 | +} | |
| 1542 | + | |
| 1543 | +function core_filtraLetrasCombo(id,letra){ | |
| 1544 | + if (letra == "Todos") { | |
| 1545 | + letra = ""; | |
| 1546 | + } | |
| 1547 | + i3GEO.util.insereCookie("I3GEOletraAdmin", letra); | |
| 1548 | + if($i("iniciaisLetras")){ | |
| 1549 | + $i("iniciaisLetras").value = letra; | |
| 1550 | + } | |
| 1551 | + var combo = $i(id), | |
| 1552 | + n, i, o, v; | |
| 1553 | + if(combo){ | |
| 1554 | + o = combo.options; | |
| 1555 | + n = o.length; | |
| 1556 | + letra = letra.toLowerCase(); | |
| 1557 | + for(i = 0; i < n; i++){ | |
| 1558 | + v = o[i].text.toLowerCase(); | |
| 1559 | + o[i].style.display = "block"; | |
| 1560 | + if(v.search(letra) < 0 && o[i].value != combo.value ){ | |
| 1561 | + o[i].style.display = "none"; | |
| 1562 | + } | |
| 1563 | + } | |
| 1564 | + } | |
| 1565 | +} | |
| 1566 | + | |
| 1567 | +function core_listaDeLetras(onde,nomeFuncao,semLetras,w){ | |
| 1568 | + //letraAtual guarda a ultima letra clicada | |
| 1569 | + if(!w){ | |
| 1570 | + w = 40; | |
| 1571 | + } | |
| 1572 | + var o,i,ins= "<p><b>", | |
| 1573 | + letras = ["Todos","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","X","Y","Z","_","1","2","3","4","5","6","7","8","9"], | |
| 1574 | + nletras = letras.length; | |
| 1575 | + if(!i3GEO.util){ | |
| 1576 | + alert("Erro i3GEO.util ???"); | |
| 1577 | + return; | |
| 1578 | + } | |
| 1579 | + letraAtual = ""; | |
| 1580 | + if(i3GEO.util.pegaCookie("I3GEOletraAdmin")) { | |
| 1581 | + letraAtual = i3GEO.util.pegaCookie("I3GEOletraAdmin"); | |
| 1582 | + } | |
| 1583 | + if(!semLetras){ | |
| 1584 | + for (i = 0; i < nletras; i++) { | |
| 1585 | + ins += "<span onclick='"+nomeFuncao+"(\"" | |
| 1586 | + + letras[i] | |
| 1587 | + + "\")' style='color:blue;cursor:pointer;padding:1px;border: 1px solid #C8C8FA'>" | |
| 1588 | + + letras[i] + "</span> "; | |
| 1589 | + } | |
| 1590 | + } | |
| 1591 | + else{ | |
| 1592 | + ins = ""; | |
| 1593 | + } | |
| 1594 | + if(onde && onde != ""){ | |
| 1595 | + o = document.getElementById(onde); | |
| 1596 | + if(o){ | |
| 1597 | + if(!semLetras){ | |
| 1598 | + o.innerHTML = "<fieldset style='padding:2px;margin-left: 0px;' class=letras ><form id=forminiciais ><p><b>Iniciais: <input name='' onchange='' value='"+letraAtual+"' id=iniciaisLetras type=text style=width:" + w + "px;cursor:pointer /></form><div style=position:relative;top:1px; id='_listaDeLetras' >"+ins+"</div></b></fieldset>"; | |
| 1599 | + } | |
| 1600 | + else{ | |
| 1601 | + o.innerHTML = "<form id=forminiciais >Iniciais: <input name='' onchange='' value='' id=iniciaisLetras type=text style=width:40px;cursor:pointer /></form>"; | |
| 1602 | + } | |
| 1603 | + if(document.getElementById("forminiciais")){ | |
| 1604 | + document.getElementById("forminiciais").onsubmit = function(){ | |
| 1605 | + var v = document.getElementById("iniciaisLetras").value; | |
| 1606 | + i3GEO.util.insereCookie("I3GEOletraAdmin", v); | |
| 1607 | + eval(nomeFuncao+"('"+v+"');"); | |
| 1608 | + return false; | |
| 1609 | + }; | |
| 1610 | + } | |
| 1611 | + if(!semLetras){ | |
| 1612 | + document.getElementById("_listaDeLetras").onclick = function(){ | |
| 1613 | + document.getElementById("iniciaisLetras").value = letraAtual; | |
| 1614 | + }; | |
| 1615 | + } | |
| 1616 | + } | |
| 1617 | + } | |
| 1618 | + else{ | |
| 1619 | + return ins; | |
| 1620 | + } | |
| 1621 | +} | |
| 1622 | +function core_parseMustacheBody (hashMustache){ | |
| 1623 | + var re = new RegExp("&", "g"), m; | |
| 1624 | + m = Mustache.render(document.body.innerHTML, i3GEO.idioma.objetoIdioma(hashMustache)); | |
| 1625 | + m = m.replace(re, '&'); | |
| 1626 | + document.body.innerHTML = m; | |
| 1627 | +} | |
| 1628 | +// | |
| 1629 | +//carregador de javascript | |
| 1630 | +// | |
| 1631 | +//define o local correto dos programas | |
| 1632 | +// | |
| 1633 | +(function(){ | |
| 1634 | + var scriptLocation = ""; | |
| 1635 | + var scripts = document.getElementsByTagName('script'); | |
| 1636 | + for (var i = 0; i < scripts.length; i++) { | |
| 1637 | + var src = scripts[i].getAttribute('src'); | |
| 1638 | + if (src) { | |
| 1639 | + var index = src.lastIndexOf("core.js"); | |
| 1640 | + // is it found, at the end of the URL? | |
| 1641 | + if ((index > -1) && (index + "core.js".length == src.length)) { | |
| 1642 | + scriptLocation = src.slice(0, -"core.js".length); | |
| 1643 | + break; | |
| 1644 | + } | |
| 1645 | + } | |
| 1646 | + } | |
| 1647 | + // | |
| 1648 | + //arquivos javascript que serão carregados | |
| 1649 | + // | |
| 1650 | + /* | |
| 1651 | + <?php if(extension_loaded('zlib')){ob_start('ob_gzhandler');} header("Content-type: text/javascript"); ?> | |
| 1652 | + <?php if(extension_loaded('zlib')){ob_end_flush();}?> | |
| 1653 | + */ | |
| 1654 | + var jsfiles = []; | |
| 1655 | + var cssfiles = []; | |
| 1656 | + if(typeof(i3GEO) !== 'undefined' && i3GEO.configura.locaplic){ | |
| 1657 | + scriptLocation = ""; | |
| 1658 | + jsfiles = []; | |
| 1659 | + // | |
| 1660 | + //arquivos css | |
| 1661 | + // | |
| 1662 | + cssfiles =new Array( | |
| 1663 | + i3GEO.configura.locaplic+"/css/input.css", | |
| 1664 | + i3GEO.configura.locaplic+"/admin/html/admin.css" | |
| 1665 | + ); | |
| 1666 | + } | |
| 1667 | + else{ | |
| 1668 | + jsfiles = new Array( | |
| 1669 | + "../../pacotes/yui290/build/utilities/utilities.js", | |
| 1670 | + "../../pacotes/yui290/build/yahoo-dom-event/yahoo-dom-event.js", | |
| 1671 | + "../../pacotes/yui290/build/element/element-min.js", | |
| 1672 | + "../../pacotes/yui290/build/datasource/datasource-min.js", | |
| 1673 | + "../../pacotes/yui290/build/datatable/datatable-min.js", | |
| 1674 | + "../../pacotes/yui290/build/button/button-min.js", | |
| 1675 | + "../../pacotes/yui290/build/dragdrop/dragdrop-min.js", | |
| 1676 | + "../../pacotes/yui290/build/container/container-min.js", | |
| 1677 | + "../../pacotes/yui290/build/connection/connection-min.js", | |
| 1678 | + "../../pacotes/yui290/build/treeview/treeview.js", | |
| 1679 | + "../../pacotes/yui290/build/json/json-min.js", | |
| 1680 | + "../../pacotes/yui290/build/menu/menu-min.js", | |
| 1681 | + "../../pacotes/yui290/build/editor/editor-min.js", | |
| 1682 | + "../../pacotes/yui290/build/resize/resize-min.js", | |
| 1683 | + "../../pacotes/cpaint/cpaint2.inc.compressed.js", | |
| 1684 | + "../../classesjs/compactados/mustache.js", | |
| 1685 | + "../../classesjs/compactados/classe_i3geo_compacto.js", | |
| 1686 | + "../../classesjs/compactados/classe_util_compacto.js", | |
| 1687 | + "../../classesjs/compactados/classe_login_compacto.js", | |
| 1688 | + "../../classesjs/compactados/classe_janela_compacto.js", | |
| 1689 | + "../../classesjs/compactados/classe_php_compacto.js", | |
| 1690 | + "../../classesjs/compactados/dicionario_compacto.js", | |
| 1691 | + "../../classesjs/compactados/classe_idioma_compacto.js", | |
| 1692 | + "../../classesjs/compactados/classe_guias_compacto.js", | |
| 1693 | + "../../classesjs/compactados/classe_arvoredetemas_compacto.js" | |
| 1694 | + ); | |
| 1695 | + // | |
| 1696 | + //arquivos css | |
| 1697 | + // | |
| 1698 | + cssfiles =new Array( | |
| 1699 | + "../../pacotes/yui290/build/tabview/assets/skins/sam/tabview.css", | |
| 1700 | + "../../pacotes/yui290/build/button/assets/skins/sam/button.css", | |
| 1701 | + "../../pacotes/yui290/build/fonts/fonts-min.css", | |
| 1702 | + "../../pacotes/yui290/build/datatable/assets/skins/sam/datatable.css", | |
| 1703 | + "../../pacotes/yui290/build/container/assets/skins/sam/container.css", | |
| 1704 | + "../../pacotes/yui290/build/treeview/assets/skins/sam/treeview.css", | |
| 1705 | + "../../pacotes/yui290/build/editor/assets/skins/sam/editor.css", | |
| 1706 | + "../../pacotes/yui290/build/resize/assets/skins/sam/resize.css", | |
| 1707 | + "../../css/input.css", | |
| 1708 | + "../../css/janelaflutuante.css", | |
| 1709 | + "../html/admin.css" | |
| 1710 | + ); | |
| 1711 | + } | |
| 1712 | + // | |
| 1713 | + //carrega os arquivos js | |
| 1714 | + // | |
| 1715 | + var allScriptTags = ""; | |
| 1716 | + for (var i = 0; i < jsfiles.length; i++) | |
| 1717 | + { | |
| 1718 | + var currentScriptTag = "<script src='" + scriptLocation + jsfiles[i] + "'></script>"; | |
| 1719 | + allScriptTags += currentScriptTag; | |
| 1720 | + } | |
| 1721 | + document.write(allScriptTags); | |
| 1722 | + // | |
| 1723 | + //carrega os arquivos css | |
| 1724 | + // | |
| 1725 | + var allCssTags = ""; | |
| 1726 | + for (var i = 0; i < cssfiles.length; i++) | |
| 1727 | + { | |
| 1728 | + var currentCssTag = "<link rel='stylesheet' type='text/css' href='" + scriptLocation + cssfiles[i] + "'/>"; | |
| 1729 | + allCssTags += currentCssTag; | |
| 1730 | + } | |
| 1731 | + document.write(allCssTags); | |
| 1732 | +})(); | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | ... | ... |
admin/js/estat_editor.js
| ... | ... | @@ -600,7 +600,7 @@ i3GEOadmin.editor = { |
| 600 | 600 | '</fieldset>' + |
| 601 | 601 | '<fieldset class=subbloco >' + |
| 602 | 602 | '<legend>Projeção</legend>' + |
| 603 | - '<p class="paragrafo" >Se voce nao escolheu o arquivo PRJ escolha o código da projeção (SRID) do arquivo</p>' + | |
| 603 | + '<p class="paragrafo" >Se voc� n�o escolheu o arquivo PRJ escolha o código da projeção (SRID) do arquivo</p>' + | |
| 604 | 604 | '<input class=digitar type="text" value="4326" size=20 id="insrid" name="insrid" style="top:0px;left:0px;cursor:pointer;float:left;margin-right:10px;"><div id=selInSrid ></div>' + |
| 605 | 605 | '<p class="paragrafo" >Projetar o arquivo para (deixe em branco se você não quiser aplicar nenhuma transformação de projeção):</p>' + |
| 606 | 606 | '<input class=digitar type="text" value="" size=20 id="outsrid" name="outsrid" style="top:0px;left:0px;cursor:pointer;float:left;margin-right:10px;"><div id=selOutSrid ></div>' + | ... | ... |
admin/php/admin.php
| ... | ... | @@ -139,24 +139,19 @@ coluna - nome da coluna |
| 139 | 139 | |
| 140 | 140 | id - valor |
| 141 | 141 | */ |
| 142 | -function exclui($tabela,$coluna,$id,$dbhw="",$close=true){ | |
| 142 | +function exclui($tabela,$coluna,$id){ | |
| 143 | 143 | try { |
| 144 | - if($dbhw == ""){ | |
| 145 | - include("conexao.php"); | |
| 146 | - $close = true; | |
| 147 | - } | |
| 144 | + include("conexao.php"); | |
| 148 | 145 | $sql = "DELETE from $tabela WHERE $coluna = ?"; |
| 149 | 146 | $prep = $dbhw->prepare($sql); |
| 150 | 147 | $prep->execute(array($id)); |
| 151 | 148 | i3GeoAdminInsertLog($dbhw,$sql,array($id)); |
| 152 | - if($close == true){ | |
| 153 | - $dbhw = null; | |
| 154 | - $dbh = null; | |
| 155 | - } | |
| 149 | + $dbhw = null; | |
| 150 | + $dbh = null; | |
| 156 | 151 | return "ok"; |
| 157 | 152 | } |
| 158 | 153 | catch (PDOException $e) { |
| 159 | - return false; | |
| 154 | + return "Error!: "; | |
| 160 | 155 | } |
| 161 | 156 | } |
| 162 | 157 | /* |
| ... | ... | @@ -196,7 +191,7 @@ function pegaDados($sql,$dbh="",$close=true) |
| 196 | 191 | $dbh = null; |
| 197 | 192 | $dbhw = null; |
| 198 | 193 | } |
| 199 | - return false; | |
| 194 | + throw new Exception(" erro admin.php funcao pegaDados"); | |
| 200 | 195 | } |
| 201 | 196 | } |
| 202 | 197 | /** |
| ... | ... | @@ -220,14 +215,14 @@ function i3GeoAdminUpdate($pdo,$tabela,$data,$filtro=""){ |
| 220 | 215 | try { |
| 221 | 216 | $prep = $pdo->prepare($sql); |
| 222 | 217 | } catch (PDOException $e) { |
| 223 | - return false; | |
| 218 | + return "Error!: "; | |
| 224 | 219 | } |
| 225 | 220 | try { |
| 226 | 221 | $exec = $prep->execute(array_values($data)); |
| 227 | 222 | i3GeoAdminInsertLog($pdo,$sql,array_values($data)); |
| 228 | 223 | return true; |
| 229 | 224 | } catch (PDOException $e) { |
| 230 | - return false; | |
| 225 | + return "Error!: "; | |
| 231 | 226 | } |
| 232 | 227 | } |
| 233 | 228 | /** |
| ... | ... | @@ -249,7 +244,7 @@ function i3GeoAdminInsert($pdo,$tabela,$data){ |
| 249 | 244 | try { |
| 250 | 245 | $prep = $pdo->prepare($sql); |
| 251 | 246 | } catch (PDOException $e) { |
| 252 | - return false; | |
| 247 | + return "prepare "; | |
| 253 | 248 | } |
| 254 | 249 | try { |
| 255 | 250 | $exec = $prep->execute(array_values($data)); |
| ... | ... | @@ -257,7 +252,7 @@ function i3GeoAdminInsert($pdo,$tabela,$data){ |
| 257 | 252 | i3GeoAdminInsertLog($pdo,$sql,array_values($data)); |
| 258 | 253 | return true; |
| 259 | 254 | } catch (PDOException $e) { |
| 260 | - return false; | |
| 255 | + return "execute "; | |
| 261 | 256 | } |
| 262 | 257 | } |
| 263 | 258 | /** | ... | ... |
admin1/catalogo/menus/index.php
| ... | ... | @@ -17,8 +17,9 @@ include "../../head.php"; |
| 17 | 17 | </div> |
| 18 | 18 | <div class="container-fluid"> |
| 19 | 19 | <div class="row"> |
| 20 | - <iframe src="../../../admin/html/menus.html" style="width:100%; height:5000px;border:none; scrolling:no; frameborder:0; marginheight:0; marginwidth:0;" ></iframe> | |
| 21 | -</div> | |
| 20 | + <iframe src="../../../admin/html/menus.html" | |
| 21 | + style="width: 100%; height: 5000px; border: none; scrolling: no; frameborder: 0; marginheight: 0; marginwidth: 0;"></iframe> | |
| 22 | + </div> | |
| 22 | 23 | </div> |
| 23 | 24 | <script> |
| 24 | 25 | $(document).ready(function(){ | ... | ... |
admin1/usuarios/cadastro/index.php
| ... | ... | @@ -17,7 +17,7 @@ include "../../head.php"; |
| 17 | 17 | </div> |
| 18 | 18 | <div class="container-fluid"> |
| 19 | 19 | <div class="row"> |
| 20 | - <iframe style="width:100%; height:5000px;border:none; scrolling:no; frameborder:0; marginheight:0; marginwidth:0;" src="../../../admin/html/usuarios.html"></iframe> | |
| 20 | + <iframe src="../../../admin/html/usuarios_.html" style="width:100%; height:5000px;border:none; scrolling:no; frameborder:0; marginheight:0; marginwidth:0;" ></iframe> | |
| 21 | 21 | </div> |
| 22 | 22 | </div> |
| 23 | 23 | <script> | ... | ... |