Commit c337ad75be7245ab294213d21eaa6d983c3b4a05

Authored by Edmar Moretti
1 parent 67b386fd

Inclusão de botão, que abre a tela de configuração do plugin parametrossql, no e…

…ditor gráfico de mapfiles.
admin/admin.db
No preview for this file type
admin1/catalogo/mapfile/exec.php
... ... @@ -114,6 +114,40 @@ switch ($funcao) {
114 114 "codigo" => $novocodigo
115 115 ) );
116 116 break;
  117 + case "PEGAPLUGIN":
  118 + //utilizado na janela de atalhos de edicao
  119 + session_write_close ();
  120 + session_name("i3GeoPHP");
  121 + session_id($_GET["g_sid"]);
  122 + session_start();
  123 + $mapa = ms_newMapObj($_SESSION["map_file"]);
  124 + $layer = $mapa->getlayerbyname($_GET["codigoLayer"]);
  125 + \admin\php\funcoesAdmin\retornaJSON($layer->getmetadata("PLUGINI3GEO"));
  126 + break;
  127 + case "GRAVAPLUGIN":
  128 + //utilizado na janela de atalhos de edicao
  129 + session_write_close ();
  130 + session_name("i3GeoPHP");
  131 + session_id($_GET["g_sid"]);
  132 + session_start();
  133 + $mapa = ms_newMapObj($_SESSION["map_file"]);
  134 + $layer = $mapa->getlayerbyname($_GET["codigoLayer"]);
  135 + $layer->setmetadata("PLUGINI3GEO",$_GET["plugin"]);
  136 + $mapa->save($_SESSION["map_file"]);
  137 + \admin\php\funcoesAdmin\retornaJSON("ok");
  138 + break;
  139 + case "REMOVEPLUGIN":
  140 + //utilizado na janela de atalhos de edicao
  141 + session_write_close ();
  142 + session_name("i3GeoPHP");
  143 + session_id($_GET["g_sid"]);
  144 + session_start();
  145 + $mapa = ms_newMapObj($_SESSION["map_file"]);
  146 + $layer = $mapa->getlayerbyname($_GET["codigoLayer"]);
  147 + $layer->setmetadata("PLUGINI3GEO","");
  148 + $mapa->save($_SESSION["map_file"]);
  149 + \admin\php\funcoesAdmin\retornaJSON("ok");
  150 + break;
117 151 default:
118 152 header ( "HTTP/1.1 500 erro funcao nao existe" );
119 153 break;
... ...
admin1/dicionario/core.js
1 1 //+$trad(1,i3GEOadmin.principal.dicionario)+
  2 +if (typeof (i3GEOadmin) === 'undefined') {
  3 + i3GEOadmin = {"core":{}};
  4 +}
  5 +if (typeof (i3GEOadmin.core) === 'undefined') {
  6 + i3GEOadmin["core"] = {};
  7 +}
2 8 i3GEOadmin.core.dicionario = {
3 9 'notInVersion' : [ {
4 10 pt : "Não disponível nessa versão do Mapserver",
... ...
admin1/js/core.js
1   -/*
2   -Title: core.js
3   -
4   -Funções de uso comum das interfaces dos editores
5   -
6   -Licenca:
7   -
8   -GPL2
9   -
10   -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
11   -
12   -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
13   -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
14   -
15   -Este programa é software livre; você pode redistribuí-lo
16   -e/ou modificá-lo sob os termos da Licença Pública Geral
17   -GNU conforme publicada pela Free Software Foundation;
18   -
19   -Este programa é distribuído na expectativa de que seja útil,
20   -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita
21   -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA.
22   -Consulte a Licença Pública Geral do GNU para mais detalhes.
23   -Você deve ter recebido uma copia da Licença Pública Geral do
24   -GNU junto com este programa; se não, escreva para a
25   -Free Software Foundation, Inc., no endereço
26   -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
27   -
28   -Arquivo:
29   -
30   -i3geo/admin/js/core.js
31   - */
  1 +//veja tambem aplicmap black_editor.php
32 2 /*
33 3 Function: $i
34 4  
... ... @@ -66,230 +36,233 @@ Armazena o objeto com a lista de perfis
66 36 $perfis = "";
67 37  
68 38 //funcoes jquery + bootstrap
  39 +if (typeof (i3GEOadmin) === 'undefined') {
  40 + var i3GEOadmin = {};
  41 +}
  42 +if(typeof jQuery != 'undefined' ){
  43 + i3GEOadmin.core = {
  44 + //valor do filtro utilizado ao iniciar a pagina
  45 + //usado para enviar parametros pela URL ao iniciar uma pagina
  46 + initFiltro: "",
  47 + erroLogin: function(){
  48 + $("#loginOff").css("display","");
  49 + $("#loginOn").css("display","none");
  50 + alert("Login!");
  51 + },
  52 + loginOn: function(){
  53 + $("#loginOff").css("display","none");
  54 + $("#loginOn").css("display","");
  55 + },
  56 + mostraErro: function(erro){
  57 + var html = '<div class="alert alert-danger alert-dismissible" role="alert">'
  58 + + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
  59 + + '<strong>Erro!</strong> '
  60 + + erro;
  61 + $(".navbar-fixed-bottom .container").html(html);
  62 + },
  63 + fechaModal: function(id){
  64 + $("#"+id).modal("hide");
  65 + },
  66 + abreModal: function(id,conteudo){
  67 + $("#"+id+" .modal-body").html(conteudo);
  68 + if($("#"+id).css("display") == "none"){
  69 + $("#"+id).modal("show");
69 70  
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: "",
74   - erroLogin: function(){
75   - $("#loginOff").css("display","");
76   - $("#loginOn").css("display","none");
77   - alert("Login!");
78   - },
79   - loginOn: function(){
80   - $("#loginOff").css("display","none");
81   - $("#loginOn").css("display","");
82   - },
83   - mostraErro: function(erro){
84   - var html = '<div class="alert alert-danger alert-dismissible" role="alert">'
85   - + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'
86   - + '<strong>Erro!</strong> '
87   - + erro;
88   - $(".navbar-fixed-bottom .container").html(html);
89   - },
90   - fechaModal: function(id){
91   - $("#"+id).modal("hide");
92   - },
93   - abreModal: function(id,conteudo){
94   - $("#"+id+" .modal-body").html(conteudo);
95   - if($("#"+id).css("display") == "none"){
96   - $("#"+id).modal("show");
97   -
98   - $.material.init();
99   - }
100   - },
101   - fechaModalGeral: function(){
102   - i3GEOadmin.core.fechaModal("modalGeral");
103   - },
104   - abreModalGeral: function(conteudo){
105   - i3GEOadmin.core.abreModal("modalGeral",conteudo);
106   - $("#body-form-modal").collapse('show');
107   - },
108   - fechaModalConfirma: function(){
109   - i3GEOadmin.core.fechaModal("modalGeral");
110   - },
111   - abreModalConfirma: function(hash){
112   - var conteudo = Mustache.to_html(
113   - $("#modalConfirmaTpl").html(),
114   - hash
115   - );
116   - i3GEOadmin.core.abreModal("modalGeral",conteudo);
117   - },
118   - modalAguarde: function(open){
119   - if(open === true){
120   - i3GEOadmin.core.abreModalGeral($("#iconeAguardeTpl").html());
121   - }
122   - else{
123   - i3GEOadmin.core.fechaModalGeral();
124   - }
125   - },
126   - iconeAguarde: function(onde){
127   - if(onde.html){
128   - onde.html($("#iconeAguardeTpl").html());
129   - }
130   - else{
131   - $("#"+onde).html($("#iconeAguardeTpl").html());
132   - }
133   - },
134   - pegaFiltro: function(){
135   - return $i("filtro");
136   - },
137   - valorFiltro: function(){
138   - var v = "";
139   - //verifica se o valor do filtro foi passado pela url
140   - if(i3GEOadmin.core.initFiltro != ""){
141   - v = i3GEOadmin.core.initFiltro;
142   - i3GEOadmin.core.initFiltro = "";
143   - }
144   - else{
145   - v = i3GEOadmin.core.pegaFiltro().value;
146   - }
147   - return v;
148   - },
149   - defineFiltro: function(valor){
150   - i3GEOadmin.core.pegaFiltro().value = valor;
151   - },
152   - filtra: function(obj){
153   - $("#corpo .panel").each(
154   - function(i,el){
155   - if(obj.value == ""){
156   - $(el).show();
157   - $("#body-"+el.id).collapse('hide');
  71 + $.material.init();
  72 + }
  73 + },
  74 + fechaModalGeral: function(){
  75 + i3GEOadmin.core.fechaModal("modalGeral");
  76 + },
  77 + abreModalGeral: function(conteudo){
  78 + i3GEOadmin.core.abreModal("modalGeral",conteudo);
  79 + $("#body-form-modal").collapse('show');
  80 + },
  81 + fechaModalConfirma: function(){
  82 + i3GEOadmin.core.fechaModal("modalGeral");
  83 + },
  84 + abreModalConfirma: function(hash){
  85 + var conteudo = Mustache.to_html(
  86 + $("#modalConfirmaTpl").html(),
  87 + hash
  88 + );
  89 + i3GEOadmin.core.abreModal("modalGeral",conteudo);
  90 + },
  91 + modalAguarde: function(open){
  92 + if(open === true){
  93 + i3GEOadmin.core.abreModalGeral($("#iconeAguardeTpl").html());
  94 + }
  95 + else{
  96 + i3GEOadmin.core.fechaModalGeral();
  97 + }
  98 + },
  99 + iconeAguarde: function(onde){
  100 + if(onde.html){
  101 + onde.html($("#iconeAguardeTpl").html());
  102 + }
  103 + else{
  104 + $("#"+onde).html($("#iconeAguardeTpl").html());
  105 + }
  106 + },
  107 + pegaFiltro: function(){
  108 + return $i("filtro");
  109 + },
  110 + valorFiltro: function(){
  111 + var v = "";
  112 + //verifica se o valor do filtro foi passado pela url
  113 + if(i3GEOadmin.core.initFiltro != ""){
  114 + v = i3GEOadmin.core.initFiltro;
  115 + i3GEOadmin.core.initFiltro = "";
  116 + }
  117 + else{
  118 + v = i3GEOadmin.core.pegaFiltro().value;
  119 + }
  120 + return v;
  121 + },
  122 + defineFiltro: function(valor){
  123 + i3GEOadmin.core.pegaFiltro().value = valor;
  124 + },
  125 + filtra: function(obj){
  126 + $("#corpo .panel").each(
  127 + function(i,el){
  128 + if(obj.value == ""){
  129 + $(el).show();
  130 + $("#body-"+el.id).collapse('hide');
  131 + }
  132 + else {
  133 + $(el).hide();
  134 + }
158 135 }
159   - else {
160   - $(el).hide();
  136 + );
  137 + $("#corpo .list-group-item").each(
  138 + function(i,el){
  139 + if(obj.value == ""){
  140 + $(el).show();
  141 + }
  142 + else {
  143 + $(el).hide();
  144 + }
161 145 }
  146 + );
  147 + if(obj.value != ""){
  148 + $("#"+obj.value).show();
  149 + $("#body-"+obj.value).collapse('show');
  150 + }
  151 + }
  152 + };
  153 +
  154 + //autocomlete
  155 + (function( $ ) {
  156 + $.widget( "custom.combobox", $.ui.autocomplete, {
  157 +
  158 + _create: function() {
  159 + this.wrapper = $( "<span>" )
  160 + .addClass( "custom-combobox" )
  161 + .insertAfter( this.element );
  162 +
  163 + this.element.hide();
  164 + this._createAutocomplete();
  165 + this._createShowAllButton();
  166 + },
  167 +
  168 + _createAutocomplete: function() {
  169 + var selected = this.element.children( ":selected" ),
  170 + value = selected.val() ? selected.text() : "";
  171 + //console.info(this.element.context);
  172 + this.input = $( "<input>" )
  173 + .appendTo( this.wrapper )
  174 + .val( value )
  175 + .attr( "title", "" )
  176 + .addClass( "form-control" )
  177 + .autocomplete({
  178 + delay: 0,
  179 + minLength: 0,
  180 + source: $.proxy( this, "_source" ),
  181 + select: function( event, ui ) {
  182 + ui.item.el.context.value = ui.item.option.value;
  183 + ui.item.el.context.onchange.call(ui.item.el.context);
162 184 }
163   - );
164   - $("#corpo .list-group-item").each(
165   - function(i,el){
166   - if(obj.value == ""){
167   - $(el).show();
168   - }
169   - else {
170   - $(el).hide();
171   - }
  185 + });
  186 +
  187 + this._on( this.input, {
  188 + autocompleteselect: function( event, ui ) {
  189 + ui.item.option.selected = true;
  190 + this._trigger( "select", event, {
  191 + item: ui.item.option
  192 + });
  193 + },
  194 + autocompletechange: "_removeIfInvalid"
  195 + });
  196 + },
  197 +
  198 + _createShowAllButton: function() {
  199 + var input = this.input,
  200 + wasOpen = false;
  201 + $( "<span>" )
  202 + .attr( "tabIndex", -1 )
  203 + .appendTo( this.wrapper )
  204 + .removeClass( "ui-corner-all" )
  205 + .addClass( "glyphicon glyphicon-search" )
  206 + .mousedown(function() {
  207 + wasOpen = input.autocomplete( "widget" ).is( ":visible" );
  208 + })
  209 + .click(function() {
  210 + input.focus();
  211 + // Close if already visible
  212 + if ( wasOpen ) {
  213 + return;
172 214 }
173   - );
174   - if(obj.value != ""){
175   - $("#"+obj.value).show();
176   - $("#body-"+obj.value).collapse('show');
177   - }
178   - }
179   -};
180   -
181   -//autocomlete
182   -(function( $ ) {
183   - $.widget( "custom.combobox", $.ui.autocomplete, {
184   -
185   - _create: function() {
186   - this.wrapper = $( "<span>" )
187   - .addClass( "custom-combobox" )
188   - .insertAfter( this.element );
189   -
190   - this.element.hide();
191   - this._createAutocomplete();
192   - this._createShowAllButton();
193   - },
194   -
195   - _createAutocomplete: function() {
196   - var selected = this.element.children( ":selected" ),
197   - value = selected.val() ? selected.text() : "";
198   - //console.info(this.element.context);
199   - this.input = $( "<input>" )
200   - .appendTo( this.wrapper )
201   - .val( value )
202   - .attr( "title", "" )
203   - .addClass( "form-control" )
204   - .autocomplete({
205   - delay: 0,
206   - minLength: 0,
207   - source: $.proxy( this, "_source" ),
208   - select: function( event, ui ) {
209   - ui.item.el.context.value = ui.item.option.value;
210   - ui.item.el.context.onchange.call(ui.item.el.context);
211   - }
212   - });
213   -
214   - this._on( this.input, {
215   - autocompleteselect: function( event, ui ) {
216   - ui.item.option.selected = true;
217   - this._trigger( "select", event, {
218   - item: ui.item.option
219   - });
220   - },
221   - autocompletechange: "_removeIfInvalid"
222   - });
223   - },
224   -
225   - _createShowAllButton: function() {
226   - var input = this.input,
227   - wasOpen = false;
228   - $( "<span>" )
229   - .attr( "tabIndex", -1 )
230   - .appendTo( this.wrapper )
231   - .removeClass( "ui-corner-all" )
232   - .addClass( "glyphicon glyphicon-search" )
233   - .mousedown(function() {
234   - wasOpen = input.autocomplete( "widget" ).is( ":visible" );
235   - })
236   - .click(function() {
237   - input.focus();
238   - // Close if already visible
239   - if ( wasOpen ) {
  215 + // Pass empty string as value to search for, displaying all results
  216 + input.autocomplete( "search", "" );
  217 + });
  218 + },
  219 + _source: function( request, response ) {
  220 + var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
  221 + var el = this.element;
  222 + response( this.element.children( "option" ).map(function() {
  223 + var text = $( this ).text();
  224 + if ( ( !request.term || matcher.test(text) ) )
  225 + return {
  226 + label: text,
  227 + value: text,
  228 + option: this,
  229 + el: el
  230 + };
  231 + }
  232 + ) );
  233 + },
  234 +
  235 + _removeIfInvalid: function( event, ui ) {
  236 + // Selected an item, nothing to do
  237 + if ( ui.item ) {
240 238 return;
241 239 }
242   - // Pass empty string as value to search for, displaying all results
243   - input.autocomplete( "search", "" );
244   - });
245   - },
246   - _source: function( request, response ) {
247   - var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
248   - var el = this.element;
249   - response( this.element.children( "option" ).map(function() {
250   - var text = $( this ).text();
251   - if ( ( !request.term || matcher.test(text) ) )
252   - return {
253   - label: text,
254   - value: text,
255   - option: this,
256   - el: el
257   - };
258   - }
259   - ) );
260   - },
261   -
262   - _removeIfInvalid: function( event, ui ) {
263   - // Selected an item, nothing to do
264   - if ( ui.item ) {
265   - return;
266   - }
267   - // Search for a match (case-insensitive)
268   - var value = this.input.val(),
269   - valueLowerCase = value.toLowerCase(),
270   - valid = false;
271   - this.element.children( "option" ).each(function() {
272   - if ( $( this ).text().toLowerCase() === valueLowerCase ) {
273   - this.selected = valid = true;
274   - return false;
  240 + // Search for a match (case-insensitive)
  241 + var value = this.input.val(),
  242 + valueLowerCase = value.toLowerCase(),
  243 + valid = false;
  244 + this.element.children( "option" ).each(function() {
  245 + if ( $( this ).text().toLowerCase() === valueLowerCase ) {
  246 + this.selected = valid = true;
  247 + return false;
  248 + }
  249 + });
  250 + // Found a match, nothing to do
  251 + if ( valid ) {
  252 + return;
275 253 }
276   - });
277   - // Found a match, nothing to do
278   - if ( valid ) {
279   - return;
  254 + // Remove invalid value
  255 + this.input.val( "" );
  256 + this.element.val( "" );
  257 + this.input.autocomplete( "instance" ).term = "";
  258 + },
  259 + _destroy: function() {
  260 + this.wrapper.remove();
  261 + this.element.show();
280 262 }
281   - // Remove invalid value
282   - this.input.val( "" );
283   - this.element.val( "" );
284   - this.input.autocomplete( "instance" ).term = "";
285   - },
286   - _destroy: function() {
287   - this.wrapper.remove();
288   - this.element.show();
289   - }
290   - });
291   -})( jQuery );
292   -
  263 + });
  264 + })( jQuery );
  265 +}
293 266  
294 267 function cabecalhoMetaestat(id,excluir){
295 268 var botao,i,n,temp,
... ...
admin1/php/checaLogin.php
... ... @@ -73,8 +73,11 @@ function checaLogin(){
73 73 exit ();
74 74 }
75 75 } else {
76   - header ( "HTTP/1.1 403 Usuario nao logado" );
77   - //header("Location:");
  76 + if(defined("ONDEI3GEO")){
  77 + header("Location:" . ONDEI3GEO . "/admin1/index.php");
  78 + } else {
  79 + header ( "HTTP/1.1 403 Usuario nao logado" );
  80 + }
78 81 exit ();
79 82 }
80 83 // verifica se o login pode ser realizado
... ...
classesjs/classe_plugini3geo.js
... ... @@ -1030,15 +1030,15 @@ i3GEO.pluginI3geo =
1030 1030 config.ativo = "sim";
1031 1031 }
1032 1032 ins += "<p class='paragrafo'>Abre o formul&aacute;rio quando a camada &eacute; adicionada ao mapa: (true ou false)</p>";
1033   - ins += "<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";
  1033 + ins += "<div class='styled-select' style='display:block;width: 200px;' ><select id='parametrosSqlAtivo' ><option value='' ></option>";
1034 1034 if (config.ativo === "nao") {
1035   - ins += "<option value=sim >sim</option><option value=nao selected >nao</option></select>";
  1035 + ins += "<option value=sim >sim</option><option value=nao selected >nao</option></select></div>";
1036 1036 } else {
1037   - ins += "<option value=sim selected >sim</option><option value=nao >nao</option></select>";
  1037 + ins += "<option value=sim selected >sim</option><option value=nao >nao</option></select></div>";
1038 1038 }
1039 1039  
1040 1040 ins +=
1041   - "<table><tr><td>T&iacute;tulo</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";
  1041 + "<table class='lista4'><tr><td>T&iacute;tulo</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";
1042 1042 for (i = 0; i < n; i++) {
1043 1043 ins +=
1044 1044 "<tr><td><input name='titulo' type=text size=20 value='" + parametros[i].titulo
... ...
ferramentas/atalhosedicao/dicionario.js
... ... @@ -69,5 +69,15 @@ i3GEOF.atalhosedicao.dicionario = {
69 69 pt : "Mostra na ferramenta de identifica&ccedil;&atilde;o",
70 70 en : "",
71 71 es : ""
  72 + }],
  73 + "removePlugin" : [{
  74 + pt : "Remove o plugin",
  75 + en : "",
  76 + es : ""
  77 + }],
  78 + "plugins" : [{
  79 + pt : "Plugins que implementam formas especiais de visualiza&ccedil;&atilde;o. A camada pode ter apenas um plugin.",
  80 + en : "",
  81 + es : ""
72 82 }]
73 83 };
... ...
ferramentas/atalhosedicao/exec.php
1 1 <?php
  2 +//TODO verificar login
2 3 include_once(dirname(__FILE__)."/../safe.php");
3 4 verificaBlFerramentas(basename(dirname(__FILE__)),$i3geoBlFerramentas,false);
4 5 //
... ...
ferramentas/atalhosedicao/index.js
... ... @@ -143,7 +143,6 @@ i3GEOF.atalhosedicao =
143 143 });
144 144 $i("i3GEOFatalhosedicaoStorymap-button").style.width = "200px";
145 145  
146   -
147 146 new YAHOO.widget.Button("i3GEOFatalhosedicaoAnimagif", {
148 147 onclick : {
149 148 fn : function() {
... ... @@ -154,6 +153,38 @@ i3GEOF.atalhosedicao =
154 153 });
155 154 $i("i3GEOFatalhosedicaoAnimagif-button").style.width = "200px";
156 155  
  156 + new YAHOO.widget.Button("i3GEOFatalhosedicaoParametrossql", {
  157 + onclick : {
  158 + fn : function() {
  159 + i3GEO.temaAtivo = i3GEOF.atalhosedicao.tema;
  160 + //i3GEO.pluginI3geo.parametrossql.buscaParForm(i3GEOF.atalhosedicao.tema);
  161 + YAHOO.namespace("admin");
  162 + YAHOO.namespace("admin.container");
  163 + core_montaEditor("","450px","500px","","Plugin",true,false,false);
  164 + var sUrl = i3GEO.configura.locaplic + "/admin1/catalogo/mapfile/exec.php?funcao=pegaPlugin&codigoMap="+i3GEO.temaAtivo+"&codigoLayer="+i3GEO.temaAtivo+"&g_sid="+i3GEO.configura.sid;
  165 + var montaEditorPlugin = function(retorno){
  166 + var plugin = "parametrossql";
  167 + var ins = "<input type=button title='"+ $trad("salva",i3GEOadmin.core.dicionario) +"' value='"+ $trad("salva",i3GEOadmin.core.dicionario) +"' id=salvarPlugin />"
  168 + + "<input type=button title='"+ $trad("remove",i3GEOadmin.core.dicionario) +"' value='"+ $trad("remove",i3GEOadmin.core.dicionario) +"' id=removerPlugin />";
  169 + //pega os campos do formulario
  170 + ins += i3GEO.pluginI3geo.formAdmin(plugin,retorno);
  171 + var ajuda = "<p>Mais informa&ccedil;&otilde;es:<br><a href='"+i3GEO.pluginI3geo.linkAjuda(plugin)+"' target=_blank >" + i3GEO.pluginI3geo.linkAjuda(plugin) + "</a></p>";
  172 + $i("editor_bd").innerHTML = ins + ajuda;
  173 +
  174 + new YAHOO.widget.Button("salvarPlugin",{ onclick: { fn: function(){
  175 + i3GEOF.atalhosedicao.salvarDadosEditorPlugin($i("editor_bd"),plugin,i3GEOF.atalhosedicao.tema,i3GEOF.atalhosedicao.tema);
  176 + } }});
  177 +
  178 + new YAHOO.widget.Button("removerPlugin",{ onclick: { fn: function(){
  179 + i3GEOF.atalhosedicao.salvarDadosEditorPlugin($i("editor_bd"),"",i3GEOF.atalhosedicao.tema,i3GEOF.atalhosedicao.tema);
  180 + } }});
  181 + };
  182 + core_pegaDados("",sUrl,montaEditorPlugin);
  183 + }
  184 + }
  185 + });
  186 + $i("i3GEOFatalhosedicaoParametrossql-button").style.width = "200px";
  187 +
157 188 new YAHOO.widget.Button("i3GEOFatalhosedicaoTemaComGrafico", {
158 189 onclick : {
159 190 fn : function() {
... ... @@ -258,5 +289,51 @@ i3GEOF.atalhosedicao =
258 289 }
259 290 tema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.atalhosedicao.tema);
260 291 tema[obj.name] = valor;
  292 + },
  293 + salvarDadosEditorPlugin: function(onde,plugin,codigoMap,codigoLayer){
  294 + var campos = onde.getElementsByTagName("input"),
  295 + n = campos.length,
  296 + par = [],
  297 + prog = i3GEO.configura.locaplic + "/admin1/catalogo/mapfile/exec.php?funcao=gravaPlugin&g_sid="+i3GEO.configura.sid,
  298 + i;
  299 + if(plugin != ""){
  300 + if(!i3GEO.pluginI3geo[plugin].parametrosFormAdmin){
  301 + for(i=0; i<n; i++){
  302 + par.push('"'+campos[i].name+'":"'+campos[i].value+'"');
  303 + }
  304 + if(plugin != ""){
  305 + plugin = '{"plugin":"'+plugin+'","parametros":{' + par.join(",") + '}}';
  306 + }
  307 + }
  308 + else{
  309 + plugin = i3GEO.pluginI3geo[plugin].parametrosFormAdmin(onde);
  310 + }
  311 + }
  312 + core_carregando("ativa");
  313 + core_carregando($trad("gravaLayer",i3GEOadmin.core.dicionario)+codigoLayer);
  314 + var sUrl = prog
  315 + + "&codigoMap=" + codigoMap
  316 + + "&codigoLayer=" + codigoLayer
  317 + + "&plugin=" + plugin;
  318 + var callback = {
  319 + success:function(o) {
  320 + try {
  321 + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") {
  322 + core_carregando("<span style=color:red >"+ $trad("naoSalva",i3GEOadmin.core.dicionario) +"</span>");
  323 + setTimeout("core_carregando('desativa')",3000);
  324 + }
  325 + else {
  326 + YAHOO.admin.container.panelEditor.destroy();
  327 + YAHOO.admin.container.panelEditor = null;
  328 + core_carregando("desativa");
  329 + }
  330 + }
  331 + catch(e){core_handleFailure(e,o.responseText);}
  332 + },
  333 + failure:core_handleFailure,
  334 + argument: { foo:"foo", bar:"bar" }
  335 + };
  336 + core_makeRequest(sUrl,callback,'POST');
261 337 }
  338 +
262 339 };
... ...
ferramentas/atalhosedicao/template_mst.html
... ... @@ -86,4 +86,9 @@
86 86 <p class='paragrafo'>
87 87 <input id='i3GEOFatalhosedicaoAnimagif' type='button' value='Animagif' />
88 88 </p>
  89 + <br>
  90 + <p class='paragrafo'>{{{plugins}}}</p>
  91 + <p class='paragrafo'>
  92 + <input id='i3GEOFatalhosedicaoParametrossql' type='button' value='Par&acirc;metros SQL' />
  93 + </p>
89 94 </div>
90 95 \ No newline at end of file
... ...
interface/black_editor.php
... ... @@ -19,6 +19,8 @@
19 19 }
20 20 </style>
21 21 <script src="../classesjs/i3geonaocompacto.js"></script>
  22 + <script src="../admin1/js/core.js"></script>
  23 + <script type="text/javascript" src="../admin1/dicionario/core.js"></script>
22 24 <script src="../pacotes/openlayers/OpenLayers2131.js.php"></script>
23 25 <link rel="stylesheet" type="text/css" href="../css/black6.css">
24 26 </head>
... ...
js/plugini3geo.js
... ... @@ -1023,15 +1023,15 @@ i3GEO.pluginI3geo =
1023 1023 config.ativo = "sim";
1024 1024 }
1025 1025 ins += "<p class='paragrafo'>Abre o formul&aacute;rio quando a camada &eacute; adicionada ao mapa: (true ou false)</p>";
1026   - ins += "<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";
  1026 + ins += "<div class='styled-select' style='display:block;width: 200px;' ><select id='parametrosSqlAtivo' ><option value='' ></option>";
1027 1027 if (config.ativo === "nao") {
1028   - ins += "<option value=sim >sim</option><option value=nao selected >nao</option></select>";
  1028 + ins += "<option value=sim >sim</option><option value=nao selected >nao</option></select></div>";
1029 1029 } else {
1030   - ins += "<option value=sim selected >sim</option><option value=nao >nao</option></select>";
  1030 + ins += "<option value=sim selected >sim</option><option value=nao >nao</option></select></div>";
1031 1031 }
1032 1032  
1033 1033 ins +=
1034   - "<table><tr><td>T&iacute;tulo</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";
  1034 + "<table class='lista4'><tr><td>T&iacute;tulo</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";
1035 1035 for (i = 0; i < n; i++) {
1036 1036 ins +=
1037 1037 "<tr><td><input name='titulo' type=text size=20 value='" + parametros[i].titulo
... ...