Commit 230ed8824514c98ef773bb59ac98897d6161e2d0
1 parent
b9942659
Exists in
master
and in
7 other branches
Adaptação do editor de atlas para uso com bootstrap
Showing
21 changed files
with
1242 additions
and
25 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin1/catalogo/atlas/index.js
@@ -93,7 +93,7 @@ Obtém a lista | @@ -93,7 +93,7 @@ Obtém a lista | ||
93 | $("#filtro").combobox(); | 93 | $("#filtro").combobox(); |
94 | if(filtro != ""){ | 94 | if(filtro != ""){ |
95 | i3GEOadmin.core.defineFiltro(filtro); | 95 | i3GEOadmin.core.defineFiltro(filtro); |
96 | - i3GEOadmin.core.filtra(i3GEOadmin.atlas.pegaFiltro()); | 96 | + i3GEOadmin.core.filtra(i3GEOadmin.core.pegaFiltro()); |
97 | } | 97 | } |
98 | //monta um template para o modal de inclusao de novo usuario | 98 | //monta um template para o modal de inclusao de novo usuario |
99 | if(i3GEOadmin.atlas.formAdiciona == ""){ | 99 | if(i3GEOadmin.atlas.formAdiciona == ""){ |
@@ -220,7 +220,11 @@ Obtém a lista | @@ -220,7 +220,11 @@ Obtém a lista | ||
220 | ); | 220 | ); |
221 | }, | 221 | }, |
222 | editarPranchas: function(id_atlas,titulo_atlas){ | 222 | editarPranchas: function(id_atlas,titulo_atlas){ |
223 | - | 223 | + //muda a url para que o usuario possa voltar pelo botao do navegador |
224 | + var u = window.location.origin + window.location.pathname + "?id_filtro=" + id_atlas; | ||
225 | + window.history.replaceState(null,null,u); | ||
226 | + //abre a pagina de edicao | ||
227 | + window.location.href = "pranchas/index.php?id_atlas=" + id_atlas + "&titulo_atlas=" + titulo_atlas; | ||
224 | }, | 228 | }, |
225 | addInput: function(id,valor){ | 229 | addInput: function(id,valor){ |
226 | var i = $("#"+id); | 230 | var i = $("#"+id); |
admin1/catalogo/atlas/index.php
@@ -52,7 +52,7 @@ include "../../head.php"; | @@ -52,7 +52,7 @@ include "../../head.php"; | ||
52 | </div> | 52 | </div> |
53 | </div> | 53 | </div> |
54 | <script id="templateFiltro" type="x-tmpl-mustache"> | 54 | <script id="templateFiltro" type="x-tmpl-mustache"> |
55 | -<option value="form-{{id_atlas}}">{{{nome_atlas}}}</option> | 55 | +<option value="form-{{id_atlas}}">{{{titulo_atlas}}}</option> |
56 | </script> | 56 | </script> |
57 | <script id="templateLista" type="x-tmpl-mustache"> | 57 | <script id="templateLista" type="x-tmpl-mustache"> |
58 | <div class="panel panel-default" id="form-{{id_atlas}}"> | 58 | <div class="panel panel-default" id="form-{{id_atlas}}"> |
@@ -224,6 +224,11 @@ include "../../head.php"; | @@ -224,6 +224,11 @@ include "../../head.php"; | ||
224 | ); | 224 | ); |
225 | $.material.init(); | 225 | $.material.init(); |
226 | var inicia = function() { | 226 | var inicia = function() { |
227 | + //verifica se foi enviado um parametro de filtro pela url | ||
228 | + var f = "<?php echo filter_var($_GET["id_filtro"], FILTER_SANITIZE_NUMBER_INT); ?>"; | ||
229 | + if(f != ""){ | ||
230 | + i3GEOadmin.core.initFiltro = "form-" + f; | ||
231 | + } | ||
227 | $(".hidden").removeClass('hidden'); | 232 | $(".hidden").removeClass('hidden'); |
228 | i3GEOadmin.atlas.init($("#corpo")); | 233 | i3GEOadmin.atlas.init($("#corpo")); |
229 | }; | 234 | }; |
@@ -0,0 +1,155 @@ | @@ -0,0 +1,155 @@ | ||
1 | +<?php | ||
2 | +/* | ||
3 | + * Licenca: | ||
4 | + * | ||
5 | + * GPL2 | ||
6 | + * | ||
7 | + * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
8 | + * | ||
9 | + * Direitos Autorais Reservados (c) 2006 Edmar Moretti | ||
10 | + * Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
11 | + * | ||
12 | + * Este programa é software livre; você pode redistribuí-lo | ||
13 | + * e/ou modificá-lo sob os termos da Licença Pública Geral | ||
14 | + * GNU conforme publicada pela Free Software Foundation; | ||
15 | + * | ||
16 | + * Este programa é distribuído na expectativa de que seja útil, | ||
17 | + * porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
18 | + * de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
19 | + * Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
20 | + * Você deve ter recebido uma copia da Licença Pública Geral do | ||
21 | + * GNU junto com este programa; se não, escreva para a | ||
22 | + * Free Software Foundation, Inc., no endereço | ||
23 | + * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | + */ | ||
25 | +error_reporting ( 0 ); | ||
26 | +// | ||
27 | +// pega as variaveis passadas com get ou post | ||
28 | +// | ||
29 | + | ||
30 | +include_once (dirname ( __FILE__ ) . "/../../../../admin/php/login.php"); | ||
31 | +$funcoesEdicao = array ( | ||
32 | + "ADICIONAR", | ||
33 | + "ALTERAR", | ||
34 | + "EXCLUIR" | ||
35 | +); | ||
36 | +if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | ||
37 | + if (verificaOperacaoSessao ( "admin/html/atlas" ) === false) { | ||
38 | + header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" ); | ||
39 | + exit (); | ||
40 | + } | ||
41 | +} | ||
42 | +include (dirname ( __FILE__ ) . "/../../../../admin/php/conexao.php"); | ||
43 | + | ||
44 | +$funcao = strtoupper ( $funcao ); | ||
45 | +switch ($funcao) { | ||
46 | + case "ADICIONAR" : | ||
47 | + $novo = adicionar( $id_atlas, $titulo_prancha, $ordem_prancha, $desc_prancha, $h_prancha, $icone_prancha, $link_prancha, $mapext_prancha, $w_prancha, $dbhw ); | ||
48 | + if ($novo === false) { | ||
49 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
50 | + exit (); | ||
51 | + } | ||
52 | + exit (); | ||
53 | + break; | ||
54 | + case "ALTERAR" : | ||
55 | + $novo = alterar ( $id_atlas, $id_prancha, $titulo_prancha, $ordem_prancha, $desc_prancha, $h_prancha, $icone_prancha, $link_prancha, $mapext_prancha, $w_prancha, $dbhw ); | ||
56 | + if ($novo === false) { | ||
57 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
58 | + exit (); | ||
59 | + } | ||
60 | + $dados = pegaDados ( "SELECT id_prancha from ".$esquemaadmin."i3geoadmin_atlasp WHERE id_prancha = $id_prancha", $dbh, false ); | ||
61 | + | ||
62 | + if ($dados === false) { | ||
63 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
64 | + exit (); | ||
65 | + } | ||
66 | + $dbhw = null; | ||
67 | + $dbh = null; | ||
68 | + retornaJSON ( $dados ); | ||
69 | + exit (); | ||
70 | + break; | ||
71 | + case "LISTA" : | ||
72 | + $dados = pegaDados("SELECT id_atlas, id_prancha, titulo_prancha, ordem_prancha, desc_prancha, h_prancha, icone_prancha, link_prancha, mapext_prancha, w_prancha from ".$esquemaadmin."i3geoadmin_atlasp WHERE id_atlas = '{$id_atlas}'", $dbh, false); | ||
73 | + if ($dados === false) { | ||
74 | + $dbhw = null; | ||
75 | + $dbh = null; | ||
76 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados tabela de pranchas" ); | ||
77 | + exit (); | ||
78 | + } | ||
79 | + $dbhw = null; | ||
80 | + $dbh = null; | ||
81 | + retornaJSON ( array("dados"=>$dados) ); | ||
82 | + break; | ||
83 | + case "EXCLUIR" : | ||
84 | + $temas = pegaDados("SELECT id_tema from ".$esquemaadmin."i3geoadmin_atlast where id_prancha = '$id_prancha'"); | ||
85 | + if(count($temas) > 0){ | ||
86 | + header ( "HTTP/1.1 500 erro ao excluir. Exclua os temas da prancha primeiro" ); | ||
87 | + exit (); | ||
88 | + } | ||
89 | + $retorna = excluir ( $id_prancha, $dbhw ); | ||
90 | + $dbhw = null; | ||
91 | + $dbh = null; | ||
92 | + if ($retorna === false) { | ||
93 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
94 | + exit (); | ||
95 | + } | ||
96 | + retornaJSON ( $id_prancha ); | ||
97 | + exit (); | ||
98 | + break; | ||
99 | +} | ||
100 | +cpjson ( $retorno ); | ||
101 | + | ||
102 | +function adicionar( $id_atlas, $titulo_prancha, $ordem_prancha, $desc_prancha, $h_prancha, $icone_prancha, $link_prancha, $mapext_prancha, $w_prancha, $dbhw) { | ||
103 | + global $esquemaadmin; | ||
104 | + try { | ||
105 | + $dataCol = array( | ||
106 | + "ordem_prancha"=>0, | ||
107 | + "mapext_prancha"=>'', | ||
108 | + "desc_prancha"=>'', | ||
109 | + "h_prancha"=>$h_prancha == "" ? 0 : $h_prancha, | ||
110 | + "w_prancha"=>$w_prancha == "" ? 0 : $w_prancha, | ||
111 | + "icone_prancha"=>'', | ||
112 | + "link_prancha"=>'', | ||
113 | + "titulo_prancha"=>'', | ||
114 | + "id_atlas"=>$id_atlas | ||
115 | + ); | ||
116 | + $id_prancha = i3GeoAdminInsertUnico($dbhw,"i3geoadmin_atlasp",$dataCol,"titulo_prancha","id_prancha"); | ||
117 | + $retorna = alterar ( $id_atlas, $id_prancha, $titulo_prancha, $ordem_prancha, $desc_prancha, $h_prancha, $icone_prancha, $link_prancha, $mapext_prancha, $w_prancha, $dbhw ); | ||
118 | + | ||
119 | + return $retorna; | ||
120 | + } catch ( PDOException $e ) { | ||
121 | + return false; | ||
122 | + } | ||
123 | +} | ||
124 | +// $papeis deve ser um array | ||
125 | +function alterar($id_atlas, $id_prancha, $titulo_prancha, $ordem_prancha, $desc_prancha, $h_prancha, $icone_prancha, $link_prancha, $mapext_prancha, $w_prancha, $dbhw) { | ||
126 | + global $esquemaadmin; | ||
127 | + if($convUTF){ | ||
128 | + $desc_prancha = utf8_encode($desc_prancha); | ||
129 | + $titulo_prancha = utf8_encode($titulo_prancha); | ||
130 | + } | ||
131 | + $dataCol = array( | ||
132 | + "ordem_prancha"=>$ordem_prancha, | ||
133 | + "mapext_prancha"=>$mapext_prancha, | ||
134 | + "desc_prancha"=>$desc_prancha, | ||
135 | + "h_prancha"=>$h_prancha == "" ? 0 : $h_prancha, | ||
136 | + "w_prancha"=>$w_prancha == "" ? 0 : $w_prancha, | ||
137 | + "icone_prancha"=>$icone_prancha, | ||
138 | + "link_prancha"=>$link_prancha, | ||
139 | + "titulo_prancha"=>$titulo_prancha | ||
140 | + ); | ||
141 | + $resultado = i3GeoAdminUpdate ( $dbhw, "i3geoadmin_atlasp", $dataCol, "WHERE id_prancha = $id_prancha AND id_atlas = $id_atlas" ); | ||
142 | + if ($resultado === false) { | ||
143 | + return false; | ||
144 | + } | ||
145 | + return $id_atlas; | ||
146 | +} | ||
147 | +function excluir($id_prancha, $dbhw) { | ||
148 | + global $esquemaadmin; | ||
149 | + $resultado = i3GeoAdminExclui ( $esquemaadmin . "i3geoadmin_atlasp", "id_prancha", $id_prancha, $dbhw, false ); | ||
150 | + if ($resultado === false) { | ||
151 | + return false; | ||
152 | + } | ||
153 | + return $resultado; | ||
154 | +} | ||
155 | +?> |
@@ -0,0 +1,204 @@ | @@ -0,0 +1,204 @@ | ||
1 | +/* | ||
2 | +Licenca: | ||
3 | + | ||
4 | +GPL2 | ||
5 | + | ||
6 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
7 | + | ||
8 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
9 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
10 | + | ||
11 | +Este programa é software livre; você pode redistribuí-lo | ||
12 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
13 | +GNU conforme publicada pela Free Software Foundation; | ||
14 | + | ||
15 | +Este programa é distribuído na expectativa de que seja útil, | ||
16 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
17 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
18 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
19 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
20 | +GNU junto com este programa; se não, escreva para a | ||
21 | +Free Software Foundation, Inc., no endereço | ||
22 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
23 | + | ||
24 | + */ | ||
25 | +i3GEOadmin.prancha = { | ||
26 | + id_atlas: "", | ||
27 | + //variavel global indicando o elemento que recebera a lista de menus | ||
28 | + ondeLista: "", | ||
29 | + //conteudo html do formulario de adicao de operacao | ||
30 | + formAdiciona: "", | ||
31 | + init: function(onde){ | ||
32 | + i3GEOadmin.prancha.ondeLista = onde; | ||
33 | + i3GEOadmin.prancha.lista(); | ||
34 | + }, | ||
35 | + /* | ||
36 | +Function: lista | ||
37 | + | ||
38 | +Obtém a lista | ||
39 | + */ | ||
40 | + lista: function(){ | ||
41 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.prancha.ondeLista); | ||
42 | + $.post( | ||
43 | + "exec.php?funcao=lista&id_atlas=" + i3GEOadmin.prancha.id_atlas | ||
44 | + ) | ||
45 | + .done( | ||
46 | + function(data, status){ | ||
47 | + //valor do filtro atual | ||
48 | + var filtro = i3GEOadmin.core.valorFiltro(); | ||
49 | + //objeto json com os dados viondos do banco | ||
50 | + var json = jQuery.parseJSON(data); | ||
51 | + //template do form de cada operacao | ||
52 | + var templateLista = $("#templateLista").html(); | ||
53 | + //lista todas as menus | ||
54 | + var html = Mustache.to_html( | ||
55 | + "{{#data}}" + templateLista + "{{/data}}", | ||
56 | + $.extend( | ||
57 | + {}, | ||
58 | + i3GEOadmin.prancha.dicionario, | ||
59 | + { | ||
60 | + "data": json["dados"], | ||
61 | + "onExcluir": "i3GEOadmin.prancha.excluirDialogo",//funcao | ||
62 | + "onSalvar": "i3GEOadmin.prancha.salvarDialogo"//funcao | ||
63 | + } | ||
64 | + ) | ||
65 | + ); | ||
66 | + i3GEOadmin.prancha.ondeLista.html(html); | ||
67 | + //filtro | ||
68 | + html = Mustache.to_html( | ||
69 | + "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", | ||
70 | + {"data":json["dados"]} | ||
71 | + ); | ||
72 | + $("#filtro").html("<option value='' >Todos</option>" + html); | ||
73 | + $("#filtro").combobox(); | ||
74 | + if(filtro != ""){ | ||
75 | + i3GEOadmin.core.defineFiltro(filtro); | ||
76 | + i3GEOadmin.core.filtra(i3GEOadmin.prancha.pegaFiltro()); | ||
77 | + } | ||
78 | + //monta um template para o modal de inclusao de novo usuario | ||
79 | + if(i3GEOadmin.prancha.formAdiciona == ""){ | ||
80 | + html = Mustache.to_html( | ||
81 | + $("#templateLista").html(), | ||
82 | + $.extend( | ||
83 | + {}, | ||
84 | + i3GEOadmin.prancha.dicionario, | ||
85 | + { | ||
86 | + "id_prancha": "modal", | ||
87 | + "pranchas": "", | ||
88 | + "excluir": i3GEOadmin.prancha.dicionario.cancelar, | ||
89 | + "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao | ||
90 | + "onSalvar": "i3GEOadmin.prancha.adiciona",//funcao | ||
91 | + "editarTema": "" | ||
92 | + } | ||
93 | + ) | ||
94 | + ); | ||
95 | + i3GEOadmin.prancha.formAdiciona = html; | ||
96 | + } | ||
97 | + $.material.init(); | ||
98 | + } | ||
99 | + ) | ||
100 | + .fail(function(data){ | ||
101 | + i3GEOadmin.prancha.ondeLista.html(""); | ||
102 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
103 | + }); | ||
104 | + }, | ||
105 | + adicionaDialogo: function(){ | ||
106 | + i3GEOadmin.core.abreModalGeral(i3GEOadmin.prancha.formAdiciona); | ||
107 | + }, | ||
108 | +// os parametros sao obtidos do formulario aberto do modal | ||
109 | + adiciona: function(){ | ||
110 | + var parametros = $("#form-modal form").serialize(); | ||
111 | + i3GEOadmin.core.fechaModalGeral(); | ||
112 | + i3GEOadmin.core.modalAguarde(true); | ||
113 | + $.post( | ||
114 | + "exec.php?funcao=adicionar", | ||
115 | + parametros + "&id_atlas=" + i3GEOadmin.prancha.id_atlas | ||
116 | + ) | ||
117 | + .done( | ||
118 | + function(data, status){ | ||
119 | + i3GEOadmin.core.modalAguarde(false); | ||
120 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.prancha.ondeLista); | ||
121 | + i3GEOadmin.prancha.lista(); | ||
122 | + } | ||
123 | + ) | ||
124 | + .fail( | ||
125 | + function(data){ | ||
126 | + i3GEOadmin.core.modalAguarde(false); | ||
127 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
128 | + } | ||
129 | + ); | ||
130 | + }, | ||
131 | + excluirDialogo: function(id){ | ||
132 | + var hash = { | ||
133 | + "mensagem": i3GEOadmin.prancha.dicionario.confirma, | ||
134 | + "onBotao1": "i3GEOadmin.prancha.excluir('"+id+"')", | ||
135 | + "botao1": i3GEOadmin.prancha.dicionario.sim, | ||
136 | + "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | ||
137 | + "botao2": i3GEOadmin.prancha.dicionario.nao | ||
138 | + }; | ||
139 | + i3GEOadmin.core.abreModalConfirma(hash); | ||
140 | + }, | ||
141 | + excluir: function(id){ | ||
142 | + i3GEOadmin.core.modalAguarde(true); | ||
143 | + $.post( | ||
144 | + "exec.php?funcao=excluir", | ||
145 | + "id_prancha=" + id + "&id_atlas=" + i3GEOadmin.prancha.id_atlas | ||
146 | + ) | ||
147 | + .done( | ||
148 | + function(data, status){ | ||
149 | + i3GEOadmin.core.modalAguarde(false); | ||
150 | + var json = jQuery.parseJSON(data)*1; | ||
151 | + $("#form-" + json).remove(); | ||
152 | + } | ||
153 | + ) | ||
154 | + .fail( | ||
155 | + function(data){ | ||
156 | + i3GEOadmin.core.modalAguarde(false); | ||
157 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
158 | + } | ||
159 | + ); | ||
160 | + }, | ||
161 | + salvarDialogo: function(id){ | ||
162 | + var hash = { | ||
163 | + "mensagem": i3GEOadmin.prancha.dicionario.confirma, | ||
164 | + "onBotao1": "i3GEOadmin.prancha.salvar('"+id+"')", | ||
165 | + "botao1": i3GEOadmin.prancha.dicionario.sim, | ||
166 | + "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | ||
167 | + "botao2": i3GEOadmin.prancha.dicionario.nao | ||
168 | + }; | ||
169 | + i3GEOadmin.core.abreModalConfirma(hash); | ||
170 | + }, | ||
171 | + salvar: function(id){ | ||
172 | + var parametros = $("#form-" + id + " form").serialize(); | ||
173 | + i3GEOadmin.core.fechaModalGeral(); | ||
174 | + i3GEOadmin.core.modalAguarde(true); | ||
175 | + $.post( | ||
176 | + "exec.php?funcao=alterar", | ||
177 | + "id_prancha="+ id + "&"+parametros + "&id_atlas=" + i3GEOadmin.prancha.id_atlas | ||
178 | + ) | ||
179 | + .done( | ||
180 | + function(data, status){ | ||
181 | + i3GEOadmin.core.modalAguarde(false); | ||
182 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.prancha.ondeLista); | ||
183 | + i3GEOadmin.prancha.lista(); | ||
184 | + } | ||
185 | + ) | ||
186 | + .fail( | ||
187 | + function(data){ | ||
188 | + i3GEOadmin.core.modalAguarde(false); | ||
189 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
190 | + } | ||
191 | + ); | ||
192 | + }, | ||
193 | + editarTemas: function(id_atlas, id_prancha,titulo_prancha){ | ||
194 | + //muda a url para que o usuario possa voltar pelo botao do navegador | ||
195 | + var u = window.location.origin + window.location.pathname + "?id_atlas=" + id_atlas + "&id_filtro=" + id_prancha; | ||
196 | + window.history.replaceState(null,null,u); | ||
197 | + //abre a pagina de edicao | ||
198 | + window.location.href = "temas/index.php?id_prancha=" + id_prancha + "&titulo_prancha=" + titulo_prancha + "&id_atlas=" + id_atlas; | ||
199 | + }, | ||
200 | + addInput: function(id,valor){ | ||
201 | + var i = $("#"+id); | ||
202 | + $(i.val(i.val() + ' ' + valor)); | ||
203 | + } | ||
204 | +}; | ||
0 | \ No newline at end of file | 205 | \ No newline at end of file |
@@ -0,0 +1,193 @@ | @@ -0,0 +1,193 @@ | ||
1 | +<?php | ||
2 | +define ( ONDEI3GEO, "../../../.." ); | ||
3 | +include (dirname ( __FILE__ ) . "/../../../../ms_configura.php"); | ||
4 | +error_reporting ( 0 ); | ||
5 | +include "../../../head.php"; | ||
6 | +$id_atlas = filter_var($_GET["id_atlas"], FILTER_SANITIZE_NUMBER_INT); | ||
7 | +$titulo_atlas = filter_var($_GET["titulo_atlas"], FILTER_SANITIZE_STRING); | ||
8 | +?> | ||
9 | +<div class="container-fluid"> | ||
10 | + <div class="row"> | ||
11 | + <ol class="breadcrumb"> | ||
12 | + <li><a href="../../../init/index.php">i3Geo</a></li> | ||
13 | + <li><a href="../../../index.php">Admin</a></li> | ||
14 | + <li>Catálogo</li> | ||
15 | + <li><a href="../index.php?id_filtro=<?php echo $id_atlas; ?>">Atlas - <?php echo $titulo_atlas; ?></a></li> | ||
16 | + <li class="active">Pranchas</li> | ||
17 | + </ol> | ||
18 | + </div> | ||
19 | +</div> | ||
20 | +<div class="container"> | ||
21 | + <div class="row center-block"> | ||
22 | + <div class="col-md-12"> | ||
23 | + <div class="well hidden" id="titulo"> | ||
24 | + <button data-toggle="modal" data-target="#ajudaPrincipal" | ||
25 | + class="btn btn-primary btn-fab btn-fab-mini pull-right"> | ||
26 | + <i class="material-icons">help</i> | ||
27 | + </button> | ||
28 | + <h3>{{{txtTitulo}}}</h3> | ||
29 | + <!--<h4>{{{txtDesc}}}</h4>--> | ||
30 | + <!-- aqui entra o filtro --> | ||
31 | + <div class="form-group"> | ||
32 | + <label class="control-label">{{{filtro}}}</label> | ||
33 | + <select onchange="i3GEOadmin.core.filtra(this)" id="filtro" class="form-control input-lg"> | ||
34 | + </select> | ||
35 | + </div> | ||
36 | + <div class="row pull-right"> | ||
37 | + <a onclick="i3GEOadmin.prancha.adicionaDialogo();" href="javascript:void(0)" class="btn btn-primary" role="button">{{{adicionar}}}</a> | ||
38 | + </div> | ||
39 | + <div class="clearfix"></div> | ||
40 | + <div id="ajudaPrincipal" class="modal fade" tabindex="-1"> | ||
41 | + <div class="modal-dialog"> | ||
42 | + <div class="modal-content"> | ||
43 | + <div class="modal-body"> | ||
44 | + <p>{{{txtAjuda}}}</p> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + </div> | ||
50 | + <div class="well hidden"> | ||
51 | + <div id="corpo"> | ||
52 | + </div> | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | +</div> | ||
57 | +<script id="templateFiltro" type="x-tmpl-mustache"> | ||
58 | +<option value="form-{{id_prancha}}">{{{titulo_prancha}}}</option> | ||
59 | +</script> | ||
60 | +<script id="templateLista" type="x-tmpl-mustache"> | ||
61 | +<div class="panel panel-default" id="form-{{id_prancha}}"> | ||
62 | + <div class="panel-heading" role="tab"> | ||
63 | + <h3 class="panel-title"> | ||
64 | + <a class="collapsed in" role="button" data-toggle="collapse" href="#body-form-{{id_prancha}}" | ||
65 | + aria-expanded="false" aria-controls="#body-form-{{id_prancha}}"> {{{titulo_prancha}}} </a> | ||
66 | + </h3> | ||
67 | + </div> | ||
68 | + <div class="panel-body panel-collapse collapse" id="body-form-{{id_prancha}}"> | ||
69 | + <form style="" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" action="" > | ||
70 | + <div class="row"> | ||
71 | + <div class="col-md-12"> | ||
72 | + <div class="form-group form-group-lg"> | ||
73 | + <label class="col-md-4 control-label" for="titulo_prancha" >{{{titulo}}}</label> | ||
74 | + <div class="col-md-8"> | ||
75 | + <input type="text" value="{{{titulo_prancha}}}" class="form-control" name="titulo_prancha" required> | ||
76 | + </div> | ||
77 | + </div> | ||
78 | + </div> | ||
79 | + <div class="col-md-12"> | ||
80 | + <div class="form-group form-group-lg"> | ||
81 | + <label class="col-md-4 control-label" for="desc_prancha" >{{{descricao}}}</label> | ||
82 | + <div class="col-md-8"> | ||
83 | + <input type="text" value="{{{desc_prancha}}}" class="form-control" name="desc_prancha" required> | ||
84 | + </div> | ||
85 | + </div> | ||
86 | + </div> | ||
87 | + <div class="col-md-12"> | ||
88 | + <div class="form-group form-group-lg"> | ||
89 | + <label class="col-md-4 control-label" for="link_prancha" >{{{linkTxt}}}</label> | ||
90 | + <div class="col-md-8"> | ||
91 | + <input type="text" value="{{{link_prancha}}}" class="form-control" name="link_prancha" required> | ||
92 | + </div> | ||
93 | + </div> | ||
94 | + </div> | ||
95 | + <div class="col-md-12"> | ||
96 | + <div class="form-group form-group-lg"> | ||
97 | + <label class="col-md-4 control-label" for="ordem_prancha" >{{{ordem}}}</label> | ||
98 | + <div class="col-md-8"> | ||
99 | + <input type="text" value="{{{ordem_prancha}}}" class="form-control" name="ordem_prancha" required> | ||
100 | + </div> | ||
101 | + </div> | ||
102 | + </div> | ||
103 | + <div class="col-md-12"> | ||
104 | + <div class="form-group form-group-lg"> | ||
105 | + <label class="col-md-4 control-label" for="h_prancha" >{{{altura}}}</label> | ||
106 | + <div class="col-md-8"> | ||
107 | + <input type="text" value="{{{h_prancha}}}" class="form-control" name="h_prancha" required> | ||
108 | + </div> | ||
109 | + </div> | ||
110 | + </div> | ||
111 | + <div class="col-md-12"> | ||
112 | + <div class="form-group form-group-lg"> | ||
113 | + <label class="col-md-4 control-label" for="w_prancha" >{{{largura}}}</label> | ||
114 | + <div class="col-md-8"> | ||
115 | + <input type="text" value="{{{w_prancha}}}" class="form-control" name="w_prancha" required> | ||
116 | + </div> | ||
117 | + </div> | ||
118 | + </div> | ||
119 | + <div class="col-md-12"> | ||
120 | + <div class="form-group form-group-lg"> | ||
121 | + <label class="col-md-4 control-label" for="icone_prancha" >{{{icone}}}</label> | ||
122 | + <div class="col-md-8"> | ||
123 | + <input type="text" value="{{{icone_prancha}}}" class="form-control" name="icone_prancha" required> | ||
124 | + </div> | ||
125 | + </div> | ||
126 | + </div> | ||
127 | + <div class="col-md-12"> | ||
128 | + <div class="form-group form-group-lg"> | ||
129 | + <label class="col-md-4 control-label" for="mapext_prancha" >{{{extGeo}}}</label> | ||
130 | + <div class="col-md-8"> | ||
131 | + <input type="text" value="{{{mapext_prancha}}}" class="form-control" name="mapext_prancha" required> | ||
132 | + </div> | ||
133 | + </div> | ||
134 | + </div> | ||
135 | + | ||
136 | + </div> | ||
137 | + </form> | ||
138 | + <div class="pull-right"> | ||
139 | + <a href="javascript:void(0)" onclick="i3GEOadmin.prancha.editarTemas('{{id_atlas}}','{{id_prancha}}','{{{titulo_prancha}}}')" class="btn btn-default" role="button">{{{editarTema}}}</a> | ||
140 | + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_prancha}}')" class="btn btn-danger" role="button">{{excluir}}</a> | ||
141 | + <a href="javascript:void(0)" onclick="{{onSalvar}}('{{id_prancha}}')" class="btn btn-primary" role="button">{{salvar}}</a> | ||
142 | + </div> | ||
143 | + </div> | ||
144 | +</div> | ||
145 | +</script> | ||
146 | +<script type="text/javascript" src="index.js"></script> | ||
147 | +<script type="text/javascript" src="../../../dicionario/prancha.js"></script> | ||
148 | +<script> | ||
149 | + $(document).ready(function(){ | ||
150 | + //vem de admin1/index.js | ||
151 | + iniciaMenuPrincipal(); | ||
152 | + $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { | ||
153 | + event.preventDefault(); | ||
154 | + event.stopPropagation(); | ||
155 | + $(this).parent().siblings().removeClass('open'); | ||
156 | + $(this).parent().toggleClass('open'); | ||
157 | + }); | ||
158 | + //traducao | ||
159 | + var t = $("#titulo"); | ||
160 | + //complementa dicionario | ||
161 | + i3GEOadmin.prancha.dicionario.adicionar = i3GEOadmin.core.dicionario.adicionar; | ||
162 | + i3GEOadmin.prancha.dicionario.filtro = i3GEOadmin.core.dicionario.filtro; | ||
163 | + i3GEOadmin.prancha.dicionario.excluir = i3GEOadmin.core.dicionario.excluir; | ||
164 | + i3GEOadmin.prancha.dicionario.salvar = i3GEOadmin.core.dicionario.salva; | ||
165 | + i3GEOadmin.prancha.dicionario.cancelar = i3GEOadmin.core.dicionario.cancelar; | ||
166 | + i3GEOadmin.prancha.dicionario.confirma = i3GEOadmin.core.dicionario.confirma; | ||
167 | + i3GEOadmin.prancha.dicionario.nome = i3GEOadmin.core.dicionario.nome; | ||
168 | + i3GEOadmin.prancha.dicionario.tipo = i3GEOadmin.core.dicionario.tipo; | ||
169 | + i3GEOadmin.prancha.dicionario.descricao = i3GEOadmin.core.dicionario.descricao; | ||
170 | + i3GEOadmin.prancha.dicionario.sim = i3GEOadmin.core.dicionario.sim; | ||
171 | + i3GEOadmin.prancha.dicionario.nao = i3GEOadmin.core.dicionario.nao; | ||
172 | + | ||
173 | + i3GEOadmin.core.dicionario = null; | ||
174 | + | ||
175 | + i3GEOadmin.prancha.dicionario = i3GEO.idioma.objetoIdioma(i3GEOadmin.prancha.dicionario); | ||
176 | + | ||
177 | + t.html( | ||
178 | + Mustache.to_html( | ||
179 | + t.html(), | ||
180 | + i3GEOadmin.prancha.dicionario | ||
181 | + ) | ||
182 | + ); | ||
183 | + $.material.init(); | ||
184 | + i3GEOadmin.prancha.id_atlas = <?php echo $id_atlas; ?>; | ||
185 | + var inicia = function() { | ||
186 | + $(".hidden").removeClass('hidden'); | ||
187 | + i3GEOadmin.prancha.init($("#corpo")); | ||
188 | + }; | ||
189 | + i3GEO.login.verificaOperacao("admin/html/prancha",i3GEO.configura.locaplic, inicia, "sessao"); | ||
190 | + }); | ||
191 | +</script> | ||
192 | +</body> | ||
193 | +</html> |
@@ -0,0 +1,149 @@ | @@ -0,0 +1,149 @@ | ||
1 | +<?php | ||
2 | +/* | ||
3 | + * Licenca: | ||
4 | + * | ||
5 | + * GPL2 | ||
6 | + * | ||
7 | + * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
8 | + * | ||
9 | + * Direitos Autorais Reservados (c) 2006 Edmar Moretti | ||
10 | + * Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
11 | + * | ||
12 | + * Este programa é software livre; você pode redistribuí-lo | ||
13 | + * e/ou modificá-lo sob os termos da Licença Pública Geral | ||
14 | + * GNU conforme publicada pela Free Software Foundation; | ||
15 | + * | ||
16 | + * Este programa é distribuído na expectativa de que seja útil, | ||
17 | + * porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
18 | + * de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
19 | + * Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
20 | + * Você deve ter recebido uma copia da Licença Pública Geral do | ||
21 | + * GNU junto com este programa; se não, escreva para a | ||
22 | + * Free Software Foundation, Inc., no endereço | ||
23 | + * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
24 | + */ | ||
25 | +error_reporting ( 0 ); | ||
26 | +// | ||
27 | +// pega as variaveis passadas com get ou post | ||
28 | +// | ||
29 | + | ||
30 | +include_once (dirname ( __FILE__ ) . "/../../../../../admin/php/login.php"); | ||
31 | +$funcoesEdicao = array ( | ||
32 | + "ADICIONAR", | ||
33 | + "ALTERAR", | ||
34 | + "EXCLUIR" | ||
35 | +); | ||
36 | +if (in_array ( strtoupper ( $funcao ), $funcoesEdicao )) { | ||
37 | + if (verificaOperacaoSessao ( "admin/html/atlas" ) === false) { | ||
38 | + header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" ); | ||
39 | + exit (); | ||
40 | + } | ||
41 | +} | ||
42 | +include (dirname ( __FILE__ ) . "/../../../../../admin/php/conexao.php"); | ||
43 | + | ||
44 | +$funcao = strtoupper ( $funcao ); | ||
45 | +switch ($funcao) { | ||
46 | + case "ADICIONAR" : | ||
47 | + $novo = adicionar( $id_prancha, $ordem_tema, $ligado_tema, $codigo_tema, $dbhw ); | ||
48 | + if ($novo === false) { | ||
49 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
50 | + exit (); | ||
51 | + } | ||
52 | + exit (); | ||
53 | + break; | ||
54 | + case "ALTERAR" : | ||
55 | + $novo = alterar ( $id_tema, $ordem_tema, $ligado_tema, $codigo_tema, $dbhw ); | ||
56 | + if ($novo === false) { | ||
57 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
58 | + exit (); | ||
59 | + } | ||
60 | + $dados = pegaDados ( "SELECT id_tema from ".$esquemaadmin."i3geoadmin_atlast WHERE id_tema = $id_tema", $dbh, false ); | ||
61 | + | ||
62 | + if ($dados === false) { | ||
63 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
64 | + exit (); | ||
65 | + } | ||
66 | + $dbhw = null; | ||
67 | + $dbh = null; | ||
68 | + retornaJSON ( $dados ); | ||
69 | + exit (); | ||
70 | + break; | ||
71 | + case "LISTA" : | ||
72 | + $dados = pegaDados("SELECT id_tema, ordem_tema, codigo_tema, ligado_tema from ".$esquemaadmin."i3geoadmin_atlast WHERE id_prancha = '{$id_prancha}'", $dbh, false); | ||
73 | + if ($dados === false) { | ||
74 | + $dbhw = null; | ||
75 | + $dbh = null; | ||
76 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados tabela de temas de uma prancha" ); | ||
77 | + exit (); | ||
78 | + } | ||
79 | + $dbhw = null; | ||
80 | + $dbh = null; | ||
81 | + //pega a lista de temas | ||
82 | + include("../../../../../admin/php/classe_arvore.php"); | ||
83 | + $arvore = new Arvore($locaplic); | ||
84 | + $temas = $arvore->pegaTodosTemas(true); | ||
85 | + retornaJSON ( array("dados"=>$dados, "temas"=>$temas) ); | ||
86 | + break; | ||
87 | + case "EXCLUIR" : | ||
88 | + $retorna = excluir ( $id_tema, $dbhw ); | ||
89 | + $dbhw = null; | ||
90 | + $dbh = null; | ||
91 | + if ($retorna === false) { | ||
92 | + header ( "HTTP/1.1 500 erro ao consultar banco de dados" ); | ||
93 | + exit (); | ||
94 | + } | ||
95 | + retornaJSON ( $id_tema ); | ||
96 | + exit (); | ||
97 | + break; | ||
98 | +} | ||
99 | +cpjson ( $retorno ); | ||
100 | + | ||
101 | +function adicionar( $id_prancha, $ordem_tema, $ligado_tema, $codigo_tema, $dbhw ) { | ||
102 | + global $esquemaadmin; | ||
103 | + try { | ||
104 | + $dataCol = array( | ||
105 | + "ordem_tema"=>0, | ||
106 | + "codigo_tema"=>"", | ||
107 | + "ligado_tema"=>"", | ||
108 | + "id_prancha"=>$id_prancha | ||
109 | + ); | ||
110 | + $id_tema = i3GeoAdminInsertUnico($dbhw,"i3geoadmin_atlast",$dataCol,"codigo_tema","id_tema"); | ||
111 | + $retorna = alterar ( $id_tema, $ordem_tema, $ligado_tema, $codigo_tema, $dbhw ); | ||
112 | + | ||
113 | + return $retorna; | ||
114 | + } catch ( PDOException $e ) { | ||
115 | + return false; | ||
116 | + } | ||
117 | +} | ||
118 | +// $papeis deve ser um array | ||
119 | +function alterar($id_tema, $ordem_tema, $ligado_tema, $codigo_tema, $dbhw) { | ||
120 | + global $esquemaadmin; | ||
121 | + //caso a atualizacao ocorra apos insert | ||
122 | + $dataCol = array( | ||
123 | + "ordem_tema"=>$ordem_tema, | ||
124 | + "codigo_tema"=>$codigo_tema, | ||
125 | + "ligado_tema"=>$ligado_tema | ||
126 | + ); | ||
127 | + //caso registro ja exista | ||
128 | + if($codigo_tema == ""){ | ||
129 | + $dataCol = array( | ||
130 | + "ordem_tema"=>$ordem_tema, | ||
131 | + "ligado_tema"=>$ligado_tema | ||
132 | + ); | ||
133 | + } | ||
134 | + | ||
135 | + $resultado = i3GeoAdminUpdate ( $dbhw, "i3geoadmin_atlast", $dataCol, "WHERE id_tema = $id_tema" ); | ||
136 | + if ($resultado === false) { | ||
137 | + return false; | ||
138 | + } | ||
139 | + return $id_tema; | ||
140 | +} | ||
141 | +function excluir($id_tema, $dbhw) { | ||
142 | + global $esquemaadmin; | ||
143 | + $resultado = i3GeoAdminExclui ( $esquemaadmin . "i3geoadmin_atlast", "id_tema", $id_tema, $dbhw, false ); | ||
144 | + if ($resultado === false) { | ||
145 | + return false; | ||
146 | + } | ||
147 | + return $resultado; | ||
148 | +} | ||
149 | +?> |
@@ -0,0 +1,229 @@ | @@ -0,0 +1,229 @@ | ||
1 | +/* | ||
2 | +Licenca: | ||
3 | + | ||
4 | +GPL2 | ||
5 | + | ||
6 | +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
7 | + | ||
8 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
9 | +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
10 | + | ||
11 | +Este programa é software livre; você pode redistribuí-lo | ||
12 | +e/ou modificá-lo sob os termos da Licença Pública Geral | ||
13 | +GNU conforme publicada pela Free Software Foundation; | ||
14 | + | ||
15 | +Este programa é distribuído na expectativa de que seja útil, | ||
16 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
17 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
18 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
19 | +Você deve ter recebido uma cópia da Licença Pública Geral do | ||
20 | +GNU junto com este programa; se não, escreva para a | ||
21 | +Free Software Foundation, Inc., no endereço | ||
22 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
23 | + | ||
24 | + */ | ||
25 | +i3GEOadmin.tema = { | ||
26 | + id_prancha: "", | ||
27 | + //variavel global indicando o elemento que recebera a lista de menus | ||
28 | + ondeLista: "", | ||
29 | + //conteudo html do formulario de adicao de operacao | ||
30 | + formAdiciona: "", | ||
31 | + init: function(onde){ | ||
32 | + i3GEOadmin.tema.ondeLista = onde; | ||
33 | + i3GEOadmin.tema.lista(); | ||
34 | + }, | ||
35 | + /* | ||
36 | +Function: lista | ||
37 | + | ||
38 | +Obtém a lista | ||
39 | + */ | ||
40 | + lista: function(){ | ||
41 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.tema.ondeLista); | ||
42 | + $.post( | ||
43 | + "exec.php?funcao=lista&id_prancha=" + i3GEOadmin.tema.id_prancha | ||
44 | + ) | ||
45 | + .done( | ||
46 | + function(data, status){ | ||
47 | + //valor do filtro atual | ||
48 | + var filtro = i3GEOadmin.core.valorFiltro(); | ||
49 | + //objeto json com os dados viondos do banco | ||
50 | + var json = jQuery.parseJSON(data); | ||
51 | + //template do form de cada operacao | ||
52 | + var templateLista = $("#templateLista").html(); | ||
53 | + var opcoesTema = '<option value="">---</option>' + Mustache.to_html( | ||
54 | + "{{#data}}" + $("#templateTemas").html() + "{{/data}}", | ||
55 | + {"data":json["temas"]} | ||
56 | + ); | ||
57 | + //lista | ||
58 | + var html = Mustache.to_html( | ||
59 | + "{{#data}}" + templateLista + "{{/data}}", | ||
60 | + $.extend( | ||
61 | + {}, | ||
62 | + i3GEOadmin.prancha.dicionario, | ||
63 | + { | ||
64 | + "data": json["dados"], | ||
65 | + "onExcluir": "i3GEOadmin.tema.excluirDialogo",//funcao | ||
66 | + "onSalvar": "i3GEOadmin.tema.salvarDialogo",//funcao | ||
67 | + "opcoesLigado": function(){ | ||
68 | + var hash = {}; | ||
69 | + hash["sim"] = i3GEOadmin.prancha.dicionario.sim; | ||
70 | + hash["nao"] = i3GEOadmin.prancha.dicionario.nao; | ||
71 | + hash[this.ligado_tema + "-sel"] = "selected"; | ||
72 | + return Mustache.to_html( | ||
73 | + $("#templateOpcoesLigado").html(), | ||
74 | + hash | ||
75 | + ); | ||
76 | + }, | ||
77 | + "opcoesTema": opcoesTema, | ||
78 | + "esconde": "hidden" | ||
79 | + } | ||
80 | + ) | ||
81 | + ); | ||
82 | + i3GEOadmin.tema.ondeLista.html(html); | ||
83 | + //filtro | ||
84 | + html = Mustache.to_html( | ||
85 | + "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", | ||
86 | + {"data":json["dados"]} | ||
87 | + ); | ||
88 | + $("#filtro").html("<option value='' >Todos</option>" + html); | ||
89 | + $("#filtro").combobox(); | ||
90 | + if(filtro != ""){ | ||
91 | + i3GEOadmin.core.defineFiltro(filtro); | ||
92 | + i3GEOadmin.core.filtra(i3GEOadmin.core.pegaFiltro()); | ||
93 | + } | ||
94 | + //monta um template para o modal de inclusao de novo usuario | ||
95 | + if(i3GEOadmin.tema.formAdiciona == ""){ | ||
96 | + html = Mustache.to_html( | ||
97 | + $("#templateLista").html(), | ||
98 | + $.extend( | ||
99 | + {}, | ||
100 | + i3GEOadmin.prancha.dicionario, | ||
101 | + { | ||
102 | + "id_tema": "modal", | ||
103 | + "excluir": i3GEOadmin.prancha.dicionario.cancelar, | ||
104 | + "onExcluir": "i3GEOadmin.core.fechaModalGeral",//funcao | ||
105 | + "onSalvar": "i3GEOadmin.tema.adiciona",//funcao | ||
106 | + "opcoesLigado": function(){ | ||
107 | + var hash = {}; | ||
108 | + hash["sim"] = i3GEOadmin.prancha.dicionario.sim; | ||
109 | + hash["nao"] = i3GEOadmin.prancha.dicionario.nao; | ||
110 | + return Mustache.to_html( | ||
111 | + $("#templateOpcoesLigado").html(), | ||
112 | + hash | ||
113 | + ); | ||
114 | + }, | ||
115 | + "opcoesTema": opcoesTema, | ||
116 | + "esconde": "" | ||
117 | + } | ||
118 | + ) | ||
119 | + ); | ||
120 | + i3GEOadmin.tema.formAdiciona = html; | ||
121 | + } | ||
122 | + $.material.init(); | ||
123 | + } | ||
124 | + ) | ||
125 | + .fail(function(data){ | ||
126 | + i3GEOadmin.tema.ondeLista.html(""); | ||
127 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
128 | + }); | ||
129 | + }, | ||
130 | + adicionaDialogo: function(){ | ||
131 | + i3GEOadmin.core.abreModalGeral(i3GEOadmin.tema.formAdiciona); | ||
132 | + }, | ||
133 | +// os parametros sao obtidos do formulario aberto do modal | ||
134 | + adiciona: function(){ | ||
135 | + var parametros = $("#form-modal form").serialize(); | ||
136 | + i3GEOadmin.core.fechaModalGeral(); | ||
137 | + i3GEOadmin.core.modalAguarde(true); | ||
138 | + $.post( | ||
139 | + "exec.php?funcao=adicionar", | ||
140 | + parametros + "&id_prancha=" + i3GEOadmin.tema.id_prancha | ||
141 | + ) | ||
142 | + .done( | ||
143 | + function(data, status){ | ||
144 | + i3GEOadmin.core.modalAguarde(false); | ||
145 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.tema.ondeLista); | ||
146 | + i3GEOadmin.tema.lista(); | ||
147 | + } | ||
148 | + ) | ||
149 | + .fail( | ||
150 | + function(data){ | ||
151 | + i3GEOadmin.core.modalAguarde(false); | ||
152 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
153 | + } | ||
154 | + ); | ||
155 | + }, | ||
156 | + excluirDialogo: function(id){ | ||
157 | + var hash = { | ||
158 | + "mensagem": i3GEOadmin.prancha.dicionario.confirma, | ||
159 | + "onBotao1": "i3GEOadmin.tema.excluir('"+id+"')", | ||
160 | + "botao1": i3GEOadmin.prancha.dicionario.sim, | ||
161 | + "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | ||
162 | + "botao2": i3GEOadmin.prancha.dicionario.nao | ||
163 | + }; | ||
164 | + i3GEOadmin.core.abreModalConfirma(hash); | ||
165 | + }, | ||
166 | + excluir: function(id){ | ||
167 | + i3GEOadmin.core.modalAguarde(true); | ||
168 | + $.post( | ||
169 | + "exec.php?funcao=excluir", | ||
170 | + "id_tema=" + id + "&id_prancha=" + i3GEOadmin.tema.id_prancha | ||
171 | + ) | ||
172 | + .done( | ||
173 | + function(data, status){ | ||
174 | + i3GEOadmin.core.modalAguarde(false); | ||
175 | + var json = jQuery.parseJSON(data)*1; | ||
176 | + $("#form-" + json).remove(); | ||
177 | + } | ||
178 | + ) | ||
179 | + .fail( | ||
180 | + function(data){ | ||
181 | + i3GEOadmin.core.modalAguarde(false); | ||
182 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
183 | + } | ||
184 | + ); | ||
185 | + }, | ||
186 | + salvarDialogo: function(id,codigo){ | ||
187 | + var hash = { | ||
188 | + "mensagem": i3GEOadmin.prancha.dicionario.confirma, | ||
189 | + "onBotao1": "i3GEOadmin.tema.salvar('"+id+"','"+codigo+"')", | ||
190 | + "botao1": i3GEOadmin.prancha.dicionario.sim, | ||
191 | + "onBotao2": "i3GEOadmin.core.fechaModalConfirma();", | ||
192 | + "botao2": i3GEOadmin.prancha.dicionario.nao | ||
193 | + }; | ||
194 | + i3GEOadmin.core.abreModalConfirma(hash); | ||
195 | + }, | ||
196 | + salvar: function(id,codigo){ | ||
197 | + var parametros = $("#form-" + id + " form").serialize(); | ||
198 | + i3GEOadmin.core.fechaModalGeral(); | ||
199 | + i3GEOadmin.core.modalAguarde(true); | ||
200 | + $.post( | ||
201 | + "exec.php?funcao=alterar", | ||
202 | + "id_tema="+ id + "&"+parametros + "&id_prancha=" + i3GEOadmin.tema.id_prancha + "&codigo_tema=" + codigo | ||
203 | + ) | ||
204 | + .done( | ||
205 | + function(data, status){ | ||
206 | + i3GEOadmin.core.modalAguarde(false); | ||
207 | + i3GEOadmin.core.iconeAguarde(i3GEOadmin.tema.ondeLista); | ||
208 | + i3GEOadmin.tema.lista(); | ||
209 | + } | ||
210 | + ) | ||
211 | + .fail( | ||
212 | + function(data){ | ||
213 | + i3GEOadmin.core.modalAguarde(false); | ||
214 | + i3GEOadmin.core.mostraErro(data.status + " " +data.statusText); | ||
215 | + } | ||
216 | + ); | ||
217 | + }, | ||
218 | + editarTemas: function(id_prancha, id_tema,titulo_tema){ | ||
219 | + //muda a url para que o usuario possa voltar pelo botao do navegador | ||
220 | + var u = window.location.origin + window.location.pathname + "?id_prancha=" + id_prancha + "&id_filtro=" + id_tema; | ||
221 | + window.history.replaceState(null,null,u); | ||
222 | + //abre a pagina de edicao | ||
223 | + window.location.href = "temas/index.php?id_tema=" + id_tema + "&titulo_tema=" + titulo_tema; | ||
224 | + }, | ||
225 | + addInput: function(id,valor){ | ||
226 | + var i = $("#"+id); | ||
227 | + $(i.val(i.val() + ' ' + valor)); | ||
228 | + } | ||
229 | +}; | ||
0 | \ No newline at end of file | 230 | \ No newline at end of file |
@@ -0,0 +1,152 @@ | @@ -0,0 +1,152 @@ | ||
1 | +<?php | ||
2 | +define ( ONDEI3GEO, "../../../../.." ); | ||
3 | +include (dirname ( __FILE__ ) . "/../../../../../ms_configura.php"); | ||
4 | +error_reporting ( 0 ); | ||
5 | +include "../../../../head.php"; | ||
6 | +$id_prancha = filter_var($_GET["id_prancha"], FILTER_SANITIZE_NUMBER_INT); | ||
7 | +$titulo_prancha = filter_var($_GET["titulo_prancha"], FILTER_SANITIZE_STRING); | ||
8 | +$id_atlas = filter_var($_GET["id_atlas"], FILTER_SANITIZE_NUMBER_INT); | ||
9 | +?> | ||
10 | +<div class="container-fluid"> | ||
11 | + <div class="row"> | ||
12 | + <ol class="breadcrumb"> | ||
13 | + <li><a href="../../../../init/index.php">i3Geo</a></li> | ||
14 | + <li><a href="../../../../index.php">Admin</a></li> | ||
15 | + <li>Catálogo</li> | ||
16 | + <li>Atlas</li> | ||
17 | + <li><a href="../index.php?id_atlas=<?php echo $id_atlas; ?>&id_filtro=<?php echo $id_prancha; ?>">Prancha - <?php echo $titulo_prancha; ?></a></li> | ||
18 | + <li class="active">Temas</li> | ||
19 | + </ol> | ||
20 | + </div> | ||
21 | +</div> | ||
22 | +<div class="container"> | ||
23 | + <div class="row center-block"> | ||
24 | + <div class="col-md-12"> | ||
25 | + <div class="well hidden" id="titulo"> | ||
26 | + <h3>{{{txtTituloTema}}}</h3> | ||
27 | + <h4>{{{txtDescTema}}}</h4> | ||
28 | + <!-- aqui entra o filtro --> | ||
29 | + <div class="form-group"> | ||
30 | + <label class="control-label">{{{filtro}}}</label> | ||
31 | + <select onchange="i3GEOadmin.core.filtra(this)" id="filtro" class="form-control input-lg"> | ||
32 | + </select> | ||
33 | + </div> | ||
34 | + <div class="row pull-right"> | ||
35 | + <a onclick="i3GEOadmin.tema.adicionaDialogo();" href="javascript:void(0)" class="btn btn-primary" role="button">{{{adicionar}}}</a> | ||
36 | + </div> | ||
37 | + <div class="clearfix"></div> | ||
38 | + </div> | ||
39 | + <div class="well hidden"> | ||
40 | + <div id="corpo"> | ||
41 | + </div> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | +</div> | ||
46 | +<script id="templateFiltro" type="x-tmpl-mustache"> | ||
47 | +<option value="form-{{id_tema}}">{{{codigo_tema}}}</option> | ||
48 | +</script> | ||
49 | +<script id="templateLista" type="x-tmpl-mustache"> | ||
50 | +<div class="panel panel-default" id="form-{{id_tema}}"> | ||
51 | + <div class="panel-heading" role="tab"> | ||
52 | + <h3 class="panel-title"> | ||
53 | + <a class="collapsed in" role="button" data-toggle="collapse" href="#body-form-{{id_tema}}" | ||
54 | + aria-expanded="false" aria-controls="#body-form-{{id_tema}}"> {{{codigo_tema}}} </a> | ||
55 | + </h3> | ||
56 | + </div> | ||
57 | + <div class="panel-body panel-collapse collapse" id="body-form-{{id_tema}}"> | ||
58 | + <form style="" onchange="this.style.boxShadow='2px 2px 5px 0 #009688';" class="form-horizontal" role="form" method="post" action="" > | ||
59 | + <div class="row"> | ||
60 | + <div class="col-md-12 {{esconde}}"> | ||
61 | + <div class="form-group form-group-lg"> | ||
62 | + <label class="col-md-4 control-label" for="codigo_tema" >{{{codigoTema}}}</label> | ||
63 | + <div class="col-md-8"> | ||
64 | + <select name="codigo_tema" class="form-control"> | ||
65 | + {{{opcoesTema}}} | ||
66 | + </select> | ||
67 | + </div> | ||
68 | + </div> | ||
69 | + </div> | ||
70 | + <div class="col-md-12"> | ||
71 | + <div class="form-group form-group-lg"> | ||
72 | + <label class="col-md-4 control-label" for="ordem_tema" >{{{ordem}}}</label> | ||
73 | + <div class="col-md-8"> | ||
74 | + <input type="text" value="{{{ordem_tema}}}" class="form-control" name="ordem_tema" required> | ||
75 | + </div> | ||
76 | + </div> | ||
77 | + </div> | ||
78 | + <div class="col-md-12"> | ||
79 | + <div class="form-group form-group-lg"> | ||
80 | + <label class="col-md-4 control-label" for="ligado_tema" >{{{temaVisivel}}}</label> | ||
81 | + <div class="col-md-8"> | ||
82 | + <select name="ligado_tema" class="form-control"> | ||
83 | + {{{opcoesLigado}}} | ||
84 | + </select> | ||
85 | + </div> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + </div> | ||
89 | + </form> | ||
90 | + <div class="pull-right"> | ||
91 | + <a href="javascript:void(0)" onclick="{{onExcluir}}('{{id_tema}}')" class="btn btn-danger" role="button">{{excluir}}</a> | ||
92 | + <a href="javascript:void(0)" onclick="{{onSalvar}}('{{id_tema}}','{{{codigo_tema}}}')" class="btn btn-primary" role="button">{{salvar}}</a> | ||
93 | + </div> | ||
94 | + </div> | ||
95 | +</div> | ||
96 | +</script> | ||
97 | +<script id="templateTemas" type="x-tmpl-mustache"> | ||
98 | + <option value="{{{codigo_tema}}}">{{{nome_tema}}} - {{{codigo_tema}}}</option> | ||
99 | +</script> | ||
100 | +<script id="templateOpcoesLigado" type="x-tmpl-mustache"> | ||
101 | + <option value="">---</option> | ||
102 | + <option {{SIM-sel}} value="SIM">{{{sim}}}</option> | ||
103 | + <option {{NAO-sel}} value="NAO">{{{nao}}}</option> | ||
104 | +</script> | ||
105 | +<script type="text/javascript" src="index.js"></script> | ||
106 | +<script type="text/javascript" src="../../../../dicionario/prancha.js"></script> | ||
107 | +<script> | ||
108 | + $(document).ready(function(){ | ||
109 | + //vem de admin1/index.js | ||
110 | + iniciaMenuPrincipal(); | ||
111 | + $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { | ||
112 | + event.preventDefault(); | ||
113 | + event.stopPropagation(); | ||
114 | + $(this).parent().siblings().removeClass('open'); | ||
115 | + $(this).parent().toggleClass('open'); | ||
116 | + }); | ||
117 | + //traducao | ||
118 | + var t = $("#titulo"); | ||
119 | + //complementa dicionario | ||
120 | + i3GEOadmin.prancha.dicionario.adicionar = i3GEOadmin.core.dicionario.adicionar; | ||
121 | + i3GEOadmin.prancha.dicionario.filtro = i3GEOadmin.core.dicionario.filtro; | ||
122 | + i3GEOadmin.prancha.dicionario.excluir = i3GEOadmin.core.dicionario.excluir; | ||
123 | + i3GEOadmin.prancha.dicionario.salvar = i3GEOadmin.core.dicionario.salva; | ||
124 | + i3GEOadmin.prancha.dicionario.cancelar = i3GEOadmin.core.dicionario.cancelar; | ||
125 | + i3GEOadmin.prancha.dicionario.confirma = i3GEOadmin.core.dicionario.confirma; | ||
126 | + i3GEOadmin.prancha.dicionario.nome = i3GEOadmin.core.dicionario.nome; | ||
127 | + i3GEOadmin.prancha.dicionario.tipo = i3GEOadmin.core.dicionario.tipo; | ||
128 | + i3GEOadmin.prancha.dicionario.descricao = i3GEOadmin.core.dicionario.descricao; | ||
129 | + i3GEOadmin.prancha.dicionario.sim = i3GEOadmin.core.dicionario.sim; | ||
130 | + i3GEOadmin.prancha.dicionario.nao = i3GEOadmin.core.dicionario.nao; | ||
131 | + | ||
132 | + i3GEOadmin.core.dicionario = null; | ||
133 | + | ||
134 | + i3GEOadmin.prancha.dicionario = i3GEO.idioma.objetoIdioma(i3GEOadmin.prancha.dicionario); | ||
135 | + | ||
136 | + t.html( | ||
137 | + Mustache.to_html( | ||
138 | + t.html(), | ||
139 | + i3GEOadmin.prancha.dicionario | ||
140 | + ) | ||
141 | + ); | ||
142 | + $.material.init(); | ||
143 | + i3GEOadmin.tema.id_prancha = <?php echo $id_prancha; ?>; | ||
144 | + var inicia = function() { | ||
145 | + $(".hidden").removeClass('hidden'); | ||
146 | + i3GEOadmin.tema.init($("#corpo")); | ||
147 | + }; | ||
148 | + i3GEO.login.verificaOperacao("admin/html/atlas",i3GEO.configura.locaplic, inicia, "sessao"); | ||
149 | + }); | ||
150 | +</script> | ||
151 | +</body> | ||
152 | +</html> |
@@ -0,0 +1,111 @@ | @@ -0,0 +1,111 @@ | ||
1 | +//+$trad(1,i3GEOadmin.principal.dicionario)+ | ||
2 | +if (typeof (i3GEOadmin.prancha) === 'undefined') { | ||
3 | + i3GEOadmin.prancha = {}; | ||
4 | +} | ||
5 | +i3GEOadmin.prancha.dicionario = { | ||
6 | + 'txtTitulo' : [ { | ||
7 | + pt : "Pranchas", | ||
8 | + en : "", | ||
9 | + es : "" | ||
10 | + } ], | ||
11 | + 'ajuda' : [ { | ||
12 | + pt : "Ajuda", | ||
13 | + en : "", | ||
14 | + es : "" | ||
15 | + } ], | ||
16 | + 'txtAjuda' : [ { | ||
17 | + pt : "Um atlas é composto de pranchas, que por sua vez, é uma composição de camadas. O usuário poderá escolher a prancha que deseja ver, cujos parâmetros são definidos aqui.", | ||
18 | + en : "", | ||
19 | + es : "" | ||
20 | + } ], | ||
21 | + 'editarTema' : [ { | ||
22 | + pt : "Editar temas", | ||
23 | + en : "", | ||
24 | + es : "" | ||
25 | + } ], | ||
26 | + 'codigoTema' : [ { | ||
27 | + pt : "Código do tema", | ||
28 | + en : "", | ||
29 | + es : "" | ||
30 | + } ], | ||
31 | + 'temaVisivel' : [ { | ||
32 | + pt : "Ligado (ao abrir a prancha, esse tema estará visível)?", | ||
33 | + en : "", | ||
34 | + es : "" | ||
35 | + } ], | ||
36 | + 'titulo' : [ { | ||
37 | + pt : "Título", | ||
38 | + en : "", | ||
39 | + es : "" | ||
40 | + } ], | ||
41 | + 'descricao' : [ { | ||
42 | + pt : "Descrição", | ||
43 | + en : "", | ||
44 | + es : "" | ||
45 | + } ], | ||
46 | + 'linkTxt' : [ { | ||
47 | + pt : "Link para o texto que será mostrado na inicialização", | ||
48 | + en : "", | ||
49 | + es : "" | ||
50 | + } ], | ||
51 | + 'largura' : [ { | ||
52 | + pt : "Largura da janela do texto inicial", | ||
53 | + en : "", | ||
54 | + es : "" | ||
55 | + } ], | ||
56 | + 'altura' : [ { | ||
57 | + pt : "Altura da janela do texto inicial", | ||
58 | + en : "", | ||
59 | + es : "" | ||
60 | + } ], | ||
61 | + 'icone' : [ { | ||
62 | + pt : "Ícone que será utilizado na apresentação da prancha", | ||
63 | + en : "", | ||
64 | + es : "" | ||
65 | + } ], | ||
66 | + 'extGeo' : [ { | ||
67 | + pt : "Extensão geográfica (xmin ymin xmax ymax)", | ||
68 | + en : "", | ||
69 | + es : "" | ||
70 | + } ], | ||
71 | + 'publicado' : [ { | ||
72 | + pt : "Publicado (os não publicados são mostrados apenas para os usuários administradores)?", | ||
73 | + en : "", | ||
74 | + es : "" | ||
75 | + } ], | ||
76 | + 'ordem' : [ { | ||
77 | + pt : "Ordem de apresentação", | ||
78 | + en : "", | ||
79 | + es : "" | ||
80 | + } ], | ||
81 | + 'txtTituloTema' : [ { | ||
82 | + pt : "Temas que compõem a prancha", | ||
83 | + en : "", | ||
84 | + es : "" | ||
85 | + } ], | ||
86 | + 'txtDescTema' : [ { | ||
87 | + pt : "Defina aqui quais os temas que serão mostrados na prancha e suas propriedades. Os temas são os mesmos disponíveis no catálogo de temas.", | ||
88 | + en : "", | ||
89 | + es : "" | ||
90 | + } ], | ||
91 | + '' : [ { | ||
92 | + pt : "", | ||
93 | + en : "", | ||
94 | + es : "" | ||
95 | + } ], | ||
96 | + '' : [ { | ||
97 | + pt : "", | ||
98 | + en : "", | ||
99 | + es : "" | ||
100 | + } ], | ||
101 | + '' : [ { | ||
102 | + pt : "", | ||
103 | + en : "", | ||
104 | + es : "" | ||
105 | + } ], | ||
106 | + '' : [ { | ||
107 | + pt : "", | ||
108 | + en : "", | ||
109 | + es : "" | ||
110 | + } ] | ||
111 | +}; |
admin1/index.php
@@ -8,7 +8,7 @@ include "head.php"; | @@ -8,7 +8,7 @@ include "head.php"; | ||
8 | <div class="container-fluid"> | 8 | <div class="container-fluid"> |
9 | <div class="row"> | 9 | <div class="row"> |
10 | <ol class="breadcrumb"> | 10 | <ol class="breadcrumb"> |
11 | - <li><a href="../init/index.php">i3Geo</a></li> | 11 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
12 | <li class="active">Admin</li> | 12 | <li class="active">Admin</li> |
13 | </ol> | 13 | </ol> |
14 | </div> | 14 | </div> |
@@ -27,9 +27,6 @@ include "head.php"; | @@ -27,9 +27,6 @@ include "head.php"; | ||
27 | <a href="http://moodle.gvsig-training.com/course/view.php?id=11" | 27 | <a href="http://moodle.gvsig-training.com/course/view.php?id=11" |
28 | target="_blank">{{manualAdmin}}</a> | 28 | target="_blank">{{manualAdmin}}</a> |
29 | </p> | 29 | </p> |
30 | - <div id="mensagemIE" style="display: none; position: relative"> | ||
31 | - {{{msgIe}}} | ||
32 | - </div> | ||
33 | <p> | 30 | <p> |
34 | {{msgSqlite}} <a | 31 | {{msgSqlite}} <a |
35 | href='../pacotes/phpliteadmin/phpliteadmin.php'>(link)</a>. | 32 | href='../pacotes/phpliteadmin/phpliteadmin.php'>(link)</a>. |
@@ -42,7 +39,6 @@ include "head.php"; | @@ -42,7 +39,6 @@ include "head.php"; | ||
42 | target="_new">{{{merBdMetaestat}}}</a><br> | 39 | target="_new">{{{merBdMetaestat}}}</a><br> |
43 | </p> | 40 | </p> |
44 | </div> | 41 | </div> |
45 | - <div class="alert alert-danger">{{atencao}}</div> | ||
46 | <div class="alert alert-warning">{{{leiaMe}}}</div> | 42 | <div class="alert alert-warning">{{{leiaMe}}}</div> |
47 | 43 | ||
48 | </div> | 44 | </div> |
admin1/js/core.js
@@ -68,6 +68,9 @@ $perfis = ""; | @@ -68,6 +68,9 @@ $perfis = ""; | ||
68 | //funcoes jquery + bootstrap | 68 | //funcoes jquery + bootstrap |
69 | 69 | ||
70 | i3GEOadmin.core = { | 70 | i3GEOadmin.core = { |
71 | + //valor do filtro utilizado ao iniciar a pagina | ||
72 | + //usado para enviar parametros pela URL ao iniciar uma pagina | ||
73 | + initFiltro: "", | ||
71 | mostraErro: function(erro){ | 74 | mostraErro: function(erro){ |
72 | var html = '<div class="alert alert-danger alert-dismissible" role="alert">' | 75 | var html = '<div class="alert alert-danger alert-dismissible" role="alert">' |
73 | + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' | 76 | + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' |
@@ -80,7 +83,6 @@ i3GEOadmin.core = { | @@ -80,7 +83,6 @@ i3GEOadmin.core = { | ||
80 | }, | 83 | }, |
81 | abreModal: function(id,conteudo){ | 84 | abreModal: function(id,conteudo){ |
82 | $("#"+id+" .modal-body").html(conteudo); | 85 | $("#"+id+" .modal-body").html(conteudo); |
83 | - console.info(id) | ||
84 | if($("#"+id).css("display") == "none"){ | 86 | if($("#"+id).css("display") == "none"){ |
85 | $("#"+id).modal("show"); | 87 | $("#"+id).modal("show"); |
86 | 88 | ||
@@ -124,7 +126,16 @@ i3GEOadmin.core = { | @@ -124,7 +126,16 @@ i3GEOadmin.core = { | ||
124 | return $i("filtro"); | 126 | return $i("filtro"); |
125 | }, | 127 | }, |
126 | valorFiltro: function(){ | 128 | valorFiltro: function(){ |
127 | - return i3GEOadmin.core.pegaFiltro().value; | 129 | + var v = ""; |
130 | + //verifica se o valor do filtro foi passado pela url | ||
131 | + if(i3GEOadmin.core.initFiltro != ""){ | ||
132 | + v = i3GEOadmin.core.initFiltro; | ||
133 | + i3GEOadmin.core.initFiltro = ""; | ||
134 | + } | ||
135 | + else{ | ||
136 | + v = i3GEOadmin.core.pegaFiltro().value; | ||
137 | + } | ||
138 | + return v; | ||
128 | }, | 139 | }, |
129 | defineFiltro: function(valor){ | 140 | defineFiltro: function(valor){ |
130 | i3GEOadmin.core.pegaFiltro().value = valor; | 141 | i3GEOadmin.core.pegaFiltro().value = valor; |
exemplos/index.php
@@ -64,7 +64,7 @@ include "../init/head.php"; | @@ -64,7 +64,7 @@ include "../init/head.php"; | ||
64 | <div class="container-fluid"> | 64 | <div class="container-fluid"> |
65 | <div class="row"> | 65 | <div class="row"> |
66 | <ol class="breadcrumb"> | 66 | <ol class="breadcrumb"> |
67 | - <li><a href="../init/index.php">i3Geo</a></li> | 67 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
68 | <li class="active">Exemplos</li> | 68 | <li class="active">Exemplos</li> |
69 | </ol> | 69 | </ol> |
70 | </div> | 70 | </div> |
init/index.js
1 | botoesIni = [ | 1 | botoesIni = [ |
2 | { | 2 | { |
3 | "img":"openlayers", | 3 | "img":"openlayers", |
4 | - "href": location.href.replace("init/index.php","") + customDir + "/black_ol.htm", | 4 | + "href": location.href.replace("init/index.php"+window.location.search,"") + customDir + "/black_ol.htm", |
5 | "titulo":$trad(4,g_traducao_init), | 5 | "titulo":$trad(4,g_traducao_init), |
6 | "subtitulo": $trad("4a",g_traducao_init), | 6 | "subtitulo": $trad("4a",g_traducao_init), |
7 | "fa": "map-o", | 7 | "fa": "map-o", |
8 | "target": "_blank" | 8 | "target": "_blank" |
9 | },{ | 9 | },{ |
10 | "img":"osm", | 10 | "img":"osm", |
11 | - "href": location.href.replace("init/index.php","") + customDir + "/black_osm.htm", | 11 | + "href": location.href.replace("init/index.php"+window.location.search,"") + customDir + "/black_osm.htm", |
12 | "titulo":$trad(23,g_traducao_init), | 12 | "titulo":$trad(23,g_traducao_init), |
13 | "subtitulo": $trad("23a",g_traducao_init), | 13 | "subtitulo": $trad("23a",g_traducao_init), |
14 | "fa": "map-o", | 14 | "fa": "map-o", |
15 | "target": "_blank" | 15 | "target": "_blank" |
16 | },{ | 16 | },{ |
17 | "img":"googlemaps", | 17 | "img":"googlemaps", |
18 | - "href": location.href.replace("init/index.php","") + customDir + "/black_gm.phtml", | 18 | + "href": location.href.replace("init/index.php"+window.location.search,"") + customDir + "/black_gm.phtml", |
19 | "titulo":$trad(6,g_traducao_init), | 19 | "titulo":$trad(6,g_traducao_init), |
20 | "subtitulo": $trad("6a",g_traducao_init), | 20 | "subtitulo": $trad("6a",g_traducao_init), |
21 | "fa": "map-o", | 21 | "fa": "map-o", |
@@ -29,14 +29,14 @@ botoesIni = [ | @@ -29,14 +29,14 @@ botoesIni = [ | ||
29 | "target": "_self" | 29 | "target": "_self" |
30 | },{ | 30 | },{ |
31 | "img":"googleearth", | 31 | "img":"googleearth", |
32 | - "href": location.href.replace("init/index.php","") + customDir + "/googleearth.phtml", | 32 | + "href": location.href.replace("init/index.php"+window.location.search,"") + customDir + "/googleearth.phtml", |
33 | "titulo":$trad(7,g_traducao_init), | 33 | "titulo":$trad(7,g_traducao_init), |
34 | "subtitulo": $trad("7a",g_traducao_init), | 34 | "subtitulo": $trad("7a",g_traducao_init), |
35 | "fa": "map-o", | 35 | "fa": "map-o", |
36 | "target": "_blank" | 36 | "target": "_blank" |
37 | },{ | 37 | },{ |
38 | "img":"cartogramas", | 38 | "img":"cartogramas", |
39 | - "href": location.href.replace("init/index.php","") + customDir + "/black_carto_ol.htm", | 39 | + "href": location.href.replace("init/index.php"+window.location.search,"") + customDir + "/black_carto_ol.htm", |
40 | "titulo":$trad(8,g_traducao_init), | 40 | "titulo":$trad(8,g_traducao_init), |
41 | "subtitulo": $trad("8a",g_traducao_init), | 41 | "subtitulo": $trad("8a",g_traducao_init), |
42 | "fa": "map-o", | 42 | "fa": "map-o", |
@@ -85,7 +85,7 @@ botoesIni = [ | @@ -85,7 +85,7 @@ botoesIni = [ | ||
85 | "target": "_self" | 85 | "target": "_self" |
86 | },{ | 86 | },{ |
87 | "img":"openlayersdebug", | 87 | "img":"openlayersdebug", |
88 | - "href": location.href.replace("init/index.php","") + customDir + "/openlayersdebug.htm", | 88 | + "href": location.href.replace("init/index.php"+window.location.search,"") + customDir + "/openlayersdebug.htm", |
89 | "titulo":$trad(5,g_traducao_init), | 89 | "titulo":$trad(5,g_traducao_init), |
90 | "subtitulo": $trad("5a",g_traducao_init), | 90 | "subtitulo": $trad("5a",g_traducao_init), |
91 | "fa": "cogs", | 91 | "fa": "cogs", |
init/index.php
@@ -212,6 +212,14 @@ include "head.php"; | @@ -212,6 +212,14 @@ include "head.php"; | ||
212 | $("#jumbotron").fadeOut(300) | 212 | $("#jumbotron").fadeOut(300) |
213 | } | 213 | } |
214 | ); | 214 | ); |
215 | + //verifica se deve ou nao esconder a mensagem de boas vindas verificando o parametro enviado pela url | ||
216 | + if("<?php echo isset($_GET["home"]) ? "ok" : ""; ?>" == "ok"){ | ||
217 | + $("#jumbotron").hide(); | ||
218 | + } | ||
219 | + //modifica a url para que ao voltar a pagina a mensagem de boas vindas nao seja mostrada | ||
220 | + var u = window.location.origin + window.location.pathname + "?home="; | ||
221 | + window.history.replaceState(null,null,u); | ||
222 | + | ||
215 | var tamanho = findBootstrapDeviceSize(); | 223 | var tamanho = findBootstrapDeviceSize(); |
216 | if(tamanho != "xs"){ | 224 | if(tamanho != "xs"){ |
217 | $(".tline").attr("src","https://twitter.com/i3geo"); | 225 | $(".tline").attr("src","https://twitter.com/i3geo"); |
mapas/index.php
@@ -171,7 +171,7 @@ include "../init/head.php"; | @@ -171,7 +171,7 @@ include "../init/head.php"; | ||
171 | <div class="container-fluid"> | 171 | <div class="container-fluid"> |
172 | <div class="row"> | 172 | <div class="row"> |
173 | <ol class="breadcrumb"> | 173 | <ol class="breadcrumb"> |
174 | - <li><a href="../init/index.php">i3Geo</a></li> | 174 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
175 | <li class="active">Mapas de usuários</li> | 175 | <li class="active">Mapas de usuários</li> |
176 | <li><a title="RSS" href="../admin/rssmapas.php"><i class="material-icons ">rss_feed</i></a> | 176 | <li><a title="RSS" href="../admin/rssmapas.php"><i class="material-icons ">rss_feed</i></a> |
177 | <a title="JSON" href="../admin/rssmapas.php?output=json"><i class="material-icons ">code</i></a> | 177 | <a title="JSON" href="../admin/rssmapas.php?output=json"><i class="material-icons ">code</i></a> |
mashups/index.php
@@ -16,7 +16,7 @@ include "../init/head.php"; | @@ -16,7 +16,7 @@ include "../init/head.php"; | ||
16 | <div class="container-fluid"> | 16 | <div class="container-fluid"> |
17 | <div class="row"> | 17 | <div class="row"> |
18 | <ol class="breadcrumb"> | 18 | <ol class="breadcrumb"> |
19 | - <li><a href="../init/index.php">i3Geo</a></li> | 19 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
20 | <li class="active">Mashups</li> | 20 | <li class="active">Mashups</li> |
21 | </ol> | 21 | </ol> |
22 | </div> | 22 | </div> |
ogc/index.php
@@ -93,14 +93,14 @@ include "../init/head.php"; | @@ -93,14 +93,14 @@ include "../init/head.php"; | ||
93 | </div> | 93 | </div> |
94 | <div class="panel-body"> | 94 | <div class="panel-body"> |
95 | <div id="corpoMenu{{idmenu}}" class="panel-collapse collapse" role="tabpanel" aria-multiselectable="true"> | 95 | <div id="corpoMenu{{idmenu}}" class="panel-collapse collapse" role="tabpanel" aria-multiselectable="true"> |
96 | - {{{camadas}}} | 96 | + {{{camadas}}} |
97 | <!-- aqui entra o filtro --> | 97 | <!-- aqui entra o filtro --> |
98 | <div class="form-group"> | 98 | <div class="form-group"> |
99 | <label class="control-label">{{{filtro}}}</label> | 99 | <label class="control-label">{{{filtro}}}</label> |
100 | <select onchange="filtraGrupo(this,'menu{{idmenu}}')" data-grupoFiltro="{{idmenu}}" class="form-control input-lg"> | 100 | <select onchange="filtraGrupo(this,'menu{{idmenu}}')" data-grupoFiltro="{{idmenu}}" class="form-control input-lg"> |
101 | </select> | 101 | </select> |
102 | </div> | 102 | </div> |
103 | - | 103 | + |
104 | <div id="gruposMenu{{idmenu}}"> | 104 | <div id="gruposMenu{{idmenu}}"> |
105 | <i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i><span class="sr-only">Aguarde</span> | 105 | <i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i><span class="sr-only">Aguarde</span> |
106 | </div> | 106 | </div> |
@@ -172,7 +172,7 @@ include "../init/head.php"; | @@ -172,7 +172,7 @@ include "../init/head.php"; | ||
172 | <div class="container-fluid"> | 172 | <div class="container-fluid"> |
173 | <div class="row"> | 173 | <div class="row"> |
174 | <ol class="breadcrumb"> | 174 | <ol class="breadcrumb"> |
175 | - <li><a href="../init/index.php">i3Geo</a></li> | 175 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
176 | <li class="active">OGC</li> | 176 | <li class="active">OGC</li> |
177 | </ol> | 177 | </ol> |
178 | </div> | 178 | </div> |
permlinks/index.php
@@ -80,7 +80,7 @@ include "../init/head.php"; | @@ -80,7 +80,7 @@ include "../init/head.php"; | ||
80 | <div class="container-fluid"> | 80 | <div class="container-fluid"> |
81 | <div class="row"> | 81 | <div class="row"> |
82 | <ol class="breadcrumb"> | 82 | <ol class="breadcrumb"> |
83 | - <li><a href="../init/index.php">i3Geo</a></li> | 83 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
84 | <li class="active">Perm links</li> | 84 | <li class="active">Perm links</li> |
85 | </ol> | 85 | </ol> |
86 | </div> | 86 | </div> |
testainstal/index.php
@@ -32,7 +32,7 @@ include "../init/head.php"; | @@ -32,7 +32,7 @@ include "../init/head.php"; | ||
32 | <div class="container-fluid"> | 32 | <div class="container-fluid"> |
33 | <div class="row"> | 33 | <div class="row"> |
34 | <ol class="breadcrumb"> | 34 | <ol class="breadcrumb"> |
35 | - <li><a href="../init/index.php">i3Geo</a></li> | 35 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
36 | <li class="active">Teste de instalação</li> | 36 | <li class="active">Teste de instalação</li> |
37 | </ol> | 37 | </ol> |
38 | </div> | 38 | </div> |
utilitarios/index.php
@@ -29,7 +29,7 @@ include "../init/head.php"; | @@ -29,7 +29,7 @@ include "../init/head.php"; | ||
29 | <div class="container-fluid"> | 29 | <div class="container-fluid"> |
30 | <div class="row"> | 30 | <div class="row"> |
31 | <ol class="breadcrumb"> | 31 | <ol class="breadcrumb"> |
32 | - <li><a href="../init/index.php">i3Geo</a></li> | 32 | + <li><a href="../init/index.php?home=">i3Geo</a></li> |
33 | <li class="active"></li> | 33 | <li class="active"></li> |
34 | </ol> | 34 | </ol> |
35 | </div> | 35 | </div> |