diff --git a/admin/admin.db b/admin/admin.db
index 4ea9a9e..2fa0ae3 100755
Binary files a/admin/admin.db and b/admin/admin.db differ
diff --git a/admin1/catalogo/mapfile/exec.php b/admin1/catalogo/mapfile/exec.php
index 5c85a3d..c882bbc 100755
--- a/admin1/catalogo/mapfile/exec.php
+++ b/admin1/catalogo/mapfile/exec.php
@@ -114,6 +114,40 @@ switch ($funcao) {
"codigo" => $novocodigo
) );
break;
+ case "PEGAPLUGIN":
+ //utilizado na janela de atalhos de edicao
+ session_write_close ();
+ session_name("i3GeoPHP");
+ session_id($_GET["g_sid"]);
+ session_start();
+ $mapa = ms_newMapObj($_SESSION["map_file"]);
+ $layer = $mapa->getlayerbyname($_GET["codigoLayer"]);
+ \admin\php\funcoesAdmin\retornaJSON($layer->getmetadata("PLUGINI3GEO"));
+ break;
+ case "GRAVAPLUGIN":
+ //utilizado na janela de atalhos de edicao
+ session_write_close ();
+ session_name("i3GeoPHP");
+ session_id($_GET["g_sid"]);
+ session_start();
+ $mapa = ms_newMapObj($_SESSION["map_file"]);
+ $layer = $mapa->getlayerbyname($_GET["codigoLayer"]);
+ $layer->setmetadata("PLUGINI3GEO",$_GET["plugin"]);
+ $mapa->save($_SESSION["map_file"]);
+ \admin\php\funcoesAdmin\retornaJSON("ok");
+ break;
+ case "REMOVEPLUGIN":
+ //utilizado na janela de atalhos de edicao
+ session_write_close ();
+ session_name("i3GeoPHP");
+ session_id($_GET["g_sid"]);
+ session_start();
+ $mapa = ms_newMapObj($_SESSION["map_file"]);
+ $layer = $mapa->getlayerbyname($_GET["codigoLayer"]);
+ $layer->setmetadata("PLUGINI3GEO","");
+ $mapa->save($_SESSION["map_file"]);
+ \admin\php\funcoesAdmin\retornaJSON("ok");
+ break;
default:
header ( "HTTP/1.1 500 erro funcao nao existe" );
break;
diff --git a/admin1/dicionario/core.js b/admin1/dicionario/core.js
index 67fda03..a5aa4a1 100755
--- a/admin1/dicionario/core.js
+++ b/admin1/dicionario/core.js
@@ -1,4 +1,10 @@
//+$trad(1,i3GEOadmin.principal.dicionario)+
+if (typeof (i3GEOadmin) === 'undefined') {
+ i3GEOadmin = {"core":{}};
+}
+if (typeof (i3GEOadmin.core) === 'undefined') {
+ i3GEOadmin["core"] = {};
+}
i3GEOadmin.core.dicionario = {
'notInVersion' : [ {
pt : "Não disponível nessa versão do Mapserver",
diff --git a/admin1/js/core.js b/admin1/js/core.js
index 4416357..9e1c31e 100755
--- a/admin1/js/core.js
+++ b/admin1/js/core.js
@@ -1,34 +1,4 @@
-/*
-Title: core.js
-
-Funções de uso comum das interfaces dos editores
-
-Licenca:
-
-GPL2
-
-i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
-
-Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil
-Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
-
-Este programa é software livre; você pode redistribuí-lo
-e/ou modificá-lo sob os termos da Licença Pública Geral
-GNU conforme publicada pela Free Software Foundation;
-
-Este programa é distribuído na expectativa de que seja útil,
-porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita
-de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA.
-Consulte a Licença Pública Geral do GNU para mais detalhes.
-Você deve ter recebido uma copia da Licença Pública Geral do
-GNU junto com este programa; se não, escreva para a
-Free Software Foundation, Inc., no endereço
-59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
-
-Arquivo:
-
-i3geo/admin/js/core.js
- */
+//veja tambem aplicmap black_editor.php
/*
Function: $i
@@ -66,230 +36,233 @@ Armazena o objeto com a lista de perfis
$perfis = "";
//funcoes jquery + bootstrap
+if (typeof (i3GEOadmin) === 'undefined') {
+ var i3GEOadmin = {};
+}
+if(typeof jQuery != 'undefined' ){
+ i3GEOadmin.core = {
+ //valor do filtro utilizado ao iniciar a pagina
+ //usado para enviar parametros pela URL ao iniciar uma pagina
+ initFiltro: "",
+ erroLogin: function(){
+ $("#loginOff").css("display","");
+ $("#loginOn").css("display","none");
+ alert("Login!");
+ },
+ loginOn: function(){
+ $("#loginOff").css("display","none");
+ $("#loginOn").css("display","");
+ },
+ mostraErro: function(erro){
+ var html = '
'
+ + '
'
+ + '
Erro! '
+ + erro;
+ $(".navbar-fixed-bottom .container").html(html);
+ },
+ fechaModal: function(id){
+ $("#"+id).modal("hide");
+ },
+ abreModal: function(id,conteudo){
+ $("#"+id+" .modal-body").html(conteudo);
+ if($("#"+id).css("display") == "none"){
+ $("#"+id).modal("show");
-i3GEOadmin.core = {
- //valor do filtro utilizado ao iniciar a pagina
- //usado para enviar parametros pela URL ao iniciar uma pagina
- initFiltro: "",
- erroLogin: function(){
- $("#loginOff").css("display","");
- $("#loginOn").css("display","none");
- alert("Login!");
- },
- loginOn: function(){
- $("#loginOff").css("display","none");
- $("#loginOn").css("display","");
- },
- mostraErro: function(erro){
- var html = '
'
- + '
'
- + '
Erro! '
- + erro;
- $(".navbar-fixed-bottom .container").html(html);
- },
- fechaModal: function(id){
- $("#"+id).modal("hide");
- },
- abreModal: function(id,conteudo){
- $("#"+id+" .modal-body").html(conteudo);
- if($("#"+id).css("display") == "none"){
- $("#"+id).modal("show");
-
- $.material.init();
- }
- },
- fechaModalGeral: function(){
- i3GEOadmin.core.fechaModal("modalGeral");
- },
- abreModalGeral: function(conteudo){
- i3GEOadmin.core.abreModal("modalGeral",conteudo);
- $("#body-form-modal").collapse('show');
- },
- fechaModalConfirma: function(){
- i3GEOadmin.core.fechaModal("modalGeral");
- },
- abreModalConfirma: function(hash){
- var conteudo = Mustache.to_html(
- $("#modalConfirmaTpl").html(),
- hash
- );
- i3GEOadmin.core.abreModal("modalGeral",conteudo);
- },
- modalAguarde: function(open){
- if(open === true){
- i3GEOadmin.core.abreModalGeral($("#iconeAguardeTpl").html());
- }
- else{
- i3GEOadmin.core.fechaModalGeral();
- }
- },
- iconeAguarde: function(onde){
- if(onde.html){
- onde.html($("#iconeAguardeTpl").html());
- }
- else{
- $("#"+onde).html($("#iconeAguardeTpl").html());
- }
- },
- pegaFiltro: function(){
- return $i("filtro");
- },
- valorFiltro: function(){
- var v = "";
- //verifica se o valor do filtro foi passado pela url
- if(i3GEOadmin.core.initFiltro != ""){
- v = i3GEOadmin.core.initFiltro;
- i3GEOadmin.core.initFiltro = "";
- }
- else{
- v = i3GEOadmin.core.pegaFiltro().value;
- }
- return v;
- },
- defineFiltro: function(valor){
- i3GEOadmin.core.pegaFiltro().value = valor;
- },
- filtra: function(obj){
- $("#corpo .panel").each(
- function(i,el){
- if(obj.value == ""){
- $(el).show();
- $("#body-"+el.id).collapse('hide');
+ $.material.init();
+ }
+ },
+ fechaModalGeral: function(){
+ i3GEOadmin.core.fechaModal("modalGeral");
+ },
+ abreModalGeral: function(conteudo){
+ i3GEOadmin.core.abreModal("modalGeral",conteudo);
+ $("#body-form-modal").collapse('show');
+ },
+ fechaModalConfirma: function(){
+ i3GEOadmin.core.fechaModal("modalGeral");
+ },
+ abreModalConfirma: function(hash){
+ var conteudo = Mustache.to_html(
+ $("#modalConfirmaTpl").html(),
+ hash
+ );
+ i3GEOadmin.core.abreModal("modalGeral",conteudo);
+ },
+ modalAguarde: function(open){
+ if(open === true){
+ i3GEOadmin.core.abreModalGeral($("#iconeAguardeTpl").html());
+ }
+ else{
+ i3GEOadmin.core.fechaModalGeral();
+ }
+ },
+ iconeAguarde: function(onde){
+ if(onde.html){
+ onde.html($("#iconeAguardeTpl").html());
+ }
+ else{
+ $("#"+onde).html($("#iconeAguardeTpl").html());
+ }
+ },
+ pegaFiltro: function(){
+ return $i("filtro");
+ },
+ valorFiltro: function(){
+ var v = "";
+ //verifica se o valor do filtro foi passado pela url
+ if(i3GEOadmin.core.initFiltro != ""){
+ v = i3GEOadmin.core.initFiltro;
+ i3GEOadmin.core.initFiltro = "";
+ }
+ else{
+ v = i3GEOadmin.core.pegaFiltro().value;
+ }
+ return v;
+ },
+ defineFiltro: function(valor){
+ i3GEOadmin.core.pegaFiltro().value = valor;
+ },
+ filtra: function(obj){
+ $("#corpo .panel").each(
+ function(i,el){
+ if(obj.value == ""){
+ $(el).show();
+ $("#body-"+el.id).collapse('hide');
+ }
+ else {
+ $(el).hide();
+ }
}
- else {
- $(el).hide();
+ );
+ $("#corpo .list-group-item").each(
+ function(i,el){
+ if(obj.value == ""){
+ $(el).show();
+ }
+ else {
+ $(el).hide();
+ }
}
+ );
+ if(obj.value != ""){
+ $("#"+obj.value).show();
+ $("#body-"+obj.value).collapse('show');
+ }
+ }
+ };
+
+ //autocomlete
+ (function( $ ) {
+ $.widget( "custom.combobox", $.ui.autocomplete, {
+
+ _create: function() {
+ this.wrapper = $( "
" )
+ .addClass( "custom-combobox" )
+ .insertAfter( this.element );
+
+ this.element.hide();
+ this._createAutocomplete();
+ this._createShowAllButton();
+ },
+
+ _createAutocomplete: function() {
+ var selected = this.element.children( ":selected" ),
+ value = selected.val() ? selected.text() : "";
+ //console.info(this.element.context);
+ this.input = $( "" )
+ .appendTo( this.wrapper )
+ .val( value )
+ .attr( "title", "" )
+ .addClass( "form-control" )
+ .autocomplete({
+ delay: 0,
+ minLength: 0,
+ source: $.proxy( this, "_source" ),
+ select: function( event, ui ) {
+ ui.item.el.context.value = ui.item.option.value;
+ ui.item.el.context.onchange.call(ui.item.el.context);
}
- );
- $("#corpo .list-group-item").each(
- function(i,el){
- if(obj.value == ""){
- $(el).show();
- }
- else {
- $(el).hide();
- }
+ });
+
+ this._on( this.input, {
+ autocompleteselect: function( event, ui ) {
+ ui.item.option.selected = true;
+ this._trigger( "select", event, {
+ item: ui.item.option
+ });
+ },
+ autocompletechange: "_removeIfInvalid"
+ });
+ },
+
+ _createShowAllButton: function() {
+ var input = this.input,
+ wasOpen = false;
+ $( "" )
+ .attr( "tabIndex", -1 )
+ .appendTo( this.wrapper )
+ .removeClass( "ui-corner-all" )
+ .addClass( "glyphicon glyphicon-search" )
+ .mousedown(function() {
+ wasOpen = input.autocomplete( "widget" ).is( ":visible" );
+ })
+ .click(function() {
+ input.focus();
+ // Close if already visible
+ if ( wasOpen ) {
+ return;
}
- );
- if(obj.value != ""){
- $("#"+obj.value).show();
- $("#body-"+obj.value).collapse('show');
- }
- }
-};
-
-//autocomlete
-(function( $ ) {
- $.widget( "custom.combobox", $.ui.autocomplete, {
-
- _create: function() {
- this.wrapper = $( "" )
- .addClass( "custom-combobox" )
- .insertAfter( this.element );
-
- this.element.hide();
- this._createAutocomplete();
- this._createShowAllButton();
- },
-
- _createAutocomplete: function() {
- var selected = this.element.children( ":selected" ),
- value = selected.val() ? selected.text() : "";
- //console.info(this.element.context);
- this.input = $( "" )
- .appendTo( this.wrapper )
- .val( value )
- .attr( "title", "" )
- .addClass( "form-control" )
- .autocomplete({
- delay: 0,
- minLength: 0,
- source: $.proxy( this, "_source" ),
- select: function( event, ui ) {
- ui.item.el.context.value = ui.item.option.value;
- ui.item.el.context.onchange.call(ui.item.el.context);
- }
- });
-
- this._on( this.input, {
- autocompleteselect: function( event, ui ) {
- ui.item.option.selected = true;
- this._trigger( "select", event, {
- item: ui.item.option
- });
- },
- autocompletechange: "_removeIfInvalid"
- });
- },
-
- _createShowAllButton: function() {
- var input = this.input,
- wasOpen = false;
- $( "" )
- .attr( "tabIndex", -1 )
- .appendTo( this.wrapper )
- .removeClass( "ui-corner-all" )
- .addClass( "glyphicon glyphicon-search" )
- .mousedown(function() {
- wasOpen = input.autocomplete( "widget" ).is( ":visible" );
- })
- .click(function() {
- input.focus();
- // Close if already visible
- if ( wasOpen ) {
+ // Pass empty string as value to search for, displaying all results
+ input.autocomplete( "search", "" );
+ });
+ },
+ _source: function( request, response ) {
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
+ var el = this.element;
+ response( this.element.children( "option" ).map(function() {
+ var text = $( this ).text();
+ if ( ( !request.term || matcher.test(text) ) )
+ return {
+ label: text,
+ value: text,
+ option: this,
+ el: el
+ };
+ }
+ ) );
+ },
+
+ _removeIfInvalid: function( event, ui ) {
+ // Selected an item, nothing to do
+ if ( ui.item ) {
return;
}
- // Pass empty string as value to search for, displaying all results
- input.autocomplete( "search", "" );
- });
- },
- _source: function( request, response ) {
- var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
- var el = this.element;
- response( this.element.children( "option" ).map(function() {
- var text = $( this ).text();
- if ( ( !request.term || matcher.test(text) ) )
- return {
- label: text,
- value: text,
- option: this,
- el: el
- };
- }
- ) );
- },
-
- _removeIfInvalid: function( event, ui ) {
- // Selected an item, nothing to do
- if ( ui.item ) {
- return;
- }
- // Search for a match (case-insensitive)
- var value = this.input.val(),
- valueLowerCase = value.toLowerCase(),
- valid = false;
- this.element.children( "option" ).each(function() {
- if ( $( this ).text().toLowerCase() === valueLowerCase ) {
- this.selected = valid = true;
- return false;
+ // Search for a match (case-insensitive)
+ var value = this.input.val(),
+ valueLowerCase = value.toLowerCase(),
+ valid = false;
+ this.element.children( "option" ).each(function() {
+ if ( $( this ).text().toLowerCase() === valueLowerCase ) {
+ this.selected = valid = true;
+ return false;
+ }
+ });
+ // Found a match, nothing to do
+ if ( valid ) {
+ return;
}
- });
- // Found a match, nothing to do
- if ( valid ) {
- return;
+ // Remove invalid value
+ this.input.val( "" );
+ this.element.val( "" );
+ this.input.autocomplete( "instance" ).term = "";
+ },
+ _destroy: function() {
+ this.wrapper.remove();
+ this.element.show();
}
- // Remove invalid value
- this.input.val( "" );
- this.element.val( "" );
- this.input.autocomplete( "instance" ).term = "";
- },
- _destroy: function() {
- this.wrapper.remove();
- this.element.show();
- }
- });
-})( jQuery );
-
+ });
+ })( jQuery );
+}
function cabecalhoMetaestat(id,excluir){
var botao,i,n,temp,
diff --git a/admin1/php/checaLogin.php b/admin1/php/checaLogin.php
index f221267..aaa2c4a 100755
--- a/admin1/php/checaLogin.php
+++ b/admin1/php/checaLogin.php
@@ -73,8 +73,11 @@ function checaLogin(){
exit ();
}
} else {
- header ( "HTTP/1.1 403 Usuario nao logado" );
- //header("Location:");
+ if(defined("ONDEI3GEO")){
+ header("Location:" . ONDEI3GEO . "/admin1/index.php");
+ } else {
+ header ( "HTTP/1.1 403 Usuario nao logado" );
+ }
exit ();
}
// verifica se o login pode ser realizado
diff --git a/classesjs/classe_plugini3geo.js b/classesjs/classe_plugini3geo.js
index 8609489..645b0c4 100755
--- a/classesjs/classe_plugini3geo.js
+++ b/classesjs/classe_plugini3geo.js
@@ -1030,15 +1030,15 @@ i3GEO.pluginI3geo =
config.ativo = "sim";
}
ins += "Abre o formulário quando a camada é adicionada ao mapa: (true ou false)
";
- ins += "";
+ ins += "";
}
ins +=
- "
Título | Chave | Tipo (input ou select) | Valores | PHP que retorna os valores (opcional) |
";
+ "Título | Chave | Tipo (input ou select) | Valores | PHP que retorna os valores (opcional) |
";
for (i = 0; i < n; i++) {
ins +=
""
+ + "";
+ //pega os campos do formulario
+ ins += i3GEO.pluginI3geo.formAdmin(plugin,retorno);
+ var ajuda = " Mais informações: " + i3GEO.pluginI3geo.linkAjuda(plugin) + " ";
+ $i("editor_bd").innerHTML = ins + ajuda;
+
+ new YAHOO.widget.Button("salvarPlugin",{ onclick: { fn: function(){
+ i3GEOF.atalhosedicao.salvarDadosEditorPlugin($i("editor_bd"),plugin,i3GEOF.atalhosedicao.tema,i3GEOF.atalhosedicao.tema);
+ } }});
+
+ new YAHOO.widget.Button("removerPlugin",{ onclick: { fn: function(){
+ i3GEOF.atalhosedicao.salvarDadosEditorPlugin($i("editor_bd"),"",i3GEOF.atalhosedicao.tema,i3GEOF.atalhosedicao.tema);
+ } }});
+ };
+ core_pegaDados("",sUrl,montaEditorPlugin);
+ }
+ }
+ });
+ $i("i3GEOFatalhosedicaoParametrossql-button").style.width = "200px";
+
new YAHOO.widget.Button("i3GEOFatalhosedicaoTemaComGrafico", {
onclick : {
fn : function() {
@@ -258,5 +289,51 @@ i3GEOF.atalhosedicao =
}
tema = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.atalhosedicao.tema);
tema[obj.name] = valor;
+ },
+ salvarDadosEditorPlugin: function(onde,plugin,codigoMap,codigoLayer){
+ var campos = onde.getElementsByTagName("input"),
+ n = campos.length,
+ par = [],
+ prog = i3GEO.configura.locaplic + "/admin1/catalogo/mapfile/exec.php?funcao=gravaPlugin&g_sid="+i3GEO.configura.sid,
+ i;
+ if(plugin != ""){
+ if(!i3GEO.pluginI3geo[plugin].parametrosFormAdmin){
+ for(i=0; i"+ $trad("naoSalva",i3GEOadmin.core.dicionario) +"");
+ setTimeout("core_carregando('desativa')",3000);
+ }
+ else {
+ YAHOO.admin.container.panelEditor.destroy();
+ YAHOO.admin.container.panelEditor = null;
+ core_carregando("desativa");
+ }
+ }
+ catch(e){core_handleFailure(e,o.responseText);}
+ },
+ failure:core_handleFailure,
+ argument: { foo:"foo", bar:"bar" }
+ };
+ core_makeRequest(sUrl,callback,'POST');
}
+
};
diff --git a/ferramentas/atalhosedicao/template_mst.html b/ferramentas/atalhosedicao/template_mst.html
index da108a8..4947dbc 100755
--- a/ferramentas/atalhosedicao/template_mst.html
+++ b/ferramentas/atalhosedicao/template_mst.html
@@ -86,4 +86,9 @@
+
+ {{{plugins}}}
+
+
+
\ No newline at end of file
diff --git a/interface/black_editor.php b/interface/black_editor.php
index 36af3ff..c3f71cc 100755
--- a/interface/black_editor.php
+++ b/interface/black_editor.php
@@ -19,6 +19,8 @@
}
+
+
diff --git a/js/plugini3geo.js b/js/plugini3geo.js
index b2464d3..f4e73eb 100755
--- a/js/plugini3geo.js
+++ b/js/plugini3geo.js
@@ -1023,15 +1023,15 @@ i3GEO.pluginI3geo =
config.ativo = "sim";
}
ins += "Abre o formulário quando a camada é adicionada ao mapa: (true ou false) ";
- ins += "";
+ ins += "";
if (config.ativo === "nao") {
- ins += "";
+ ins += " ";
} else {
- ins += "";
+ ins += "";
}
ins +=
- "Título | Chave | Tipo (input ou select) | Valores | PHP que retorna os valores (opcional) | ";
+ "
|