Commit 5d2661f93b56e3de49823e955c8edf216072ed63
1 parent
45c3f821
Exists in
master
and in
7 other branches
--no commit message
Showing
19 changed files
with
521 additions
and
5 deletions
Show diff stats
@@ -0,0 +1,49 @@ | @@ -0,0 +1,49 @@ | ||
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>Menus</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="../js/menu.js"></script> | ||
19 | +</head> | ||
20 | +<body class=" yui-skin-sam"> | ||
21 | +<div style="margin:20px"> | ||
22 | +<div style=width:80%;text-align:center;> | ||
23 | +<h1>Administração do i3geo - menu de temas <img src="../imagens/04.png" style="cursor:pointer" id=botaoAjuda /></h1> | ||
24 | + | ||
25 | +</div> | ||
26 | +<div id="ajuda"> | ||
27 | + <div class="hd">Ajuda</div> | ||
28 | + <div class="bd" style="height:144px;overflow:auto"> | ||
29 | + Este programa permite editar a lista de menus.<br><br> | ||
30 | + Você pode criar vários menus e depois acrescentar grupos, subgrupos e temas em cada um. | ||
31 | + Cada menu é mostrado como uma árvore na guia de adição de temas do i3geo.<br><br> | ||
32 | + O menu é baseado no banco admin.db e os usuários que não são editores podem | ||
33 | + ver apenas os menus publicados.<br><br> | ||
34 | + Os perfis que podem ser definidos para cada menu, são obtidos da tabela de perfis. Veja | ||
35 | + o menu principal do sistema de administração para maiores detalhes.<br><br> | ||
36 | + A lista de IPs dos usuários que podem editar os menu é definida no | ||
37 | + arquivo i3geo/ms_configura.php | ||
38 | + </div> | ||
39 | + <div class="ft"></div> | ||
40 | +</div> | ||
41 | +<input onclick="adicionaLinha()" type=button id=adiciona value="Adicionar um novo menu" /> | ||
42 | +<br> | ||
43 | +<p>Menus existentes: (clique na célula para editar e salve a linha editada)</p> | ||
44 | +<div id="tabela" style="left:-5px;"></div> | ||
45 | +</div> | ||
46 | +<div id=logajax style="display:block" ></div> | ||
47 | +<div id=dialogoContinua style="display:block" ></div> | ||
48 | + | ||
49 | +</body> |
admin/js/admin.js
@@ -34,6 +34,9 @@ $mensagemAguarde = "<img src='../../imagens/aguarde.gif' />";//"<span style=colo | @@ -34,6 +34,9 @@ $mensagemAguarde = "<img src='../../imagens/aguarde.gif' />";//"<span style=colo | ||
34 | $i = function(i) | 34 | $i = function(i) |
35 | {return document.getElementById(i);}; | 35 | {return document.getElementById(i);}; |
36 | 36 | ||
37 | + | ||
38 | + | ||
39 | + | ||
37 | /* | 40 | /* |
38 | Variable: cPaint | 41 | Variable: cPaint |
39 | Objeto cpaint para chamada ajax | 42 | Objeto cpaint para chamada ajax |
@@ -0,0 +1,255 @@ | @@ -0,0 +1,255 @@ | ||
1 | +/* | ||
2 | +Title: core.js | ||
3 | + | ||
4 | +Carrega os arquivos js e css básicos utilizados pela interface de administração e define algumas funções de uso geral | ||
5 | + | ||
6 | +File: i3geo/admin/js/core.js | ||
7 | + | ||
8 | +About: Licença | ||
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@mma.gov.br | ||
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 | +tanto a versão 2 da Licença. | ||
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 cópia 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 | +/* | ||
29 | +Function: $i | ||
30 | + | ||
31 | +Pega um objeto do documento. | ||
32 | + | ||
33 | +Exemplo: $i("box1") | ||
34 | + | ||
35 | +Parâmetros: | ||
36 | + | ||
37 | +id - id do objeto | ||
38 | + | ||
39 | +Retorno: | ||
40 | + | ||
41 | +object - objeto javaScript | ||
42 | +*/ | ||
43 | +var $i = function(id) | ||
44 | +{return document.getElementById(id);}; | ||
45 | +/* | ||
46 | +Function: core_handleSuccess | ||
47 | + | ||
48 | +Processa o retorno da chamada em ajax quando tiver sucesso. Esta é uma | ||
49 | +função genérica, pouco usada. | ||
50 | + | ||
51 | +Parameters: | ||
52 | + | ||
53 | +o - string retornada pelo ajax | ||
54 | +*/ | ||
55 | +function core_handleSuccess(o) | ||
56 | +{ | ||
57 | + //div onde será mostrado o log | ||
58 | + if(!$i('logajax')) | ||
59 | + {document.body.innerHTML += "<div id=logajax ></div>";} | ||
60 | + log = $i('logajax'); | ||
61 | + YAHOO.log("The success handler was called. tId: " + o.tId + ".", "info", "example"); | ||
62 | + if(o.responseText !== undefined) | ||
63 | + { | ||
64 | + log.innerHTML = "<li>Transaction id: " + o.tId + "</li>"; | ||
65 | + log.innerHTML += "<li>HTTP status: " + o.status + "</li>"; | ||
66 | + log.innerHTML += "<li>Status code message: " + o.statusText + "</li>"; | ||
67 | + log.innerHTML += "<li>HTTP headers: <ul>" + o.getAllResponseHeaders + "</ul></li>"; | ||
68 | + log.innerHTML += "<li>Server response: " + o.responseText + "</li>"; | ||
69 | + log.innerHTML += "<li>Argument object: Object ( [foo] => " + o.argument.foo + " [bar] => " + o.argument.bar +" )</li>"; | ||
70 | + } | ||
71 | +} | ||
72 | +/* | ||
73 | +Function: core_handleFailure | ||
74 | + | ||
75 | +Processa o retorno da chamada em ajax quando tiver falhado. | ||
76 | + | ||
77 | +Parameters: | ||
78 | + | ||
79 | +o - string retornada pelo ajax | ||
80 | +*/ | ||
81 | +function core_handleFailure(o,texto) | ||
82 | +{ | ||
83 | + //div onde será mostrado o log | ||
84 | + if(!$i('logajax')) | ||
85 | + {document.body.innerHTML += "<div id=logajax ></div>";} | ||
86 | + log = $i('logajax'); | ||
87 | + YAHOO.log("The failure handler was called. tId: " + o.tId + ".", "info", "example"); | ||
88 | + if(o.responseText !== undefined) | ||
89 | + { | ||
90 | + log.innerHTML = "<ul><li>Transaction id: " + o.tId + "</li>"; | ||
91 | + log.innerHTML += "<li>HTTP status: " + o.status + "</li>"; | ||
92 | + log.innerHTML += "<li>Status code message: " + o.statusText + "</li>"; | ||
93 | + log.innerHTML += "<li>PHP message: " + texto + "</li></ul>"; | ||
94 | + } | ||
95 | + if (!YAHOO.example.container.wait) | ||
96 | + { | ||
97 | + YAHOO.example.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",fixedcenter: true,close: true,draggable: false,zindex:4,modal: true,visible: false}); | ||
98 | + YAHOO.example.container.wait.setHeader("Aguarde..."); | ||
99 | + YAHOO.example.container.wait.render(document.body); | ||
100 | + } | ||
101 | + else | ||
102 | + {YAHOO.example.container.wait.setBody(log.innerHTML);} | ||
103 | +} | ||
104 | +/* | ||
105 | +Function: core_makeRequest | ||
106 | + | ||
107 | +Executa uma chamada em ajax. | ||
108 | + | ||
109 | +Parameters: | ||
110 | + | ||
111 | +sUrl - url que será executada | ||
112 | + | ||
113 | +callback - função que processará o retorno | ||
114 | +*/ | ||
115 | +function core_makeRequest(sUrl,callback) | ||
116 | +{ | ||
117 | + var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); | ||
118 | + YAHOO.log("Initiating request; tId: " + request.tId + ".", "info", "example"); | ||
119 | +} | ||
120 | +/* | ||
121 | +Function: core_carregando | ||
122 | + | ||
123 | +Mostra uma janela de aguarde | ||
124 | +*/ | ||
125 | +function core_carregando() | ||
126 | +{ | ||
127 | + if (!YAHOO.example.container.wait) | ||
128 | + { | ||
129 | + YAHOO.example.container.wait = new YAHOO.widget.Panel("wait",{width: "240px",fixedcenter: true,close: true,draggable: false,zindex:4,modal: true,visible: false}); | ||
130 | + YAHOO.example.container.wait.setHeader("Aguarde..."); | ||
131 | + YAHOO.example.container.wait.setBody("<img src=\"../../imagens/aguarde.gif\"/>"); | ||
132 | + YAHOO.example.container.wait.render(document.body); | ||
133 | + } | ||
134 | + YAHOO.example.container.wait.show(); | ||
135 | +} | ||
136 | +/* | ||
137 | +Function: core_dialogoContinua | ||
138 | + | ||
139 | +Mostra um diálogo do tipo sim não | ||
140 | + | ||
141 | +Parameters: | ||
142 | + | ||
143 | +handleYes - função para sim | ||
144 | + | ||
145 | +handleNo - função para não | ||
146 | + | ||
147 | +mensagem - mensagem do diálogo | ||
148 | + | ||
149 | +largura - largura do diálogo em px | ||
150 | +*/ | ||
151 | +function core_dialogoContinua(handleYes,handleNo,mensagem,largura) | ||
152 | +{ | ||
153 | + if(!$i("dialogoContinua")) | ||
154 | + {document.body.innerHTML += "<div id='dialogoContinua'></div>";} | ||
155 | + // Instantiate the Dialog | ||
156 | + YAHOO.namespace("continua.container"); | ||
157 | + YAHOO.continua.container.simpledialog1 = | ||
158 | + new YAHOO.widget.SimpleDialog("simpledialog1", | ||
159 | + { width: largura+"px", | ||
160 | + fixedcenter: true, | ||
161 | + visible: false, | ||
162 | + draggable: false, | ||
163 | + close: true, | ||
164 | + text: mensagem, | ||
165 | + icon: YAHOO.widget.SimpleDialog.ICON_HELP, | ||
166 | + modal: true, | ||
167 | + constraintoviewport: true, | ||
168 | + buttons: [ { text:"Sim", handler:handleYes, isDefault:true }, | ||
169 | + { text:"Não", handler:handleNo } ] | ||
170 | + } ); | ||
171 | + YAHOO.continua.container.simpledialog1.setHeader("Tem certeza?"); | ||
172 | + YAHOO.continua.container.simpledialog1.render("dialogoContinua"); | ||
173 | + YAHOO.continua.container.simpledialog1.show(); | ||
174 | +} | ||
175 | +/* | ||
176 | +Function: core_ativaPainelAjuda | ||
177 | + | ||
178 | +Parameters: | ||
179 | + | ||
180 | +id - id do elemento que receberá o painel | ||
181 | + | ||
182 | +botao - id do elemento que deverá ser lcicado para abrir o painel | ||
183 | +*/ | ||
184 | +function core_ativaPainelAjuda(id,botao) | ||
185 | +{ | ||
186 | + YAHOO.example.container.panelAjuda = new YAHOO.widget.Panel(id, { width:"350px", height:"200px",overflow:"auto", visible:false,constraintoviewport:true } ); | ||
187 | + YAHOO.example.container.panelAjuda.render(); | ||
188 | + YAHOO.util.Event.addListener(botao, "click", YAHOO.example.container.panelAjuda.show, YAHOO.example.container.panelAjuda, true); | ||
189 | +} | ||
190 | + | ||
191 | +// | ||
192 | +//define o local correto dos programas | ||
193 | +var scriptLocation = ""; | ||
194 | +var scripts = document.getElementsByTagName('script'); | ||
195 | +var i = 0; | ||
196 | +for (i = 0; i < scripts.length; i++) { | ||
197 | + var src = scripts[i].getAttribute('src'); | ||
198 | + if (src) { | ||
199 | + var index = src.lastIndexOf("core.js"); | ||
200 | + // is it found, at the end of the URL? | ||
201 | + if ((index > -1) && (index + "core.js".length == src.length)) { | ||
202 | + scriptLocation = src.slice(0, -"core.js".length); | ||
203 | + break; | ||
204 | + } | ||
205 | + } | ||
206 | +} | ||
207 | +// | ||
208 | +//arquivos javascript que serão carregados | ||
209 | +// | ||
210 | +var jsfiles = new Array( | ||
211 | +"../../pacotes/yui252/build/utilities/utilities.js", | ||
212 | +"../../pacotes/yui252/build/yahoo-dom-event/yahoo-dom-event.js", | ||
213 | +"../../pacotes/yui252/build/element/element-beta-min.js", | ||
214 | +"../../pacotes/yui252/build/datasource/datasource-beta-min.js", | ||
215 | +"../../pacotes/yui252/build/datatable/datatable-beta-min.js", | ||
216 | +"../../pacotes/yui252/build/button/button-min.js", | ||
217 | +"../../pacotes/yui252/build/dragdrop/dragdrop-min.js", | ||
218 | +"../../pacotes/yui252/build/container/container-min.js", | ||
219 | +"../../pacotes/yui252/build/connection/connection-min.js", | ||
220 | +"../../pacotes/yui252/build/json/json-min.js" | ||
221 | +); | ||
222 | +// | ||
223 | +//arquivos css | ||
224 | +// | ||
225 | +var cssfiles =new Array( | ||
226 | +"../html/admin.css", | ||
227 | +"../../pacotes/yui252/build/fonts/fonts-min.css", | ||
228 | +"../../pacotes/yui252/build/datatable/assets/skins/sam/datatable.css", | ||
229 | +"../../pacotes/yui252/build/button/assets/skins/sam/button.css", | ||
230 | +"../../pacotes/yui252/build/container/assets/skins/sam/container.css" | ||
231 | +); | ||
232 | +// | ||
233 | +//carrega os arquivos js | ||
234 | +// | ||
235 | +var allScriptTags = ""; | ||
236 | +for (i = 0; i < jsfiles.length; i++) | ||
237 | +{ | ||
238 | + var currentScriptTag = "<script src='" + scriptLocation + jsfiles[i] + "'></script>"; | ||
239 | + allScriptTags += currentScriptTag; | ||
240 | +} | ||
241 | +document.write(allScriptTags); | ||
242 | +// | ||
243 | +//carrega os arquivos css | ||
244 | +// | ||
245 | +var allCssTags = ""; | ||
246 | +for (i = 0; i < cssfiles.length; i++) | ||
247 | +{ | ||
248 | + var currentCssTag = "<link rel='stylesheet' type='text/css' href='" + scriptLocation + cssfiles[i] + "'/>"; | ||
249 | + allCssTags += currentCssTag; | ||
250 | +} | ||
251 | +document.write(allCssTags); | ||
252 | + | ||
253 | + | ||
254 | + | ||
255 | + |
@@ -0,0 +1,183 @@ | @@ -0,0 +1,183 @@ | ||
1 | +YAHOO.namespace("example.container"); | ||
2 | +function initMenu() | ||
3 | +{ | ||
4 | + ativaBotaoAdicionaMenu() | ||
5 | + core_carregando(); | ||
6 | + core_ativaPainelAjuda("ajuda","botaoAjuda"); | ||
7 | + pegaMenus(); | ||
8 | + pegaPerfis(); | ||
9 | +} | ||
10 | +function ativaBotaoAdicionaMenu() | ||
11 | +{ | ||
12 | + var adicionalinha = function() | ||
13 | + { | ||
14 | + core_carregando(); | ||
15 | + var sUrl = "../php/menutemas.php?funcao=alteraMenus&publicado_menu=&perfil=&nome=&desc=&id=&aberto="; | ||
16 | + var callback = | ||
17 | + { | ||
18 | + success:function(o) | ||
19 | + { | ||
20 | + try | ||
21 | + {pegaMenus();} | ||
22 | + catch(e){core_handleFailure(o,o.responseText);} | ||
23 | + }, | ||
24 | + failure:core_handleFailure, | ||
25 | + argument: { foo:"foo", bar:"bar" } | ||
26 | + }; | ||
27 | + core_makeRequest(sUrl,callback) | ||
28 | + }; | ||
29 | + //cria o botão de adição de um novo menu | ||
30 | + var adiciona = new YAHOO.widget.Button("adiciona",{ onclick: { fn: adicionalinha } }); | ||
31 | +} | ||
32 | +function pegaPerfis() | ||
33 | +{ | ||
34 | + //pega a lista de perfis | ||
35 | + var sUrl = "../php/menutemas.php?funcao=pegaPerfisYUI"; | ||
36 | + var callback = | ||
37 | + { | ||
38 | + success:function(o) | ||
39 | + { | ||
40 | + try | ||
41 | + {$perfis = YAHOO.lang.JSON.parse(o.responseText);} | ||
42 | + catch(e){core_handleFailure(o,o.responseText);} | ||
43 | + }, | ||
44 | + failure:core_handleFailure, | ||
45 | + argument: { foo:"foo", bar:"bar" } | ||
46 | + }; | ||
47 | + core_makeRequest(sUrl,callback) | ||
48 | +} | ||
49 | +function pegaMenus() | ||
50 | +{ | ||
51 | + var sUrl = "../php/menutemas.php?funcao=pegaMenusYUI"; | ||
52 | + var callback = | ||
53 | + { | ||
54 | + success:function(o) | ||
55 | + { | ||
56 | + try | ||
57 | + {montaTabela(YAHOO.lang.JSON.parse(o.responseText));} | ||
58 | + catch(e){core_handleFailure(o,o.responseText);} | ||
59 | + }, | ||
60 | + failure:core_handleFailure, | ||
61 | + argument: { foo:"foo", bar:"bar" } | ||
62 | + }; | ||
63 | + core_makeRequest(sUrl,callback) | ||
64 | +} | ||
65 | +function montaTabela(dados) | ||
66 | +{ | ||
67 | + YAHOO.example.InlineCellEditing = new function() | ||
68 | + { | ||
69 | + // Custom formatter for "address" column to preserve line breaks | ||
70 | + var formatTexto = function(elCell, oRecord, oColumn, oData) | ||
71 | + { | ||
72 | + elCell.innerHTML = "<pre ><p>" + oData + "</pre>"; | ||
73 | + }; | ||
74 | + var formatSalva = function(elCell, oRecord, oColumn) | ||
75 | + { | ||
76 | + elCell.innerHTML = "<div class=aplicar style='text-align:center' onclick='gravaLinha(\""+oRecord._sId+"\")'></div>"; | ||
77 | + }; | ||
78 | + var formatExclui = function(elCell, oRecord, oColumn) | ||
79 | + { | ||
80 | + elCell.innerHTML = "<div class=excluir style='text-align:center' onclick='excluiLinha(\""+oRecord.getData("id_menu")+"\",\""+oRecord.getId()+"\")'></div>"; | ||
81 | + }; | ||
82 | + var myColumnDefs = [ | ||
83 | + {label:"exclui",formatter:formatExclui}, | ||
84 | + {label:"salva",formatter:formatSalva}, | ||
85 | + {label:"id",key:"id_menu", formatter:formatTexto}, | ||
86 | + {label:"nome",resizeable:true,key:"nome_menu", formatter:formatTexto, editor:"textbox"}, | ||
87 | + {label:"publicado?",key:"publicado_menu",editor:"radio" ,editorOptions:{radioOptions:["SIM","NAO"],disableBtns:false}}, | ||
88 | + {label:"perfis",resizeable:true,key:"perfil_menu", formatter:formatTexto, editor:"textbox"}, | ||
89 | + {label:"aberto?",key:"aberto", editor:"radio" ,editorOptions:{radioOptions:["SIM","NAO"],disableBtns:false}}, | ||
90 | + {label:"descrição",resizeable:true,key:"desc_menu", formatter:formatTexto, editor:"textbox"} | ||
91 | + ]; | ||
92 | + myDataSource = new YAHOO.util.DataSource(dados); | ||
93 | + myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; | ||
94 | + myDataSource.responseSchema = | ||
95 | + { | ||
96 | + fields: ["publicado_menu","perfil_menu","aberto","desc_menu","id_menu","nome_menu"] | ||
97 | + }; | ||
98 | + myDataTable = new YAHOO.widget.DataTable("tabela", myColumnDefs, myDataSource); | ||
99 | + // Set up editing flow | ||
100 | + myDataTable.highlightEditableCell = function(oArgs) | ||
101 | + { | ||
102 | + var elCell = oArgs.target; | ||
103 | + if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) | ||
104 | + { | ||
105 | + myDataTable.highlightCell(elCell); | ||
106 | + } | ||
107 | + }; | ||
108 | + myDataTable.subscribe("cellMouseoverEvent", myDataTable.highlightEditableCell); | ||
109 | + myDataTable.subscribe("cellMouseoutEvent", myDataTable.onEventUnhighlightCell); | ||
110 | + myDataTable.subscribe("cellClickEvent", myDataTable.onEventShowCellEditor); | ||
111 | + | ||
112 | + // Hook into custom event to customize save-flow of "radio" editor | ||
113 | + myDataTable.subscribe("editorUpdateEvent", function(oArgs) | ||
114 | + { | ||
115 | + if(oArgs.editor.column.key === "active") | ||
116 | + { | ||
117 | + this.saveCellEditor(); | ||
118 | + | ||
119 | + } | ||
120 | + }); | ||
121 | + myDataTable.subscribe("editorBlurEvent", function(oArgs) | ||
122 | + { | ||
123 | + this.cancelCellEditor(); | ||
124 | + }); | ||
125 | + }; | ||
126 | + YAHOO.example.container.wait.hide(); | ||
127 | +} | ||
128 | +function gravaLinha(row) | ||
129 | +{ | ||
130 | + var r = myDataTable.getRecordSet().getRecord(row); | ||
131 | + var publicado_menu = r.getData("publicado_menu"); | ||
132 | + var perfil_menu = r.getData("perfil_menu"); | ||
133 | + var aberto = r.getData("aberto") | ||
134 | + var desc_menu = r.getData("desc_menu") | ||
135 | + var id_menu = r.getData("id_menu") | ||
136 | + var nome_menu = r.getData("nome_menu") | ||
137 | + core_carregando(); | ||
138 | + var sUrl = "../php/menutemas.php?funcao=alteraMenus&publicado_menu="+publicado_menu+"&perfil="+perfil_menu+"&nome="+nome_menu+"&desc="+desc_menu+"&id="+id_menu+"&aberto="+aberto+""; | ||
139 | + var callback = | ||
140 | + { | ||
141 | + success:function(o) | ||
142 | + { | ||
143 | + YAHOO.example.container.wait.hide(); | ||
144 | + }, | ||
145 | + failure:core_handleFailure, | ||
146 | + argument: { foo:"foo", bar:"bar" } | ||
147 | + }; | ||
148 | + core_makeRequest(sUrl,callback) | ||
149 | +} | ||
150 | +function excluiLinha(id,row) | ||
151 | +{ | ||
152 | + //dialogo | ||
153 | + // Define various event handlers for Dialog | ||
154 | + var handleYes = function() { | ||
155 | + this.hide(); | ||
156 | + core_carregando(); | ||
157 | + var sUrl = "../php/menutemas.php?funcao=excluirRegistro&id="+id+"&tabela=menus"; | ||
158 | + var callback = | ||
159 | + { | ||
160 | + success:function(o) | ||
161 | + { | ||
162 | + try | ||
163 | + { | ||
164 | + pegaMenus(); | ||
165 | + //ativaBotaoAdicionaMenu(); | ||
166 | + //core_ativaPainelAjuda("ajuda","botaoAjuda"); | ||
167 | + } | ||
168 | + catch(e){core_handleFailure(o,o.responseText);} | ||
169 | + }, | ||
170 | + failure:core_handleFailure, | ||
171 | + argument: { foo:"foo", bar:"bar" } | ||
172 | + }; | ||
173 | + core_makeRequest(sUrl,callback) | ||
174 | + }; | ||
175 | + var handleNo = function() | ||
176 | + { | ||
177 | + this.hide(); | ||
178 | + }; | ||
179 | + var mensagem = "Exclui o registro?"; | ||
180 | + var largura = "300" | ||
181 | + core_dialogoContinua(handleYes,handleNo,mensagem,largura) | ||
182 | +} | ||
183 | +YAHOO.util.Event.addListener(window, "load", initMenu); | ||
0 | \ No newline at end of file | 184 | \ No newline at end of file |
admin/js/menutemas.js
@@ -71,6 +71,7 @@ function montaParametros() | @@ -71,6 +71,7 @@ function montaParametros() | ||
71 | ins += "</fieldset><br>" | 71 | ins += "</fieldset><br>" |
72 | } | 72 | } |
73 | document.body.innerHTML += ins | 73 | document.body.innerHTML += ins |
74 | + $i("aguarde").style.display="none" | ||
74 | //pegaParametros() | 75 | //pegaParametros() |
75 | } | 76 | } |
76 | /* | 77 | /* |
admin/php/admin.php
@@ -46,7 +46,7 @@ if(!isset($locaplic)) | @@ -46,7 +46,7 @@ if(!isset($locaplic)) | ||
46 | } | 46 | } |
47 | } | 47 | } |
48 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 48 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
49 | -error_reporting(0); | 49 | +error_reporting(E_ALL); |
50 | // | 50 | // |
51 | //carrega o phpmapscript | 51 | //carrega o phpmapscript |
52 | // | 52 | // |
admin/php/menutemas.php
@@ -27,6 +27,7 @@ File: i3geo/admin/mapfiles.php | @@ -27,6 +27,7 @@ File: i3geo/admin/mapfiles.php | ||
27 | 19/6/2007 | 27 | 19/6/2007 |
28 | 28 | ||
29 | */ | 29 | */ |
30 | +error_reporting(E_ALL); | ||
30 | include_once("admin.php"); | 31 | include_once("admin.php"); |
31 | $cp = new cpaint(); | 32 | $cp = new cpaint(); |
32 | //faz a busca da função que deve ser executada | 33 | //faz a busca da função que deve ser executada |
@@ -48,6 +49,12 @@ switch ($funcao) | @@ -48,6 +49,12 @@ switch ($funcao) | ||
48 | $cp->return_data(); | 49 | $cp->return_data(); |
49 | break; | 50 | break; |
50 | 51 | ||
52 | + case "pegaMenusYUI": | ||
53 | + $dados = pegaDados('SELECT * from i3geoadmin_menus order by nome_menu'); | ||
54 | + echo json_encode($dados); | ||
55 | + exit; | ||
56 | + break; | ||
57 | + | ||
51 | case "pegaTags": | 58 | case "pegaTags": |
52 | $cp->set_data(pegaDados('SELECT * from i3geoadmin_tags order by nome')); | 59 | $cp->set_data(pegaDados('SELECT * from i3geoadmin_tags order by nome')); |
53 | $cp->return_data(); | 60 | $cp->return_data(); |
@@ -56,11 +63,17 @@ switch ($funcao) | @@ -56,11 +63,17 @@ switch ($funcao) | ||
56 | case "pegaPerfis": | 63 | case "pegaPerfis": |
57 | $cp->set_data(pegaDados('SELECT * from i3geoadmin_perfis order by perfil')); | 64 | $cp->set_data(pegaDados('SELECT * from i3geoadmin_perfis order by perfil')); |
58 | $cp->return_data(); | 65 | $cp->return_data(); |
59 | - break; | 66 | + break; |
67 | + | ||
68 | + case "pegaPerfisYUI": | ||
69 | + $dados = pegaDados('SELECT * from i3geoadmin_perfis order by perfil'); | ||
70 | + echo json_encode($dados); | ||
71 | + exit; | ||
72 | + break; | ||
60 | 73 | ||
61 | case "alteraMenus": | 74 | case "alteraMenus": |
62 | - $cp->set_data(alteraMenus()); | ||
63 | - $cp->return_data(); | 75 | + alteraMenus(); |
76 | + exit; | ||
64 | break; | 77 | break; |
65 | 78 | ||
66 | case "pegaGrupos": | 79 | case "pegaGrupos": |
@@ -330,7 +343,7 @@ function alteraMenus() | @@ -330,7 +343,7 @@ function alteraMenus() | ||
330 | $dbhw->query("UPDATE i3geoadmin_menus SET publicado_menu = '$publicado_menu',aberto = '$aberto', nome_menu = '$nome', desc_menu = '$desc', perfil_menu = '$perfil' WHERE id_menu = $id"); | 343 | $dbhw->query("UPDATE i3geoadmin_menus SET publicado_menu = '$publicado_menu',aberto = '$aberto', nome_menu = '$nome', desc_menu = '$desc', perfil_menu = '$perfil' WHERE id_menu = $id"); |
331 | } | 344 | } |
332 | else | 345 | else |
333 | - $dbhw->query("INSERT INTO i3geoadmin_menus (publicado_menu, nome_menu, desc_menu, aberto, perfil_menu) VALUES ('','', '','sim','')"); | 346 | + $dbhw->query("INSERT INTO i3geoadmin_menus (publicado_menu, nome_menu, desc_menu, aberto, perfil_menu) VALUES ('','', '','SIM','')"); |
334 | $dbhw = null; | 347 | $dbhw = null; |
335 | $dbh = null; | 348 | $dbh = null; |
336 | return "ok"; | 349 | return "ok"; |
admin/rssgrupos.php
@@ -20,5 +20,6 @@ if(!isset($locaplic)) | @@ -20,5 +20,6 @@ if(!isset($locaplic)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraRSSgrupos($locaplic); | 24 | echo geraRSSgrupos($locaplic); |
24 | ?> | 25 | ?> |
admin/rsssubgrupos.php
@@ -20,5 +20,6 @@ if(!isset($locaplic)) | @@ -20,5 +20,6 @@ if(!isset($locaplic)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraRSSsubgrupos($locaplic,$id); | 24 | echo geraRSSsubgrupos($locaplic,$id); |
24 | ?> | 25 | ?> |
admin/rsstemas.php
@@ -20,5 +20,6 @@ if(!isset($locaplic)) | @@ -20,5 +20,6 @@ if(!isset($locaplic)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraRSStemas($locaplic,$id); | 24 | echo geraRSStemas($locaplic,$id); |
24 | ?> | 25 | ?> |
admin/xmlatlas.php
@@ -20,5 +20,6 @@ if(!isset($locaplic) || !isset($editores)) | @@ -20,5 +20,6 @@ if(!isset($locaplic) || !isset($editores)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraXmlAtlas($locaplic,$editores); | 24 | echo geraXmlAtlas($locaplic,$editores); |
24 | ?> | 25 | ?> |
admin/xmlgeorss.php
@@ -20,5 +20,6 @@ if(!isset($locaplic)) | @@ -20,5 +20,6 @@ if(!isset($locaplic)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraXmlGeorss($locaplic); | 24 | echo geraXmlGeorss($locaplic); |
24 | ?> | 25 | ?> |
admin/xmlidentifica.php
@@ -21,5 +21,6 @@ if(!isset($locaplic) || !isset($editores)) | @@ -21,5 +21,6 @@ if(!isset($locaplic) || !isset($editores)) | ||
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | if(!isset($perfil)){$perfil = "";} | 23 | if(!isset($perfil)){$perfil = "";} |
24 | +echo header("Content-type: application/xml"); | ||
24 | echo geraXmlIdentifica($perfil,$locaplic,$editores); | 25 | echo geraXmlIdentifica($perfil,$locaplic,$editores); |
25 | ?> | 26 | ?> |
admin/xmllinksdownload.php
@@ -20,5 +20,6 @@ if(!isset($locaplic)) | @@ -20,5 +20,6 @@ if(!isset($locaplic)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraXmlDownload($locaplic); | 24 | echo geraXmlDownload($locaplic); |
24 | ?> | 25 | ?> |
admin/xmlmapas.php
@@ -21,5 +21,6 @@ if(!isset($locaplic)) | @@ -21,5 +21,6 @@ if(!isset($locaplic)) | ||
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | if(!isset($perfil)){$perfil = "";} | 23 | if(!isset($perfil)){$perfil = "";} |
24 | +echo header("Content-type: application/xml"); | ||
24 | echo geraXmlMapas($perfil,$locaplic,$editores); | 25 | echo geraXmlMapas($perfil,$locaplic,$editores); |
25 | ?> | 26 | ?> |
admin/xmlmenutemas.php
@@ -23,5 +23,6 @@ include_once($locaplic."/admin/php/xml.php"); | @@ -23,5 +23,6 @@ include_once($locaplic."/admin/php/xml.php"); | ||
23 | if(!isset($perfil)){$perfil = "";} | 23 | if(!isset($perfil)){$perfil = "";} |
24 | if(!isset($id_menu)){$id_menu = "";} | 24 | if(!isset($id_menu)){$id_menu = "";} |
25 | if(!isset($tipo)){$tipo = "";} | 25 | if(!isset($tipo)){$tipo = "";} |
26 | +echo header("Content-type: application/xml"); | ||
26 | echo geraXmlMenutemas($perfil,$id_menu,$tipo,$locaplic); | 27 | echo geraXmlMenutemas($perfil,$id_menu,$tipo,$locaplic); |
27 | ?> | 28 | ?> |
admin/xmlservicoswms.php
@@ -20,5 +20,6 @@ if(!isset($locaplic)) | @@ -20,5 +20,6 @@ if(!isset($locaplic)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraXmlWMS($locaplic); | 24 | echo geraXmlWMS($locaplic); |
24 | ?> | 25 | ?> |
admin/xmlservicosws.php
@@ -20,5 +20,6 @@ if(!isset($locaplic)) | @@ -20,5 +20,6 @@ if(!isset($locaplic)) | ||
20 | } | 20 | } |
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | +echo header("Content-type: application/xml"); | ||
23 | echo geraXmlWS($locaplic); | 24 | echo geraXmlWS($locaplic); |
24 | ?> | 25 | ?> |
admin/xmlsistemas.php
@@ -21,5 +21,6 @@ if(!isset($locaplic) || !isset($editores)) | @@ -21,5 +21,6 @@ if(!isset($locaplic) || !isset($editores)) | ||
21 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 21 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
22 | include_once($locaplic."/admin/php/xml.php"); | 22 | include_once($locaplic."/admin/php/xml.php"); |
23 | if(!isset($perfil)){$perfil = "";} | 23 | if(!isset($perfil)){$perfil = "";} |
24 | +echo header("Content-type: application/xml"); | ||
24 | echo geraXmlSistemas($perfil,$locaplic,$editores); | 25 | echo geraXmlSistemas($perfil,$locaplic,$editores); |
25 | ?> | 26 | ?> |