Commit cc2fd9d7312edfb554d4eb1fe173459d6bb25735
1 parent
f80707e1
Exists in
master
and in
7 other branches
Inclusão da interface de administração
Showing
55 changed files
with
7155 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | +P | |
| 2 | +{text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} | |
| 3 | + | |
| 4 | +legend | |
| 5 | +{font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} | |
| 6 | + | |
| 7 | +.mensagem | |
| 8 | +{color:black;text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} | |
| 9 | + | |
| 10 | +h1 | |
| 11 | +{text-align: left;font-size:15px;font-family: Verdana, Arial, Helvetica, sans-serif;} | |
| 12 | + | |
| 13 | +input | |
| 14 | +{cursor:pointer;} | |
| 15 | + | |
| 16 | +.lista td | |
| 17 | +{border: 1px solid rgb(140,140,140);border-left: 0px;border-right:0px;border-top:0px;padding: 0px;color:#2F4632;margin:0px;text-align:left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;} | |
| 18 | + | |
| 19 | +.lista1 td | |
| 20 | +{cursor:pointer;text-align:left;font-size: 14px;font-family: Verdana, Arial, Helvetica, sans-serif;} | |
| 21 | + | |
| 22 | +.lista1 | |
| 23 | +{text-align:left;} | |
| 24 | +.aplicar | |
| 25 | +{ | |
| 26 | + background-image:URL('../imagens/02.png'); | |
| 27 | + background-repeat: no-repeat; | |
| 28 | + background-position: 0px 0px; | |
| 29 | + cursor:pointer; | |
| 30 | + width: 20px; | |
| 31 | + height: 20px; | |
| 32 | +} | |
| 33 | +.excluir | |
| 34 | +{ | |
| 35 | + background-image:URL('../imagens/01.png'); | |
| 36 | + background-repeat: no-repeat; | |
| 37 | + background-position: 0px 0px; | |
| 38 | + cursor:pointer; | |
| 39 | + width: 20px; | |
| 40 | + height: 20px; | |
| 41 | +} | |
| 42 | +.mostrar | |
| 43 | +{ | |
| 44 | + background-image:URL('../imagens/03.png'); | |
| 45 | + background-repeat: no-repeat; | |
| 46 | + background-position: 0px 0px; | |
| 47 | + cursor:pointer; | |
| 48 | + width: 20px; | |
| 49 | + height: 20px; | |
| 50 | +} | |
| 51 | +.ajuda | |
| 52 | +{ | |
| 53 | + background-image:URL('../imagens/04.png'); | |
| 54 | + background-repeat: no-repeat; | |
| 55 | + background-position: 0px 0px; | |
| 56 | + cursor:pointer; | |
| 57 | + width: 20px; | |
| 58 | + height: 15px; | |
| 59 | +} | |
| 60 | +.textoAjuda | |
| 61 | +{ | |
| 62 | + color:black;text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif; | |
| 63 | +} | |
| 64 | +.fieldsetRaiz | |
| 65 | +{background-color:rgb(252,210,186);} | |
| 66 | +#fieldset | |
| 67 | +{ | |
| 68 | +text-align:left; | |
| 69 | + | |
| 70 | +} | |
| 0 | 71 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,41 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/atlas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - Atlas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite editar a lista de Atlas</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>Parâmetros:</p> | |
| 19 | +<p>ícone - endereço da imagem que será utilizada para identificar o mapa ou prancha | |
| 20 | +<p>link - link na internet que será aberto em uma janela dentro do atlas ou prancha | |
| 21 | +<p>template - arquivo HTMML de configuração do i3geo que será utilizado. Se não especificado, será utilizado o default. | |
| 22 | +<p>extensão - extensão geográfica que será utilizada em cada prancha, no formato xmin ymin xmax ymax. | |
| 23 | +<p>mapfile base - arquivo mapfile que será utilizado como base para montagem do atlas. Utilize o caminho completo no servidor. | |
| 24 | +</div> | |
| 25 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 26 | +</body> | |
| 27 | +<script> | |
| 28 | +/* | |
| 29 | +Title: Administração do Atlas | |
| 30 | + | |
| 31 | +File: i3geo/admin/atlas.htm | |
| 32 | +*/ | |
| 33 | +var cp = new cpaint(); | |
| 34 | +//cp.set_async(false); | |
| 35 | +cp.set_response_type("JSON"); | |
| 36 | +temas = function(retorno){$temas = retorno.data;iniciaAdmin()} | |
| 37 | +var p = "menutemas.php?funcao=pegaTemas"; | |
| 38 | +cp.call(p,"pegaMenus",temas); | |
| 39 | +document.getElementById("aguarde").style.display="none" | |
| 40 | +</script> | |
| 41 | +</html> | |
| 0 | 42 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/atlas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - importação de XML</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa importa as definições do menu de temas armazenadas em um arquivo XML</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +</div> | |
| 16 | +<p>Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo. | |
| 17 | +<p>Por padrão, o arquivo utilizado é i3geo/menutemas/atlas.xml</p><br> | |
| 18 | +<input type=text size=50 id=arquivo /> | |
| 19 | +<input type=button value="Importar" onclick="importarXmlAtlas()"/> | |
| 20 | +<div id=resultado ></div> | |
| 21 | +</body> | |
| 22 | +</html> | |
| 0 | 23 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,87 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/arvore.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - menu de temas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite editar as árvores de cada menu</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>Utilize as opções abaixo para relacionar os temas a grupos e sub-grupos. Escolha primeiro um menu e depois edite | |
| 19 | +os grupos, adicionando temas ou sub-grupos. A estrutura é hierárquica e permite que temas sejam criados também na raiz de um grupo ou do próprio menu. | |
| 20 | +<p>Os grupos, sub-grupos e temas já devem ter sido criados para que se possa montar a árvore de associações. | |
| 21 | +</div> | |
| 22 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 23 | +</body> | |
| 24 | +<script> | |
| 25 | +/* | |
| 26 | +Title: Administração da árvore de menus | |
| 27 | + | |
| 28 | +File: i3geo/admin/i3geoadmin_arvore.htm | |
| 29 | +*/ | |
| 30 | +$parametros = { | |
| 31 | + "simples": [ | |
| 32 | + { mensagem: "Edição das árvores dos menus",cabeca: "Raiz",variavel:"arvores"} | |
| 33 | + ]}; | |
| 34 | + | |
| 35 | +var iniciaMenu = function(retorno) | |
| 36 | +{ | |
| 37 | + pegaParametros() | |
| 38 | + iniciaAdmin() | |
| 39 | + if(retorno.data == "" || retorno.data.length == 0) | |
| 40 | + {document.body.innerHTML += "Nenhum menu cadastrado."} | |
| 41 | + else | |
| 42 | + { | |
| 43 | + var ins = "<p><b>Selecione o menu:</b> " | |
| 44 | + ins += "<select id=menusel onchange='pegaParametros();listaRaiz()' >" | |
| 45 | + ins += "<option value='' >---</option>" | |
| 46 | + for(var i = 0;i < retorno.data.length;i++) | |
| 47 | + { | |
| 48 | + ins += "<option value='"+retorno.data[i].id_menu+"' >"+retorno.data[i].nome_menu+"</option>" | |
| 49 | + } | |
| 50 | + ins += "</select><hr>" | |
| 51 | + document.body.innerHTML += ins; | |
| 52 | + } | |
| 53 | +} | |
| 54 | +var cp = new cpaint(); | |
| 55 | +//cp.set_async(false); | |
| 56 | +cp.set_response_type("JSON"); | |
| 57 | +//pega os menus | |
| 58 | +var p = "menutemas.php?funcao=pegaMenus"; | |
| 59 | +cp.call(p,"pegaMenus",iniciaMenu); | |
| 60 | +//pega os grupos e subgrupos | |
| 61 | + | |
| 62 | +grupos = function(retorno){$grupos = retorno.data;} | |
| 63 | +subGrupos = function(retorno){$subGrupos = retorno.data;}; | |
| 64 | +temas = function(retorno){$temas = retorno.data;} | |
| 65 | +temasRaiz = function(retorno){$temasRaiz = retorno.data;} | |
| 66 | + | |
| 67 | +function pegaParametros() | |
| 68 | +{ | |
| 69 | + var cp = new cpaint(); | |
| 70 | + //cp.set_async(false); | |
| 71 | + cp.set_response_type("JSON"); | |
| 72 | + var p = "menutemas.php?funcao=pegaGrupos"; | |
| 73 | + cp.call(p,"pegaMenus",grupos); | |
| 74 | + | |
| 75 | + var p = "menutemas.php?funcao=pegaSubGrupos"; | |
| 76 | + cp.call(p,"pegaMenus",subGrupos); | |
| 77 | + | |
| 78 | + var p = "menutemas.php?funcao=pegaTemas"; | |
| 79 | + cp.call(p,"pegaMenus",temas); | |
| 80 | + | |
| 81 | + var p = "arvore.php?funcao=pegaTemasRaiz"; | |
| 82 | + cp.call(p,"pegaMenus",temasRaiz); | |
| 83 | +} | |
| 84 | + | |
| 85 | +document.getElementById("aguarde").style.display="none" | |
| 86 | +</script> | |
| 87 | +</html> | |
| 0 | 88 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/menutemas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - menu de temas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite editar a lista de grupos</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +</div> | |
| 19 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 20 | +</body> | |
| 21 | +<script> | |
| 22 | +/* | |
| 23 | +Title: Administração da lista de grupos do menu de temas | |
| 24 | + | |
| 25 | +File: i3geo/admin/i3geoadmin_grupos.htm | |
| 26 | +*/ | |
| 27 | +$parametros = { | |
| 28 | + "simples": [ | |
| 29 | + { mensagem: "Adicione, altere ou elimine grupos cadastrados",cabeca: "Grupos",variavel:"grupos"} | |
| 30 | + ]}; | |
| 31 | +iniciaAdmin() | |
| 32 | +document.getElementById("aguarde").style.display="none" | |
| 33 | +</script> | |
| 34 | +</html> | |
| 0 | 35 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/menutemas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - importação de menu XML</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa importa as definições do menu de temas armazenadas em um arquivo XML</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +</div> | |
| 16 | +<p>Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo | |
| 17 | +<p>Por padrão, o arquivo utilizado é i3geo/menutemas/menutemas.xml</p> | |
| 18 | +<input type=text size=50 id=arquivo /> | |
| 19 | +<p>Nome do novo menu:</p> | |
| 20 | +<input type=text size=50 id=nome /><br><br> | |
| 21 | +<input type=button value="Importar" onclick="importarXmlMenu()"/> | |
| 22 | +<div id=resultado ></div> | |
| 23 | +</body> | |
| 24 | +</html> | |
| 0 | 25 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/menutemas.js" type="text/javascript"></script> | |
| 8 | + | |
| 9 | +</head> | |
| 10 | +<body> | |
| 11 | +<div style=width:80%;text-align:center;> | |
| 12 | +<h1>Administração do i3geo - menu de temas</h1> | |
| 13 | +<p><a href="../index.html">Voltar</a></p> | |
| 14 | +<p>Este programa permite editar a lista de menus</p> | |
| 15 | +<p>Você pode criar vários menus e depois acrescentar grupos, subgrupos e temas em cada um. | |
| 16 | +A lista de menus que serão utilizados no i3geo é definida no arquivo ms_configura.php. | |
| 17 | +<p>O menu é baseado no banco admin.db.</p> | |
| 18 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 19 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 20 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 21 | +</div> | |
| 22 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 23 | +</body> | |
| 24 | +<script> | |
| 25 | +/* | |
| 26 | +Title: Administração da lista de menus do menu de temas | |
| 27 | + | |
| 28 | +File: i3geo/admin/i3geoadmin_menus.htm | |
| 29 | +*/ | |
| 30 | +$parametros = { | |
| 31 | + "simples": [ | |
| 32 | + { mensagem: "Adicione, altere ou elimine menus cadastrados",cabeca: "Menus",variavel:"menus"} | |
| 33 | + ]}; | |
| 34 | +iniciaAdmin() | |
| 35 | +document.getElementById("aguarde").style.display="none" | |
| 36 | +</script> | |
| 37 | +</html> | |
| 0 | 38 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/menutemas.js" type="text/javascript"></script> | |
| 8 | + | |
| 9 | +</head> | |
| 10 | +<body> | |
| 11 | +<div style=width:80%;text-align:center;> | |
| 12 | +<h1>Administração do i3geo - menu de temas</h1> | |
| 13 | +<p><a href="../index.html">Voltar</a></p> | |
| 14 | +<p>Este programa permite editar a lista de sub-grupos</p> | |
| 15 | +<p>O menu é baseado no banco admin.db.</p> | |
| 16 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 17 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 18 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 19 | +</div> | |
| 20 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 21 | +</body> | |
| 22 | +<script> | |
| 23 | +/* | |
| 24 | +Title: Administração da lista de sub-grupos do menu de temas | |
| 25 | + | |
| 26 | +File: i3geo/admin/i3geoadmin_subgrupos.htm | |
| 27 | +*/ | |
| 28 | +$parametros = { | |
| 29 | + "simples": [ | |
| 30 | + { mensagem: "Adicione, altere ou elimine sub-grupos cadastrados",cabeca: "Sub-grupos",variavel:"subgrupos"} | |
| 31 | + ]}; | |
| 32 | +iniciaAdmin() | |
| 33 | +document.getElementById("aguarde").style.display="none" | |
| 34 | +</script> | |
| 35 | +</html> | |
| 0 | 36 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/menutemas.js" type="text/javascript"></script> | |
| 8 | + | |
| 9 | +</head> | |
| 10 | +<body> | |
| 11 | +<div style=width:80%;text-align:center;> | |
| 12 | +<h1>Administração do i3geo - menu de temas</h1> | |
| 13 | +<p><a href="../index.html">Voltar</a></p> | |
| 14 | +<p>Este programa permite editar a lista de tags (palavras-chave)</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +</div> | |
| 19 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 20 | +</body> | |
| 21 | +<script> | |
| 22 | +/* | |
| 23 | +Title: Administração da lista de menus do menu de temas | |
| 24 | + | |
| 25 | +File: i3geo/admin/i3geoadmin_tags.htm | |
| 26 | +*/ | |
| 27 | +$parametros = { | |
| 28 | + "simples": [ | |
| 29 | + { mensagem: "Adicione, altere ou elimine tags cadastrados",cabeca: "Tags",variavel:"tags"} | |
| 30 | + ]}; | |
| 31 | +iniciaAdmin() | |
| 32 | +document.getElementById("aguarde").style.display="none" | |
| 33 | +</script> | |
| 34 | +</html> | |
| 0 | 35 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,51 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/menutemas.js" type="text/javascript"></script> | |
| 8 | + | |
| 9 | +</head> | |
| 10 | +<body> | |
| 11 | +<div style=width:80%;text-align:center;> | |
| 12 | +<h1>Administração do i3geo - menu de temas</h1> | |
| 13 | +<p><a href="../index.html">Voltar</a></p> | |
| 14 | +<p>Este programa permite editar a lista de temas</p> | |
| 15 | +<p>O menu é baseado no banco admin.db.</p> | |
| 16 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 17 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 18 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 19 | +<p>Os temas são relacionados aos mapfiles existentes no diretório i3geo/temas. Cada tema recebe um nome que será mostrado | |
| 20 | +na árvore de temas. Após a criação dos temas, você pode criar a árvore de temas, associando-os a menus, grupos e sub-grupos. | |
| 21 | +</div> | |
| 22 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 23 | +</body> | |
| 24 | +<script> | |
| 25 | +/* | |
| 26 | +Title: Administração da lista de temas do menu de temas | |
| 27 | + | |
| 28 | +File: i3geo/admin/i3geoadmin_temas.htm | |
| 29 | +*/ | |
| 30 | +$parametros = { | |
| 31 | + "simples": [ | |
| 32 | + { mensagem: "Adicione, altere ou elimine temas cadastrados",cabeca: "Temas",variavel:"temas"} | |
| 33 | + ]}; | |
| 34 | +var inicia = function(retorno) | |
| 35 | +{ | |
| 36 | + $listaTags = retorno.data; | |
| 37 | + iniciaAdmin() | |
| 38 | +} | |
| 39 | +var listaTags = function(retorno) | |
| 40 | +{ | |
| 41 | + $listaDeMapfiles = retorno.data; | |
| 42 | + var cPaint = new cpaint(); | |
| 43 | + //cPaint.set_async("true"); | |
| 44 | + cPaint.set_response_type("JSON"); | |
| 45 | + var p = "menutemas.php?funcao=pegaTags"; | |
| 46 | + cPaint.call(p,"pegaTags",inicia); | |
| 47 | +} | |
| 48 | +pegaMapfiles(listaTags) | |
| 49 | +document.getElementById("aguarde").style.display="none" | |
| 50 | +</script> | |
| 51 | +</html> | |
| 0 | 52 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/identifica.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - sistemas de identificação</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite editar o cadastro de sistemas utilizados na ferramenta de identificação</p> | |
| 14 | +<p>A lista é baseada no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>O item programa define a URL que será chamada quando o usuário clica em um ponto no mapa. | |
| 19 | +A ferramenta de identificação irá acrescentar ao final da URL os parâmetros "x" e "y", correspondentes | |
| 20 | +às coordenadas do ponto clicado no mapa. | |
| 21 | +</div> | |
| 22 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 23 | +</body> | |
| 24 | +<script> | |
| 25 | +/* | |
| 26 | +Title: Administração do cadastro de sistemas da ferramenta de identificação | |
| 27 | + | |
| 28 | +File: i3geo/admin/identifica.htm | |
| 29 | +*/ | |
| 30 | +iniciaAdmin() | |
| 31 | +document.getElementById("aguarde").style.display="none" | |
| 32 | +</script> | |
| 33 | +</html> | |
| 0 | 34 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/identifica.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - importação da lista de funções da ferramenta identifica</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa importa as definições das funções armazenadas em um arquivo XML</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +</div> | |
| 16 | +<p>Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo<p> | |
| 17 | +<p>Os arquivos default do i3geo são (em i3geo/menutemas): identifica.xml</p> | |
| 18 | +<input type=text size=50 id=arquivo /> | |
| 19 | +<br> | |
| 20 | +<br> | |
| 21 | +<input type=button value="Importar" onclick="importarXmlI()"/> | |
| 22 | +<div id=resultado ></div> | |
| 23 | + | |
| 24 | +</body> | |
| 25 | +</html> | |
| 0 | 26 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/mapas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - mapas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite editar a lista de mapas</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>Parâmetros:</p> | |
| 19 | +<p>Extensão: extensão geográfica no formato xmin ymin xmax ymax</p> | |
| 20 | +<p>Imagem: link para a imagem miniatura</p> | |
| 21 | +<p>Direto: link direto com todos os parâmetros de abertura do mapa. Se for usado, os outros parâmetros são desconsiderados</p> | |
| 22 | +<p>Outros: outros parâmetros que podem ser utilizados pelo ms_criamapa.php. São encadeados no final da URL de montagem do mapa.</p> | |
| 23 | +<p>Temas: códigos dos temas que serão mostrados no mapa</p> | |
| 24 | +<p>Ligados: códigos dos temas que estarão ligados no mapa (visíveis). Os códigos devem constar no item Temas</p> | |
| 25 | +<p>Perfil: lista de perfis de usuários que podem ver o mapa. Separe com vírgulas</p> | |
| 26 | +</div> | |
| 27 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 28 | +</body> | |
| 29 | +<script> | |
| 30 | +/* | |
| 31 | +Title: Administração da lista de mapas | |
| 32 | + | |
| 33 | +File: i3geo/admin/mapas.htm | |
| 34 | +*/ | |
| 35 | +var cp = new cpaint(); | |
| 36 | +//cp.set_async(false); | |
| 37 | +cp.set_response_type("JSON"); | |
| 38 | +temas = function(retorno){$temas = retorno.data;iniciaAdmin()} | |
| 39 | +var p = "menutemas.php?funcao=pegaTemas"; | |
| 40 | +cp.call(p,"pegaMenus",temas); | |
| 41 | +document.getElementById("aguarde").style.display="none" | |
| 42 | +</script> | |
| 43 | +</html> | |
| 0 | 44 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/mapas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - importação da lista de mapas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa importa as definições do menu de temas armazenadas em um arquivo XML</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +</div> | |
| 16 | +<p>Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo. Por padrão, o i3geo utiliza o arquivo menutemas/mapas.xml<p> | |
| 17 | +<input type=text size=50 id=arquivo /> | |
| 18 | +<input type=button value="Importar" onclick="importarXmlMapas()"/> | |
| 19 | +<div id=resultado ></div> | |
| 20 | +</body> | |
| 21 | +</html> | |
| 0 | 22 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 5 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/mapfiles.js" type="text/javascript"></script> | |
| 8 | + | |
| 9 | +</head> | |
| 10 | +<body> | |
| 11 | +<div style=width:80%;text-align:center;> | |
| 12 | +<h1>Administração do i3geo - mapfiles principais</h1> | |
| 13 | +<p><a href="../index.html">voltar</a></p> | |
| 14 | +<p>Este programa permite alterar as configurações básicas dos arquivos mapfile existentes em i3geo/aplicmap</p> | |
| 15 | +<p>Esses arquivos são os mapas básicos utilizados pelo i3geo na inicialização.</p> | |
| 16 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 17 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 18 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 19 | +</div> | |
| 20 | + | |
| 21 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 22 | +<br> | |
| 23 | +<input onclick="restauraPadrao()" type=button value="Restaura os valores padrão" /><br><br> | |
| 24 | +<input onclick="javascript:window.open('../testainstal.php')" type=button value="Testar a instalação" /><br><br> | |
| 25 | + | |
| 26 | +</body> | |
| 27 | +<script> | |
| 28 | +/* | |
| 29 | +Title: Administração dos mapfiles básicos | |
| 30 | + | |
| 31 | +File: i3geo/admin/mapfiles.htm | |
| 32 | +*/ | |
| 33 | +iniciaAdmin() | |
| 34 | +document.getElementById("aguarde").style.display="none" | |
| 35 | + | |
| 36 | +</script> | |
| 37 | +</html> | |
| 0 | 38 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/ms_configura.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - ms_configura.php</h1> | |
| 12 | +<p><a href="../index.html">voltar</a></p> | |
| 13 | +<p>Este programa permite alterar as variáveis de configuração existentes no programa ms_configura.php</p> | |
| 14 | +<p>O ms_configura.php é utilizado como um "include" nos programas do i3geo, definindo uma série de parâmetros necessários ao seu funcionamento.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>Da mesma forma, a variável $menutemas não pode ser modificada nesse formulário. Por padrão, essa variável é definida como vazia, forçando o i3geo a montar a árvore de camadas utilizando o banco de dados administrativo.</p> | |
| 19 | +<p>Se você quer utilizar um outro mecanismo de montagem do menu de temas, edite manualmente o arquivo ms_configura.php. | |
| 20 | +</div> | |
| 21 | + | |
| 22 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 23 | +<br> | |
| 24 | +<input onclick="restauraPadrao()" type=button value="Restaura os valores padrão" /><br><br> | |
| 25 | +<input onclick="javascript:window.open('../testainstal.php')" type=button value="Testar a instalação" /><br><br> | |
| 26 | + | |
| 27 | +</body> | |
| 28 | +<script> | |
| 29 | +/* | |
| 30 | +Title: Administração do ms_configura.php | |
| 31 | + | |
| 32 | +Administração das variáveis de configuração existentes no programa i3geo/ms_configura.php | |
| 33 | + | |
| 34 | +File: i3geo/admin/ms_configura.htm | |
| 35 | +*/ | |
| 36 | +iniciaAdmin() | |
| 37 | + | |
| 38 | +</script> | |
| 39 | +</html> | |
| 0 | 40 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,33 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/sistemas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body style=background-color:white > | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - sistemas especiais</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite editar a lista de sistemas especiais que adicionam camadas ao mapa</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>A lista de perfis deve ser sepada por ",". Em abrir programa, inclua o endereço no servidro | |
| 19 | +do programa que será aberto em umajanela no i3geo. Cada sistema pode ter uma ou mais funções, que serão mostradas | |
| 20 | +em uma árvore hierárquica no i3geo.</p> | |
| 21 | +</div> | |
| 22 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 23 | +</body> | |
| 24 | +<script> | |
| 25 | +/* | |
| 26 | +Title: Administração do cadastro de sistemas especiais | |
| 27 | + | |
| 28 | +File: i3geo/admin/sistemas.htm | |
| 29 | +*/ | |
| 30 | +iniciaAdmin() | |
| 31 | +document.getElementById("aguarde").style.display="none" | |
| 32 | +</script> | |
| 33 | +</html> | |
| 0 | 34 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/sistemas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - importação da lista de sistemas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa importa as definições dos sistemas e funções armazenadas em um arquivo XML</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +</div> | |
| 16 | +<p>Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo<p> | |
| 17 | +<p>O arquivo default do i3geo é i3geo/menutemas/sistemas.xml</p> | |
| 18 | +<input type=text size=50 id=arquivo /> | |
| 19 | +<br> | |
| 20 | +<input type=button value="Importar" onclick="importarXmlSistemas()"/> | |
| 21 | +<div id=resultado ></div> | |
| 22 | + | |
| 23 | +</body> | |
| 24 | +</html> | |
| 0 | 25 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/temas.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - Temas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite criar ou editar os arquivos mapfile que compõem temas no i3geo.</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>A lista de arquivos editáveis é baseada no banco de dados administrativo. Para que um arquivo apareça na | |
| 19 | +listagem, ele deve ter sido incluído no banco por meio da opção "Editar a lista de temas"</p> | |
| 20 | + | |
| 21 | +</div> | |
| 22 | +<fieldset> | |
| 23 | + <legend>Arquivo em edição</legend> | |
| 24 | + <p>Escolha o arquivo para editar (a lista de arquivos é baseada no banco de dados administrativo)</p> | |
| 25 | + <div id=arquivoAtivo ><p style=color:red >Aguarde...</p></div> | |
| 26 | + <p><input onclick=testarMap() type=button value="Testar" /></p> | |
| 27 | + | |
| 28 | + <p>Ou crie um novo (o código é uma palavra sem espaços que identifica o arquivo de forma única dentro do diretório i3geo/temas):</p> | |
| 29 | + <p>Código:</p> | |
| 30 | + <p><input type=text size=20 value="" id=codigoNovoMap /></p> | |
| 31 | + <p>Nome:</p> | |
| 32 | + <p><input type=text size=20 value="" id=nomeNovoMap /></p> | |
| 33 | + <p><input onclick=criarNovoMap() type=button value="Criar" id=nomeNovoMap /></p> | |
| 34 | +</fieldset> | |
| 35 | +<p><input onclick=adicionarLayer() type=button value="Adicionar um novo layer" /></p> | |
| 36 | +<div id=forms style=display:none ></div> | |
| 37 | + | |
| 38 | + | |
| 39 | +</body> | |
| 40 | +<script> | |
| 41 | +iniciaAdmin() | |
| 42 | +</script> | |
| 43 | +</html> | |
| 0 | 44 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/webservices.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - cadastro de web services</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa permite editar o cadastro de web services</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
| 16 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
| 17 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
| 18 | +<p>Tipos:</p> | |
| 19 | +<p>WS - web service convencional utilizado no cliente de web service (i3geo/wscliente.htm)></p> | |
| 20 | +<p>WMS - web map service, utilizado na ferramenta de conexão com servidor remoto e no cliente de web service</p> | |
| 21 | +<p>GEORSS - RSS com padrão GEO, utilizado na ferramenta de adição de temas baseados em GEORSS</p> | |
| 22 | +<p>DOWNLOAD - endereço que será adicionado na aplicação datadownload.htm. Trata-se de um link para endereço na web com dados para download. | |
| 23 | +</div> | |
| 24 | +<div id=aguarde style="color:red" ><p>Aguarde...</p></div> | |
| 25 | +</body> | |
| 26 | +<script> | |
| 27 | +/* | |
| 28 | +Title: Administração do cadastro de web services | |
| 29 | + | |
| 30 | +File: i3geo/admin/webservices.htm | |
| 31 | +*/ | |
| 32 | +tipos = ['WS','WMS','WFS','GEORSS','DOWNLOAD'] | |
| 33 | +iniciaAdmin() | |
| 34 | +document.getElementById("aguarde").style.display="none" | |
| 35 | +</script> | |
| 36 | +</html> | |
| 0 | 37 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,31 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="admin.css"> | |
| 5 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="../js/admin.js" type="text/javascript"></script> | |
| 7 | +<script src="../js/webservices.js" type="text/javascript"></script> | |
| 8 | +</head> | |
| 9 | +<body> | |
| 10 | +<div style=width:80%;text-align:center;> | |
| 11 | +<h1>Administração do i3geo - importação da lista de mapas</h1> | |
| 12 | +<p><a href="../index.html">Voltar</a></p> | |
| 13 | +<p>Este programa importa as definições dos webservices armazenadas em um arquivo XML</p> | |
| 14 | +<p>O menu é baseado no banco admin.db.</p> | |
| 15 | +</div> | |
| 16 | +<p>Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo<p> | |
| 17 | +<p>Os arquivos default do i3geo são (em i3geo/menutemas): servicosgeorss.xml, servicosws.xml, servicoswms.xml e linksdownload.xml</p> | |
| 18 | +<input type=text size=50 id=arquivo /> | |
| 19 | +<br> | |
| 20 | +<select id=tipo > | |
| 21 | + <option value="">---</option> | |
| 22 | + <option value="WS">WS</option> | |
| 23 | + <option value="WMS">WMS</option> | |
| 24 | + <option value="GEORSS">GeoRSS</option> | |
| 25 | + <option value="DOWNLOAD">Link para download</option> | |
| 26 | +</select> | |
| 27 | +<input type=button value="Importar" onclick="importarXmlWS()"/> | |
| 28 | +<div id=resultado ></div> | |
| 29 | + | |
| 30 | +</body> | |
| 31 | +</html> | |
| 0 | 32 | \ No newline at end of file | ... | ... |
570 Bytes
481 Bytes
675 Bytes
383 Bytes
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +<html> | |
| 2 | +<body> | |
| 3 | +<script> | |
| 4 | +/* | |
| 5 | +Title: Redirecionador para o index.html | |
| 6 | + | |
| 7 | +Redireciona o navegador para o index.html | |
| 8 | + | |
| 9 | +File: i3geo/admin/index.htm | |
| 10 | +*/ | |
| 11 | + | |
| 12 | +window.location="index.html" | |
| 13 | +</script> | |
| 14 | +</body> | |
| 15 | +</html> | |
| 0 | 16 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,200 @@ |
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
| 4 | +<link rel="stylesheet" type="text/css" href="html/admin.css"> | |
| 5 | +<script src="../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
| 6 | +<script src="js/admin.js" type="text/javascript"></script> | |
| 7 | +</head> | |
| 8 | +<body> | |
| 9 | +<div style=width:80%;text-align:left;> | |
| 10 | +<h1>Administração do i3geo</h1> | |
| 11 | +<div id=indice ></div> | |
| 12 | + | |
| 13 | +<fieldset> | |
| 14 | +<legend>Observações</legend> | |
| 15 | +<p>Para mais informações sobre a administração do i3geo, veja a documentação no <a href="www.softwarepublico.gov.br">Portal do Software Público Brasileiro (PSPB).</a> | |
| 16 | +Você precisará se inscrever no Portal e ingressar na comunidade i3geo. Na página da comunidade, existem vários documentos que explicam como instalar e configurar o i3geo.</p> | |
| 17 | +<p>De forma geral, você deverá seguir as seguintes etapas na configuração:</p> | |
| 18 | +<p>1 - instalação e configuração | |
| 19 | +<p>2 - criação das camadas (layers) | |
| 20 | +<p>3 - organização das camadas em grupos e sub-grupos | |
| 21 | +<p>4 - configuração de mapas e atlas | |
| 22 | +<p>5 - edição do cadastro de web services e sistemas especiais | |
| 23 | +<p>6 - customização das ferramentas e interface | |
| 24 | +<p>Antes da versão 4.0 o i3geo utilizava arquivos armazenados em disco (arquivos XML) para organizar | |
| 25 | +as camadas e outras listagens. | |
| 26 | +Com a nova estrutura de administração, esses arquivos podem ser substituídos por registros em bancos de dados. | |
| 27 | +Se você opotar por usar um banco de dados, os arquivos antigos poderão ser importados para o banco (veja as opções de importação abaixo).</p> | |
| 28 | +<p>Para possibilitar a distribuição do i3geo de forma independente de banco de dados, optou-se pelo uso do gerenciador | |
| 29 | +SQLITE, cujo arquivo com os dados fica armazenado em i3geo/menutemas/admin.db. Os programas em PHP que gerenciam esse banco | |
| 30 | +utilizam o pacote PDO, possibilitando que seja utilizado outro gerenciador, como o POSTGRESQL, entre outros.</p> | |
| 31 | +<p>Para modificar a configuração do PDO, e utilizar outro gerenciador, deve-se editar o arquivo i3geo/admin/conexao.php | |
| 32 | +ou então alterar a variável de configuração, definida no ms_configura.php, chamada $conexaoadmin. Essa variável indica o nome de um | |
| 33 | +programa em PHP que será incluído nos programas que fazem acesso ao banco de dados de administração. Um exemplo de | |
| 34 | +conexão em PHP pode ser visto em i3geo/admin/conexaomma.php.</p> | |
| 35 | +<p>Para usar um gerenciador diferente do SQLITE é necessário criar as tabelas no novo banco de dados. Os sqls para | |
| 36 | +essa criação podem ser obtidos no item "Outras opções".</p> | |
| 37 | +<p>Apesar do uso de um banco de dados, o acesso aos registros pelo i3geo continua sendo feito por meio de arquivos XML. | |
| 38 | +O controle sobre a fonte desses XMLs é feito por meio da definição de variáveis armazenadas no arquivo i3geo/ms_configura.php. | |
| 39 | +Quando se utiliza a estrutura padrão das tabelas, como pode ser visto no banco SQLITE, o i3geo fornece programas PHP | |
| 40 | +que geram os arquivos XML em sua formatação correta (veja os arquivos XML existentes no diretório i3geo/menutemas). | |
| 41 | +Caso você queira utilizar uma estrutura de banco de dados diferente, será necessário criar os programas em PHP para a geração | |
| 42 | +dos arquivos XML. | |
| 43 | +</fieldset> | |
| 44 | +<br> | |
| 45 | +<fieldset> | |
| 46 | +<legend>Configuração geral</legend> | |
| 47 | +<div id=a1 style=display:none;background-color:beige > | |
| 48 | + <p>Após instalar o i3geo, tente abrí-lo no navegador e faça o teste de instalação para ver se está tudo funcionando bem.</p> | |
| 49 | + <p>Caso seja identificado algum problema, experimente alterar as variáveis de configuração e os parâmetros dos arquivos mapfiles utilizados na inicialização do i3geo.</p> | |
| 50 | + <p>Problemas no funcionamento do i3geo geralmente está associado a problemas no ambiente web. Verifique na documentação do i3geo os itens referentes à instalação e o fórum.</p> | |
| 51 | +</div> | |
| 52 | +<table class=lista1 > | |
| 53 | +<tr onclick="ajuda('a1',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 54 | +<tr onclick="abre('../ms_criamapa.php')"><td><div class=aplicar ></div></td><td>Abrir o i3geo</td></tr> | |
| 55 | +<tr onclick="abre('../testainstal.php')" ><td><div class=aplicar ></div></td><td>Testar a instalação do i3geo (testainstal.php)</td></tr> | |
| 56 | +<tr onclick="abre('html/ms_configura.html')"><td><div class=aplicar ></div></td><td>Editar variáveis de configuração (ms_configura.php)</td></tr> | |
| 57 | +<tr onclick="abre('html/mapfiles.html')"><td><div class=aplicar ></div></td><td>Editar os arquivos mapfile básicos utilizados na inicialização</td></tr> | |
| 58 | +</table> | |
| 59 | +</fieldset> | |
| 60 | +<br> | |
| 61 | +<fieldset> | |
| 62 | +<legend>Editor de temas</legend> | |
| 63 | +<div id=a8 style=display:none;background-color:beige > | |
| 64 | + <p>As camadas disponíveis no i3geo são mantidas em arquivos na estrutura mapfile armazenados no diretório i3geo/temas | |
| 65 | + <p>Esses arquivos são utilizados na formação da árvore de adição de temas e em vários aplicativos do i3geo. | |
| 66 | + <p>São nesses arquivos que são definidas as características de cada camada, como acesso aos dados, legenda, etc. | |
| 67 | +</div> | |
| 68 | +<table class=lista1 > | |
| 69 | +<tr onclick="ajuda('a8',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 70 | +<tr onclick="abre('temas.html')"><td><div class=aplicar ></div></td><td>Edição</td></tr> | |
| 71 | +</table> | |
| 72 | +</fieldset> | |
| 73 | +<br> | |
| 74 | +<fieldset> | |
| 75 | +<legend>Edição das tabelas auxiliares e do menu de adição de temas</legend> | |
| 76 | +<div id=a2 style=display:none;background-color:beige > | |
| 77 | + <p>Para editar o menu de temas é necessário primeiro ter a lista de grupos, sub-grupos e temas. Essas listas são utilizadas para compor a árvore hierárquica de temas, onde grupos contém sub-grupos | |
| 78 | +que por sua vez contém temas.</p> | |
| 79 | + <p>Com base nas listas, é feita a montagem da hierarquia da árvore de menus.</p> | |
| 80 | + <p>O menu de temas é utilizado na guia "adiciona" do i3geo e nas aplicações de download de dados, gerador de kml e gerador de webservices ogc.</p> | |
| 81 | + <p>Por padrão, o i3geo utiliza arquivos xml armazenados em disco para compor o menu. Se você quiser continuar utilizando esses arquivos, não será possível utilizar esse administrador, uma vez que este utiliza um banco de dados para guardar os parâmetros necessários à montagem da árvore.</p> | |
| 82 | + <p>Os menus que serão utilizados no i3geo são especificados no arquivo i3geo/ms_configura.php, na variável $menutemas. Por padrão, essa variável é definida como vazia, forçando a busca pelos menus no banco de dados de administração.</p> | |
| 83 | +</div> | |
| 84 | +<table class=lista1 > | |
| 85 | +<tr onclick="ajuda('a2',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 86 | +<tr onclick="abre('html/i3geoadmin_tags.html')"><td><div class=aplicar ></div></td><td>Editar a lista de tags (palavras-chave)</td></tr> | |
| 87 | +<tr onclick="abre('html/i3geoadmin_menus.html')"><td><div class=aplicar ></div></td><td>Editar a lista de menus</td></tr> | |
| 88 | +<tr onclick="abre('html/i3geoadmin_grupos.html')"><td><div class=aplicar ></div></td><td>Editar a lista de grupos</td></tr> | |
| 89 | +<tr onclick="abre('html/i3geoadmin_subgrupos.html')"><td><div class=aplicar ></div></td><td>Editar a lista de sub-grupos</td></tr> | |
| 90 | +<tr onclick="abre('html/i3geoadmin_temas.html')"><td><div class=aplicar ></div></td><td>Editar a lista de temas</td></tr> | |
| 91 | +<tr onclick="abre('html/i3geoadmin_arvore.html')"><td><div class=aplicar ></div></td><td>Editar a árvore dos menus</td></tr> | |
| 92 | +<tr onclick="abre('html/i3geoadmin_importarmenu.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr> | |
| 93 | +</table> | |
| 94 | +</fieldset> | |
| 95 | +<br> | |
| 96 | +<fieldset> | |
| 97 | +<legend>Mapas</legend> | |
| 98 | +<div id=a3 style=display:none;background-color:beige > | |
| 99 | + <p>Mapas são links especiais que abrem o i3geo com parâmetros específicos, como a extensão geográfica, temas ligados e temas desligados.</p> | |
| 100 | + <p>A lista de mapas é utilizada na guia "mapas" do i3geo e também na versão mobile.</p> | |
| 101 | +</div> | |
| 102 | +<table class=lista1 > | |
| 103 | +<tr onclick="ajuda('a3',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 104 | +<tr onclick="abre('html/mapas.html')"><td><div class=aplicar ></div></td><td>Edição dos mapas</td></tr> | |
| 105 | +<tr onclick="abre('html/mapas_importar.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr> | |
| 106 | +</table> | |
| 107 | +</fieldset> | |
| 108 | +<br> | |
| 109 | +<fieldset> | |
| 110 | +<legend>Atlas</legend> | |
| 111 | +<div id=a7 style=display:none;background-color:beige > | |
| 112 | + <p>A interface Atlas é uma forma especial de apresentar as camadas organizadas no i3geo. | |
| 113 | + Um atlas é composto de pranchas que por sua vez contém camadas pré-definidas. Cada Atlas e cada prancha pode ter um texto explicativo, mostrado ao usuário em uma janela interna do i3geo.</p> | |
| 114 | + <p>Para criar um Atlas basta definir quais pranchas e temas farão parte do mesmo. Essa definição é feita no arquivo xml i3geo/menutemas/atlas.xml, | |
| 115 | + ou no banco de dados administrativo.</p> | |
| 116 | + <p>Para ver a lista de Atlas, utilize i3geo/atlas | |
| 117 | +</div> | |
| 118 | +<table class=lista1 > | |
| 119 | +<tr onclick="ajuda('a7',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 120 | +<tr onclick="abre('html/atlas.html')"><td><div class=aplicar ></div></td><td>Edição dos atlas</td></tr> | |
| 121 | +<tr onclick="abre('html/atlas_importar.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr> | |
| 122 | +</table> | |
| 123 | +</fieldset> | |
| 124 | +<br> | |
| 125 | +<fieldset> | |
| 126 | +<legend>Cadastro de web services e links para download</legend> | |
| 127 | +<div id=a4 style=display:none;background-color:beige > | |
| 128 | + <p>O i3geo possibilita o acesso a dados por meio da tecnologia de web services.</p> | |
| 129 | + <p>Dessa forma, é possível incluir camadas no mapa que estão em servidores de dados remotos.</p> | |
| 130 | + <p>Para poder acessar um web service o i3geo precisa apenas saber o endereço na internet. O cadastro de web sercices é utilizado para a geração de listas de endereços para que o usuário possa escolher.</p> | |
| 131 | + <p>Os web services nos padrões OGC, suportados pelo Mapserver, podem ser configurados como temas e incluídos no mapa por meio da guia de adição de temas, ou seja, utiliza-se um mapfile normal para fazer o acesso. Já os web services cadastrados são utilizados em ferramentas específicas do i3geo, que permitem o uso de serviços WMS e GeoRSS.</p> | |
| 132 | + <p>O aplicativo i3geo/datadownload.htm possibilita que o usuário realize o download de dados, conforme definido na montagem da árvore de temas.</p> | |
| 133 | + <p>Além desses dados, é possível incluir no datadownload links especiais para determinados endereços onde podem ser obtidos outros dados.</p> | |
| 134 | + <p>A lista de links é definida no arquivo menutemas/linksdownload.xml ou no banco de dados de administração.</p> | |
| 135 | +</div> | |
| 136 | +<table class=lista1 > | |
| 137 | +<tr onclick="ajuda('a4',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 138 | +<tr onclick="abre('html/webservices.html')"><td><div class=aplicar ></div></td><td>Edição do cadastro</td></tr> | |
| 139 | +<tr onclick="abre('html/webservices_importar.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr> | |
| 140 | +</table> | |
| 141 | +</fieldset> | |
| 142 | +<br> | |
| 143 | +<fieldset> | |
| 144 | +<legend>Sistemas especiais de identificação</legend> | |
| 145 | +<div id=a5 style=display:none;background-color:beige > | |
| 146 | + <p>A ferramenta de identificação do i3geo, que mostra informações de acordo com um ponto clicado pelo usuário no mapa, permite a inclusão de sistemas de busca especiais.</p> | |
| 147 | + <p>Essas funções de busca são programas independentes, em PHP por exemplo, executados via URL e com parâmetros que identificam o x e y clicado no mapa.</p> | |
| 148 | +</div> | |
| 149 | +<table class=lista1 > | |
| 150 | +<tr onclick="ajuda('a5',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 151 | +<tr onclick="abre('html/identifica.html')"><td><div class=aplicar ></div></td><td>Edição dos sistemas</td></tr> | |
| 152 | +<tr onclick="abre('html/identifica_importar.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr> | |
| 153 | +</table> | |
| 154 | +</fieldset> | |
| 155 | +<br> | |
| 156 | +<fieldset> | |
| 157 | +<legend>Sistemas especiais que adicionam camadas</legend> | |
| 158 | +<div id=a6 style=display:none;background-color:beige > | |
| 159 | + <p>A adição de camadas no mapa mostrado no i3geo normalmente é feita por meio da escolha das camadas disponíveis na guia de adição de temas.</p> | |
| 160 | + <p>Para permitir a integração do i3geo com outros sistemas, pode-se selecionar programas especiais que permitem a interação com o usuário e a montagem de camadas baseadas em sistemas diversos.</p> | |
| 161 | + <p>A lista de sistemas e funções é definida por padrão no arquivo xml i3geo/menutemas/sistemas.xml ou no banco de dados de administração.</p> | |
| 162 | + <p>A operação desses sistemas depende das características de cada um, o i3geo apenas abre o programa indicado em uma janela interna do mapa.</p> | |
| 163 | +</div> | |
| 164 | +<table class=lista1 > | |
| 165 | +<tr onclick="ajuda('a6',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> | |
| 166 | +<tr onclick="abre('html/sistemas.html')"><td><div class=aplicar ></div></td><td>Edição dos sistemas</td></tr> | |
| 167 | +<tr onclick="abre('html/sistemas_importar.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr> | |
| 168 | +</table> | |
| 169 | +</fieldset> | |
| 170 | +<br> | |
| 171 | +<fieldset> | |
| 172 | +<legend>Outras opções</legend> | |
| 173 | +<table class=lista1 > | |
| 174 | +<tr onclick="abre('php/sqlite.php')"><td><div class=aplicar ></div></td><td>Descrição do banco padrão (SQLITE)</td></tr> | |
| 175 | +<tr onclick="abre('../geraminiatura.php')"><td><div class=aplicar ></div></td><td>Gera as miniaturas (thumbnails) para os temas existentes no diretório i3geo/temas</td></tr> | |
| 176 | +</table> | |
| 177 | +</fieldset> | |
| 178 | +<br> | |
| 179 | +</div> | |
| 180 | +<p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> | |
| 181 | +<p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> | |
| 182 | + | |
| 183 | +</body> | |
| 184 | +<script> | |
| 185 | +/* | |
| 186 | +Title: Menu principal | |
| 187 | + | |
| 188 | +Menu principal do sistema de administração | |
| 189 | + | |
| 190 | +File: i3geo/admin/index.html | |
| 191 | +*/ | |
| 192 | +ativaIndice("indice") | |
| 193 | +ativaTR() | |
| 194 | +ativaLegenda() | |
| 195 | + | |
| 196 | +function ajuda(i,t) | |
| 197 | +{$i(i).style.display="block";t.style.display="none"} | |
| 198 | + | |
| 199 | +</script> | |
| 200 | +</html> | |
| 0 | 201 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,264 @@ |
| 1 | +/* | |
| 2 | +Title: Admin | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração | |
| 5 | + | |
| 6 | +File: i3geo/admin/admin.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +//variáveis globais | |
| 29 | +/* | |
| 30 | +Variable: $mensagemAguarde | |
| 31 | +*/ | |
| 32 | +$mensagemAguarde = "<span style=color:red ><p>Aguarde...</p></span>" | |
| 33 | + | |
| 34 | +$i = function(i) | |
| 35 | +{return document.getElementById(i);}; | |
| 36 | + | |
| 37 | +/* | |
| 38 | +Variable: cPaint | |
| 39 | +Objeto cpaint para chamada ajax | |
| 40 | +*/ | |
| 41 | +cPaint = new cpaint(); | |
| 42 | +cPaint.set_async("true"); | |
| 43 | +cPaint.set_response_type("JSON"); | |
| 44 | + | |
| 45 | +function ativaIndice(onde) | |
| 46 | +{ | |
| 47 | + var f = document.getElementsByTagName("fieldset") | |
| 48 | + for(t = 0;t < f.length;t++) | |
| 49 | + { | |
| 50 | + f[t].innerHTML += "<p><a href='#indice'>índice</a></p>" | |
| 51 | + } | |
| 52 | + var etrs = document.getElementsByTagName("legend") | |
| 53 | + var ins = "<fieldset><legend><a name='indice' ><b>Índice</b></a></legend>" | |
| 54 | + for(t = 0;t < etrs.length;t++) | |
| 55 | + { | |
| 56 | + ins += "<a href='#"+etrs[t].innerHTML+"'><p>"+etrs[t].innerHTML+"</p></a>" | |
| 57 | + etrs[t].innerHTML = "<a name='"+etrs[t].innerHTML+"'>"+etrs[t].innerHTML+"</a>"; | |
| 58 | + | |
| 59 | + } | |
| 60 | + document.getElementById(onde).innerHTML = ins+"</fieldset>" | |
| 61 | +} | |
| 62 | +function ativaTR() | |
| 63 | +{ | |
| 64 | + var etrs = document.getElementsByTagName("tr") | |
| 65 | + for(t = 0;t < etrs.length;t++) | |
| 66 | + { | |
| 67 | + etrs[t].onmouseover = function() | |
| 68 | + {this.style.backgroundColor = "beige"} | |
| 69 | + etrs[t].onmouseout = function() | |
| 70 | + {this.style.backgroundColor = ""} | |
| 71 | + } | |
| 72 | +} | |
| 73 | + | |
| 74 | +function ativaLegenda() | |
| 75 | +{ | |
| 76 | + var etrs = document.getElementsByTagName("legend") | |
| 77 | + for(t = 0;t < etrs.length;t++) | |
| 78 | + { | |
| 79 | + etrs[t].onclick = function() | |
| 80 | + { | |
| 81 | + var c = this.parentNode.childNodes; | |
| 82 | + for(h = 0;h < c.length;h++) | |
| 83 | + { | |
| 84 | + if(c[h].style && c[h].tagName != "LEGEND") | |
| 85 | + { | |
| 86 | + if(c[h].style.display=="none") | |
| 87 | + c[h].style.display="block" | |
| 88 | + else | |
| 89 | + c[h].style.display="none" | |
| 90 | + } | |
| 91 | + } | |
| 92 | + } | |
| 93 | + } | |
| 94 | +} | |
| 95 | + | |
| 96 | +/* | |
| 97 | +Function: abre | |
| 98 | + | |
| 99 | +Abre uma url específica no lugar da página atual | |
| 100 | + | |
| 101 | +Parameters: | |
| 102 | + | |
| 103 | +url - nome do programa que será aberto | |
| 104 | +*/ | |
| 105 | +function abre(url) | |
| 106 | +{ | |
| 107 | + window.location.href = url | |
| 108 | +} | |
| 109 | +/* | |
| 110 | +Function: verificaEditores | |
| 111 | + | |
| 112 | +Verifica se o usuário está cadastrado como um editor do i3geo | |
| 113 | + | |
| 114 | +*/ | |
| 115 | +function verificaEditores() | |
| 116 | +{ | |
| 117 | + var retorna = function(retorno) | |
| 118 | + { | |
| 119 | + if(retorno.data=="nao") | |
| 120 | + {document.body.innerHTML += "<p style=color:red >Você não está cadastrado como um editor";return} | |
| 121 | + montaParametros() | |
| 122 | + } | |
| 123 | + var p = "../php/mapfiles.php?funcao=verificaEditores"; | |
| 124 | + cPaint.call(p,"",retorna); | |
| 125 | +} | |
| 126 | +/* | |
| 127 | +Function: combosimnao | |
| 128 | + | |
| 129 | +Retorna os itens option de um combo sim nao | |
| 130 | +*/ | |
| 131 | +function combosimnao(marcar) | |
| 132 | +{ | |
| 133 | + var ins = "<option value='' " | |
| 134 | + if (marcar == ""){ins += "selected"} | |
| 135 | + ins += ">---</option>"; | |
| 136 | + ins += "<option value='SIM' " | |
| 137 | + if (marcar == "sim" || marcar == "SIM"){ins += "selected"} | |
| 138 | + ins += ">sim</option>"; | |
| 139 | + ins += "<option value='NAO' " | |
| 140 | + if (marcar == "nao" || marcar == "NAO"){ins += "selected"} | |
| 141 | + ins += ">nao</option>"; | |
| 142 | + return(ins) | |
| 143 | +} | |
| 144 | +/* | |
| 145 | +Function: combolista | |
| 146 | + | |
| 147 | +Retorna os itens option de um combo baseado em uma lista (array) | |
| 148 | +*/ | |
| 149 | +function combolista(lista,marcar) | |
| 150 | +{ | |
| 151 | + var ins = "<option value='' " | |
| 152 | + if (marcar == ""){ins += "selected"} | |
| 153 | + ins += ">---</option>"; | |
| 154 | + for (var k=0;k<lista.length;k++) | |
| 155 | + { | |
| 156 | + ins += "<option value='"+lista[k]+"' " | |
| 157 | + if (marcar == lista[k] || marcar == lista[k].toLowerCase()){ins += "selected"} | |
| 158 | + ins += ">"+lista[k]+"</option>"; | |
| 159 | + } | |
| 160 | + return(ins) | |
| 161 | +} | |
| 162 | +/* | |
| 163 | +Function: comboObjeto | |
| 164 | + | |
| 165 | +Retorna os itens option de um combo baseado em um objeto json | |
| 166 | +*/ | |
| 167 | +function comboObjeto(obj,valor,texto,marcar) | |
| 168 | +{ | |
| 169 | + var ins = "<option value='' " | |
| 170 | + if (marcar == ""){ins += "selected"} | |
| 171 | + ins += ">---</option>"; | |
| 172 | + for (var k=0;k<obj.length;k++) | |
| 173 | + { | |
| 174 | + var v = eval("obj[k]."+valor) | |
| 175 | + var t = eval("obj[k]."+texto) | |
| 176 | + ins += "<option value='"+v+"' " | |
| 177 | + if (marcar == v || marcar == v.toLowerCase()){ins += "selected"} | |
| 178 | + ins += ">"+t+"</option>"; | |
| 179 | + } | |
| 180 | + return(ins) | |
| 181 | +} | |
| 182 | +/* | |
| 183 | +Function: montaCampos | |
| 184 | + | |
| 185 | +Monta o html com os parametros | |
| 186 | + | |
| 187 | +Parameters? | |
| 188 | + | |
| 189 | +$parametros - array com os parâmetros | |
| 190 | +*/ | |
| 191 | +function montaCampos() | |
| 192 | +{ | |
| 193 | + var ins = "" | |
| 194 | + for (i=0;i<$parametros.simples.length;i++) | |
| 195 | + { | |
| 196 | + ins += "<fieldset><legend><b>"+$parametros.simples[i].cabeca+"</b></legend>" | |
| 197 | + ins += "<p class=mensagem >"+$parametros.simples[i].mensagem+"</p>" | |
| 198 | + ins += "<table><tr><td><img style=cursor:pointer src=../imagens/02.png title='aplicar' onclick='salva(\""+$parametros.simples[i].variavel+"\")' /></td>" | |
| 199 | + ins += "<td><input type=text size=70 id='"+$parametros.simples[i].variavel+"' /></td></tr></table>" | |
| 200 | + ins += "</fieldset><br>" | |
| 201 | + } | |
| 202 | + document.body.innerHTML += ins | |
| 203 | +} | |
| 204 | +function geraLinhas(dados,param,ncolunas) | |
| 205 | +{ | |
| 206 | + var nparam = param.linhas.length; | |
| 207 | + var contaParam = 0 | |
| 208 | + var resultado = ""; | |
| 209 | + do | |
| 210 | + { | |
| 211 | + var p = param.linhas[contaParam]; | |
| 212 | + var idd = eval("dados."+p.id) | |
| 213 | + if(idd != undefined) | |
| 214 | + var id = p.prefixoid+idd; | |
| 215 | + else | |
| 216 | + var id = p.prefixoid+p.id; | |
| 217 | + var valor = eval("dados."+p.valor); | |
| 218 | + var titulo = p.titulo; | |
| 219 | + if(p.texto) | |
| 220 | + {var texto = p.texto} | |
| 221 | + else | |
| 222 | + {var texto = ""} | |
| 223 | + resultado += "<tr colspan='"+ncolunas+"' ><td style='background-color:rgb(250,250,250);' ><b>"+texto+"</b></td></tr>" | |
| 224 | + resultado += "<tr>" | |
| 225 | + resultado += "<td>"+titulo+": </td>" | |
| 226 | + resultado += "<td><input size=60 onchange='this.style.color=\"blue\"' type=text id='"+id+"' value='"+valor+"' /></td>" | |
| 227 | + if(ncolunas = 3) | |
| 228 | + resultado += "<td></td>" | |
| 229 | + resultado += "</tr>" | |
| 230 | + contaParam++ | |
| 231 | + } | |
| 232 | + while(contaParam < nparam) | |
| 233 | + return(resultado) | |
| 234 | +} | |
| 235 | +function geraLinhas2(dados,param,funcao) | |
| 236 | +{ | |
| 237 | + var nparam = param.linhas.length; | |
| 238 | + var contaParam = 0 | |
| 239 | + var resultado = ""; | |
| 240 | + do | |
| 241 | + { | |
| 242 | + var p = param.linhas[contaParam]; | |
| 243 | + var idd = eval("dados."+p.id) | |
| 244 | + if(idd != undefined) | |
| 245 | + var id = p.prefixoid+idd; | |
| 246 | + else | |
| 247 | + var id = p.prefixoid+p.id; | |
| 248 | + var valor = eval("dados."+p.valor); | |
| 249 | + var titulo = p.titulo; | |
| 250 | + if(p.texto) | |
| 251 | + {var texto = p.texto} | |
| 252 | + else | |
| 253 | + {var texto = ""} | |
| 254 | + resultado += "<br><fieldset><legend>+- "+titulo+"</legend><div style=display:none >" | |
| 255 | + resultado += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >"+texto+"</p>" | |
| 256 | + resultado += "<p>" | |
| 257 | + resultado += "<input size=65 onchange='this.style.color=\"blue\"' type=text id='"+id+"' value='"+valor+"' />" | |
| 258 | + resultado += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='"+funcao+"(\""+p.id+"\",\""+p.valor+"\",this)'/>" | |
| 259 | + resultado += "</p></div></fieldset>" | |
| 260 | + contaParam++ | |
| 261 | + } | |
| 262 | + while(contaParam < nparam) | |
| 263 | + return(resultado) | |
| 264 | +} | |
| 0 | 265 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,381 @@ |
| 1 | +/* | |
| 2 | +Title: Arvore | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do menu de temas | |
| 5 | + | |
| 6 | +File: i3geo/admin/arvore.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | + | |
| 33 | +Ao retornar, por default, executa a função montaParametros() | |
| 34 | +*/ | |
| 35 | +function iniciaAdmin() | |
| 36 | +{ | |
| 37 | + verificaEditores() | |
| 38 | +} | |
| 39 | +function montaParametros() | |
| 40 | +{ | |
| 41 | + if(!$i("resultado")) | |
| 42 | + {document.body.innerHTML += "<div id=resultado ></div>"} | |
| 43 | +} | |
| 44 | +/* | |
| 45 | +Function: listaRaiz | |
| 46 | + | |
| 47 | +Monta o html com os parametros e os divs que receberão os dados dos formulários. | |
| 48 | + | |
| 49 | +Para cada registro na variável $parametrs, é montado um formulário. | |
| 50 | +*/ | |
| 51 | +function listaRaiz() | |
| 52 | +{ | |
| 53 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 54 | + var ins = "" | |
| 55 | + for (i=0;i<$parametros.simples.length;i++) | |
| 56 | + { | |
| 57 | + ins += "<fieldset class=fieldsetRaiz ><legend style='background-color:white;'><b>"+$parametros.simples[i].cabeca+"</b></legend>" | |
| 58 | + ins += "<p><input style=font-size:10px onclick='alterarGrupo(\"\")' type=button value='Adicionar um grupo' /></p>" | |
| 59 | + ins += "<input style=font-size:10px onclick='alterarRaiz(\"\",\"0\",\"0\",\"temasRaiz0\")' type=button value='Adicionar tema na raiz desse nível' /></p>" | |
| 60 | + ins += "<div id='temasRaiz0' ></div>" | |
| 61 | + ins += "<div id='nivel1' ></div>" | |
| 62 | + ins += "<p class=mensagem >"+$parametros.simples[i].mensagem+"</p>" | |
| 63 | + ins += "<p><input style=font-size:10px onclick='alterarGrupo(\"\")' type=button value='Adicionar um grupo' /></p>" | |
| 64 | + ins += "</fieldset><br>" | |
| 65 | + } | |
| 66 | + $i("resultado").innerHTML = ins | |
| 67 | + pegaNosRaiz() | |
| 68 | + pegaTemasRaiz(0,0,"temasRaiz0") | |
| 69 | +} | |
| 70 | +function pegaTemasRaiz(nivel,id_nivel,onde) | |
| 71 | +{ | |
| 72 | + $i(onde).innerHTML = $mensagemAguarde | |
| 73 | + var n = $temasRaiz.length | |
| 74 | + var ins = "" | |
| 75 | + if(n > 0) | |
| 76 | + { | |
| 77 | + var ins = "<div ><fieldset style='background-color:white;' ><legend style='background-color:white;color:gray' ><b>Temas na raiz desse nível</b></legend>" | |
| 78 | + for (i=0;i<n;i++) | |
| 79 | + { | |
| 80 | + if (nivel == $temasRaiz[i].nivel && id_nivel == $temasRaiz[i].id_nivel && $i("menusel").value == $temasRaiz[i].id_menu) | |
| 81 | + { | |
| 82 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
| 83 | + ins += "<tr>" | |
| 84 | + ins += "<td><div class=excluir title='Excluir' onclick='excluirRaiz(\""+nivel+"\",\""+id_nivel+"\",\""+$temasRaiz[i].id_raiz+"\",\""+onde+"\")'/></td>" | |
| 85 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarRaiz(\""+$temasRaiz[i].id_raiz+"\",\""+nivel+"\",\""+id_nivel+"\",\""+onde+"\")'/></td>" | |
| 86 | + ins += "<td><select onchange=this.style.color='blue' id='raizTema_"+$temasRaiz[i].id_raiz+"'>" | |
| 87 | + ins += comboObjeto($temas,"id_tema","nome_tema",$temasRaiz[i].id_tema) | |
| 88 | + ins += "</select>" | |
| 89 | + ins += "</td>" | |
| 90 | + ins += "<td><input onchange=this.style.color='blue' id='raizPerfil_"+$temasRaiz[i].id_raiz+"' type=text size=35 value='"+$temasRaiz[i].perfil+"' /></td></tr>" | |
| 91 | + ins += "</table>" | |
| 92 | + } | |
| 93 | + } | |
| 94 | + ins += "</fieldset></div><br>" | |
| 95 | + } | |
| 96 | + $i(onde).innerHTML = ins; | |
| 97 | +} | |
| 98 | +function pegaNosRaiz() | |
| 99 | +{ | |
| 100 | + $i("nivel1").innerHTML = $mensagemAguarde | |
| 101 | + //monta o primeiro nível | |
| 102 | + var retorna = function(retorno) | |
| 103 | + { | |
| 104 | + var r = retorno.data | |
| 105 | + var ins = ""; | |
| 106 | + var rl = r.length; | |
| 107 | + for (i=0;i<rl;i++) | |
| 108 | + { | |
| 109 | + ins += "<div id=n1_"+r[i].id_n1+" ><fieldset style='border:1px solid black;background-color:white' ><legend style='background-color:white;'><b>+- grupo "+r[i].id_n1+"</b></legend>" | |
| 110 | + ins += "<div style=display:none >" | |
| 111 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
| 112 | + ins += "<tr>" | |
| 113 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"n1\",\""+r[i].id_n1+"\",\"id_n1\",\""+r[i].id_n1+"\")'/></td>" | |
| 114 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarGrupo(\""+r[i].id_n1+"\")'/></td>" | |
| 115 | + ins += "<td><select onchange=this.style.color='blue' id='grupon1_"+r[i].id_n1+"'>" | |
| 116 | + ins += comboObjeto($grupos,"id_grupo","nome_grupo",r[i].id_grupo) | |
| 117 | + ins += "</select>" | |
| 118 | + ins += "</td>" | |
| 119 | + ins += "<td><input onchange=this.style.color='blue' id='perfiln1_"+r[i].id_n1+"' type=text size=35 value='"+r[i].n1_perfil+"' /></td></tr>" | |
| 120 | + ins += "</table>" | |
| 121 | + ins += "<table><tr><td><input style=font-size:10px onclick='alterarRaiz(\"\",\"1\",\""+r[i].id_n1+"\",\"raizn1_"+r[i].id_n1+"\")' type=button value='Adicionar tema na raiz desse nível' /></td>" | |
| 122 | + ins += "<td><input style=font-size:10px; type=button value='Adicionar sub-grupo' onclick='alterarSubGrupo(\""+r[i].id_n1+"\",\"\")'/></td>" | |
| 123 | + ins += "<td><div class=mostrar title='Mostrar sub-grupos' onclick='pegaNosGrupo(\""+r[i].id_n1+"\")'/></td>" | |
| 124 | + ins += "</tr></table>" | |
| 125 | + ins += "<div id=raizn1_"+r[i].id_n1+"></div>" | |
| 126 | + ins += "<div id=n2_"+r[i].id_n1+" style=background-color:beige ></div>" | |
| 127 | + ins += "</div></fieldset></div><br>" | |
| 128 | + } | |
| 129 | + $i("nivel1").innerHTML = ins; | |
| 130 | + for (t=0;t<rl;t++) | |
| 131 | + {pegaTemasRaiz("1",r[t].id_n1,"raizn1_"+r[t].id_n1)} | |
| 132 | + ativaLegenda() | |
| 133 | + } | |
| 134 | + var p = "../php/arvore.php?funcao=pegaN1&menu="+$i("menusel").value; | |
| 135 | + cPaint.call(p,"",retorna); | |
| 136 | +} | |
| 137 | +function pegaNosGrupo(idn1) | |
| 138 | +{ | |
| 139 | + $i("n2_"+idn1).innerHTML = $mensagemAguarde | |
| 140 | + var retorna = function(retorno) | |
| 141 | + { | |
| 142 | + var r = retorno.data | |
| 143 | + var ins = ""; | |
| 144 | + for (i=0;i<r.length;i++) | |
| 145 | + { | |
| 146 | + ins += "<div id=n2x_"+r[i].id_n2+" ><fieldset><legend style='background-color:white;'><b>subgrupo "+r[i].id_n2+"</b></legend>" | |
| 147 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
| 148 | + ins += "<tr>" | |
| 149 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"n2\",\""+r[i].id_n2+"\",\"id_n2\",\""+idn1+"\")'/></td>" | |
| 150 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarSubGrupo(\""+r[i].id_n2+"\",\""+idn1+"\")'/></td>" | |
| 151 | + ins += "<td><select onchange=this.style.color='blue' id='subgrupon2_"+r[i].id_n2+"'>" | |
| 152 | + ins += comboObjeto($subGrupos,"id_subgrupo","nome_subgrupo",r[i].id_subgrupo) | |
| 153 | + ins += "</select>" | |
| 154 | + ins += "</td>" | |
| 155 | + ins += "<td><input onchange=this.style.color='blue' id='perfiln2_"+r[i].id_n2+"' type=text size=35 value='"+r[i].n2_perfil+"' /></td></tr>" | |
| 156 | + ins += "</table>" | |
| 157 | + ins += "<table><tr>" | |
| 158 | + ins += "<td></td>" | |
| 159 | + ins += "<td><input style=font-size:10px; type=button value='Adicionar tema' onclick='alterarTema(\"\",\""+r[i].id_n2+"\")'/></td>" | |
| 160 | + ins += "<td><div class=mostrar title='Mostrar temas' onclick='pegaNosSubGrupo(\""+r[i].id_n2+"\")'/></td>" | |
| 161 | + ins += "</tr></table>" | |
| 162 | + | |
| 163 | + ins += "<div id='raizn2_"+idn1+"' ></div>" | |
| 164 | + ins += "<div id=n3_"+r[i].id_n2+" style='background-color:rgb(245,245,245)' ></div>" | |
| 165 | + ins += "</fieldset></div>" | |
| 166 | + } | |
| 167 | + $i("n2_"+idn1).innerHTML = ins; | |
| 168 | + ativaLegenda() | |
| 169 | + } | |
| 170 | + var p = "../php/arvore.php?funcao=pegaN2&idn1="+idn1; | |
| 171 | + cPaint.call(p,"",retorna); | |
| 172 | +} | |
| 173 | +function pegaNosSubGrupo(idn2) | |
| 174 | +{ | |
| 175 | + $i("n3_"+idn2).innerHTML = $mensagemAguarde | |
| 176 | + var retorna = function(retorno) | |
| 177 | + { | |
| 178 | + var r = retorno.data | |
| 179 | + var ins = ""; | |
| 180 | + for (i=0;i<r.length;i++) | |
| 181 | + { | |
| 182 | + ins += "<div ><fieldset><legend style='background-color:white;'><b>tema "+r[i].id_n3+"</b></legend>" | |
| 183 | + ins += "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Perfis (separe com vírgula)</b></td></tr>"; | |
| 184 | + ins += "<tr>" | |
| 185 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"n3\",\""+r[i].id_n3+"\",\"id_n3\",\""+idn2+"\")'/></td>" | |
| 186 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarTema(\""+r[i].id_n3+"\",\""+idn2+"\")'/></td>" | |
| 187 | + ins += "<td><select onchange=this.style.color='blue' id='teman3_"+r[i].id_n3+"'>" | |
| 188 | + ins += comboObjeto($temas,"id_tema","nome_tema",r[i].id_tema) | |
| 189 | + ins += "</select>" | |
| 190 | + ins += "</td>" | |
| 191 | + ins += "<td><input onchange=this.style.color='blue' id='perfiln3_"+r[i].id_n3+"' type=text size=35 value='"+r[i].n3_perfil+"' /></td></tr>" | |
| 192 | + ins += "</table>" | |
| 193 | + //ins += "<div id=n3_"+r[i].id_n2+" ></div>" | |
| 194 | + ins += "</fieldset></div>" | |
| 195 | + } | |
| 196 | + $i("n3_"+idn2).innerHTML = ins; | |
| 197 | + } | |
| 198 | + var p = "../php/arvore.php?funcao=pegaN3&idn2="+idn2; | |
| 199 | + cPaint.call(p,"",retorna); | |
| 200 | +} | |
| 201 | +function alterarRaiz(id_raiz,nivel,id_nivel,onde) | |
| 202 | +{ | |
| 203 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 204 | + //{ | |
| 205 | + var retorna = function(retorno) | |
| 206 | + { | |
| 207 | + $temasRaiz = retorno.data; | |
| 208 | + pegaTemasRaiz(nivel,id_nivel,onde); | |
| 209 | + } | |
| 210 | + if (id_raiz != "") | |
| 211 | + { | |
| 212 | + var id_tema = $i("raizTema_"+id_raiz).value | |
| 213 | + var perfil = $i("raizPerfil_"+id_raiz).value | |
| 214 | + } | |
| 215 | + else | |
| 216 | + { | |
| 217 | + var id_raiz = ""; | |
| 218 | + var perfil = ""; | |
| 219 | + var id_tema = "" | |
| 220 | + } | |
| 221 | + var p = "../php/arvore.php?funcao=alterarRaiz&id_nivel="+id_nivel+"&nivel="+nivel+"&id_raiz="+id_raiz+"&id_menu="+$i("menusel").value+"&perfil="+perfil+"&id_tema="+id_tema; | |
| 222 | + cPaint.call(p,"",retorna); | |
| 223 | + //} | |
| 224 | +} | |
| 225 | +function alterarTema(id,idsubgrupo) | |
| 226 | +{ | |
| 227 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 228 | + //{ | |
| 229 | + var retorna = function() | |
| 230 | + {pegaNosSubGrupo(idsubgrupo);} | |
| 231 | + if (id != "") | |
| 232 | + { | |
| 233 | + var perfil = $i("perfiln3_"+id).value | |
| 234 | + if(perfil == "null"){var perfil = "";} | |
| 235 | + var idtema = $i("teman3_"+id).value | |
| 236 | + //var idsubgrupo = "" | |
| 237 | + } | |
| 238 | + else | |
| 239 | + { | |
| 240 | + var id = ""; | |
| 241 | + var perfil = ""; | |
| 242 | + var idtema = "" | |
| 243 | + } | |
| 244 | + if($i("n3_"+idtema)) | |
| 245 | + $i("n3_"+idtema).innerHTML = $mensagemAguarde | |
| 246 | + var p = "../php/arvore.php?funcao=alteraN3&id="+id+"&perfil="+perfil+"&idtema="+idtema+"&idsubgrupo="+idsubgrupo; | |
| 247 | + cPaint.call(p,"",retorna); | |
| 248 | + //} | |
| 249 | + | |
| 250 | +} | |
| 251 | + | |
| 252 | +function alterarSubGrupo(idgrupo,id) | |
| 253 | +{ | |
| 254 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 255 | + //{ | |
| 256 | + var retorna = function() | |
| 257 | + {pegaNosGrupo(idgrupo);} | |
| 258 | + if (id != "") | |
| 259 | + { | |
| 260 | + var perfil = $i("perfiln2_"+id).value | |
| 261 | + if(perfil == "null"){var perfil = "";} | |
| 262 | + var idsubgrupo = $i("subgrupon2_"+id).value | |
| 263 | + } | |
| 264 | + else | |
| 265 | + { | |
| 266 | + var id = ""; | |
| 267 | + var perfil = ""; | |
| 268 | + var idsubgrupo = "" | |
| 269 | + } | |
| 270 | + if($i("n2_"+idsubgrupo)) | |
| 271 | + $i("n2_"+idsubgrupo).innerHTML =$mensagemAguarde | |
| 272 | + var p = "../php/arvore.php?funcao=alteraN2&id="+id+"&perfil="+perfil+"&idsubgrupo="+idsubgrupo+"&idgrupo="+idgrupo; | |
| 273 | + cPaint.call(p,"",retorna); | |
| 274 | + //} | |
| 275 | + | |
| 276 | +} | |
| 277 | +/* | |
| 278 | +Function: alterarGrupo | |
| 279 | + | |
| 280 | +Altera o valor de uma variável | |
| 281 | +*/ | |
| 282 | +function alterarGrupo(id) | |
| 283 | +{ | |
| 284 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 285 | + //{ | |
| 286 | + var retorna = function() | |
| 287 | + {pegaNosRaiz();} | |
| 288 | + if (id != "") | |
| 289 | + { | |
| 290 | + var n1 = $i("n1_"+id).value | |
| 291 | + var perfil = $i("perfiln1_"+id).value | |
| 292 | + if(n1 == "null"){var n1 = "";} | |
| 293 | + if(perfil == "null"){var perfil = "";} | |
| 294 | + var idgrupo = $i("grupon1_"+id).value | |
| 295 | + } | |
| 296 | + else | |
| 297 | + { | |
| 298 | + var id = ""; | |
| 299 | + var perfil = ""; | |
| 300 | + var idgrupo = ""; | |
| 301 | + } | |
| 302 | + if($i("n1_"+id)) | |
| 303 | + $i("n1_"+id).innerHTML =$mensagemAguarde | |
| 304 | + var idmenu = $i("menusel").value | |
| 305 | + var p = "../php/arvore.php?funcao=alteraN1&id="+id+"&perfil="+perfil+"&idgrupo="+idgrupo+"&idmenu="+idmenu; | |
| 306 | + cPaint.call(p,"",retorna); | |
| 307 | + //} | |
| 308 | +} | |
| 309 | +/* | |
| 310 | +Function: excluir | |
| 311 | + | |
| 312 | +Exclui um registro | |
| 313 | +*/ | |
| 314 | +function excluir(prefixo,id,coluna,idnpai) | |
| 315 | +{ | |
| 316 | + if(confirm("Você realmente quer fazer isso?")) | |
| 317 | + { | |
| 318 | + var retorna = function(retorno) | |
| 319 | + { | |
| 320 | + if(retorno.data == "erro") | |
| 321 | + {alert("Não foi possível excluir. Verifique se ainda existem elementos abaixo desse nível")} | |
| 322 | + if(prefixo == "raiz") | |
| 323 | + { | |
| 324 | + $i(idnpai).innerHTML = ""; | |
| 325 | + pegaTemasRaiz("0",id_nivel,idnpai) | |
| 326 | + } | |
| 327 | + if(prefixo == "n1") | |
| 328 | + { | |
| 329 | + pegaNosRaiz(); | |
| 330 | + } | |
| 331 | + if(prefixo == "n2") | |
| 332 | + { | |
| 333 | + $i(prefixo+"_"+idnpai).innerHTML = ""; | |
| 334 | + pegaNosGrupo(idnpai) | |
| 335 | + } | |
| 336 | + if(prefixo == "n3") | |
| 337 | + { | |
| 338 | + $i(prefixo+"_"+idnpai).innerHTML = ""; | |
| 339 | + pegaNosSubGrupo(idnpai) | |
| 340 | + } | |
| 341 | + } | |
| 342 | + if($i(prefixo+"_"+idnpai)) | |
| 343 | + $i(prefixo+"_"+idnpai).innerHTML = $mensagemAguarde | |
| 344 | + | |
| 345 | + if(prefixo == "raiz") | |
| 346 | + var tabela = "i3geoadmin_raiz" | |
| 347 | + | |
| 348 | + if(prefixo == "n1") | |
| 349 | + var tabela = "i3geoadmin_n1" | |
| 350 | + | |
| 351 | + if(prefixo == "n2") | |
| 352 | + var tabela = "i3geoadmin_n2" | |
| 353 | + | |
| 354 | + if(prefixo == "n3") | |
| 355 | + var tabela = "i3geoadmin_n3" | |
| 356 | + | |
| 357 | + var p = "../php/arvore.php?funcao=excluir&id="+id+"&tabela="+tabela+"&coluna="+coluna; | |
| 358 | + cPaint.call(p,"",retorna); | |
| 359 | + } | |
| 360 | +} | |
| 361 | +/* | |
| 362 | +Function: excluirRaiz | |
| 363 | + | |
| 364 | +Exclui um registro de um tema no nível raiz | |
| 365 | +*/ | |
| 366 | +function excluirRaiz(nivel,id_nivel,id_raiz,idnpai) | |
| 367 | +{ | |
| 368 | + if(confirm("Você realmente quer fazer isso?")) | |
| 369 | + { | |
| 370 | + $i(idnpai).innerHTML = $mensagemAguarde; | |
| 371 | + var retorna = function(retorno) | |
| 372 | + { | |
| 373 | + $i(idnpai).innerHTML = ""; | |
| 374 | + $temasRaiz = retorno.data; | |
| 375 | + pegaTemasRaiz(nivel,id_nivel,idnpai) | |
| 376 | + } | |
| 377 | + var tabela = "i3geoadmin_raiz" | |
| 378 | + var p = "../php/arvore.php?funcao=excluir&id="+id_raiz+"&tabela="+tabela+"&coluna=id_raiz"; | |
| 379 | + cPaint.call(p,"",retorna); | |
| 380 | + } | |
| 381 | +} | |
| 0 | 382 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,345 @@ |
| 1 | +/* | |
| 2 | +Title: Atlas | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do cadastro de web services | |
| 5 | + | |
| 6 | +File: i3geo/admin/atlas.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | + | |
| 33 | +Ao retornar, por default, executa a função montaParametros() | |
| 34 | +*/ | |
| 35 | +function iniciaAdmin() | |
| 36 | +{ | |
| 37 | + verificaEditores() | |
| 38 | + tipos = ["expandida","automatica"] | |
| 39 | +} | |
| 40 | +function montaParametros() | |
| 41 | +{ | |
| 42 | + if(!$i("resultado")) | |
| 43 | + {document.body.innerHTML += "<div id=resultado ></div>"} | |
| 44 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 45 | + var p = "../php/atlas.php?funcao=pegaAtlas"; | |
| 46 | + cPaint.call(p,"",listaAtlas); | |
| 47 | +} | |
| 48 | +/* | |
| 49 | +Function: listaAtlas | |
| 50 | + | |
| 51 | +Monta o html com os parametros e os divs que receberão os dados dos formulários. | |
| 52 | +*/ | |
| 53 | +function listaAtlas(retorno) | |
| 54 | +{ | |
| 55 | + ins = "<p><input style=font-size:10px onclick='alterarAtlas(\"\",\"resultado\")' type=button value='Adicionar um novo atlas' /></p>" | |
| 56 | + montaAtlas(retorno,"resultado") | |
| 57 | +} | |
| 58 | +function montaAtlas(retorno,onde) | |
| 59 | +{ | |
| 60 | + var d = retorno.data; | |
| 61 | + var nm = retorno.data.length | |
| 62 | + for (i=0;i<nm;i++) | |
| 63 | + { | |
| 64 | + if(!$i(d[i].id_atlas)) | |
| 65 | + {ins += "<div id="+d[i].id_atlas+" >"} | |
| 66 | + ins += "<fieldset><legend style='background-color:white;'><b>+- "+d[i].titulo_atlas+"</b></legend>" | |
| 67 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
| 68 | + var param = { | |
| 69 | + "linhas":[ | |
| 70 | + {titulo:"Nome",prefixoid:"titulo_",id:"id_atlas",valor:"titulo_atlas"}, | |
| 71 | + {titulo:"Descrição",prefixoid:"desc_",id:"id_atlas",valor:"desc_atlas"}, | |
| 72 | + {titulo:"Ícone",prefixoid:"icone_",id:"id_atlas",valor:"icone_atlas"}, | |
| 73 | + {titulo:"Link",prefixoid:"link_",id:"id_atlas",valor:"link_atlas"}, | |
| 74 | + {titulo:"Template",prefixoid:"template_",id:"id_atlas",valor:"template_atlas"}, | |
| 75 | + {titulo:"Prancha aberta",prefixoid:"pranchadefault_",id:"id_atlas",valor:"pranchadefault_atlas"}, | |
| 76 | + {titulo:"Largura da janela do texto exlicativo",prefixoid:"w_",id:"id_atlas",valor:"w_atlas"}, | |
| 77 | + {titulo:"Altura",prefixoid:"h_",id:"id_atlas",valor:"h_atlas"}, | |
| 78 | + {titulo:"Mapfile base",prefixoid:"basemapfile_",id:"id_atlas",valor:"basemapfile_atlas"} | |
| 79 | + ] | |
| 80 | + } | |
| 81 | + ins += (geraLinhas(d[i],param,2)); | |
| 82 | + ins += "<tr>" | |
| 83 | + ins += "<td>Tipo das guias: </td>" | |
| 84 | + ins += "<select onchange='this.style.color=\"blue\"' id='tipoguias_"+d[i].id_atlas+"' >" | |
| 85 | + ins += combolista(tipos,d[i].tipoguias_atlas) | |
| 86 | + ins += "</select>" | |
| 87 | + ins += "</td>" | |
| 88 | + ins += "</tr>" | |
| 89 | + ins += "</table>" | |
| 90 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluir(\""+d[i].id_atlas+"\")'/></td>" | |
| 91 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarAtlas(\""+d[i].id_atlas+"\",\""+d[i].id_atlas+"\")'/></td>" | |
| 92 | + ins += "</tr></table>" | |
| 93 | + ins += "<fieldset><legend>+- Pranchas</legend>" | |
| 94 | + ins += "<div style=display:none ><p><input style=font-size:10px onclick='alterarPranchas(\"\",\""+d[i].id_atlas+"\")' type=button value='Adicionar uma nova prancha' /></p>" | |
| 95 | + ins += "<div id=pranchas_"+d[i].id_atlas+" ></div>" | |
| 96 | + ins += "</div></fieldset>" | |
| 97 | + if(!$i(d[i].id_atlas)) | |
| 98 | + ins += "</div>" | |
| 99 | + ins += "</div></fieldset>" | |
| 100 | + } | |
| 101 | + $i(onde).innerHTML = ins | |
| 102 | + listaPranchas(retorno) | |
| 103 | +} | |
| 104 | +function listaPranchas(retorno) | |
| 105 | +{ | |
| 106 | + var d = retorno.data; | |
| 107 | + var nm = retorno.data.length | |
| 108 | + for (i=0;i<nm;i++) | |
| 109 | + { | |
| 110 | + var ins = "" | |
| 111 | + var nf = d[i].pranchas.length | |
| 112 | + for (j=0;j<nf;j++) | |
| 113 | + { | |
| 114 | + ins += "<fieldset><legend>+- "+d[i].pranchas[j].titulo_prancha+"</legend>" | |
| 115 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
| 116 | + var param = { | |
| 117 | + "linhas":[ | |
| 118 | + {titulo:"Nome",prefixoid:"tituloP_",id:"id_prancha",valor:"titulo_prancha"}, | |
| 119 | + {titulo:"Descrição",prefixoid:"descP_",id:"id_prancha",valor:"desc_prancha"}, | |
| 120 | + {titulo:"Ícone",prefixoid:"iconeP_",id:"id_prancha",valor:"icone_prancha"}, | |
| 121 | + {titulo:"Link",prefixoid:"linkP_",id:"id_prancha",valor:"link_prancha"}, | |
| 122 | + {titulo:"Largura da janela do texto exlicativo",prefixoid:"wP_",id:"id_prancha",valor:"w_prancha"}, | |
| 123 | + {titulo:"Altura",prefixoid:"hP_",id:"id_prancha",valor:"h_prancha"}, | |
| 124 | + {titulo:"Extensão geográfica",prefixoid:"mapextP_",id:"id_prancha",valor:"mapext_prancha"} | |
| 125 | + ] | |
| 126 | + } | |
| 127 | + ins += (geraLinhas(d[i].pranchas[j],param,2)); | |
| 128 | + ins += "</table>" | |
| 129 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluirPranchas(\""+d[i].pranchas[j].id_prancha+"\")'/></td>" | |
| 130 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarPranchas(\""+d[i].pranchas[j].id_prancha+"\",\""+d[i].id_atlas+"\")'/></td>" | |
| 131 | + ins += "</tr></table>" | |
| 132 | + | |
| 133 | + ins += "<fieldset><legend>+- Temas</legend>" | |
| 134 | + ins += "<div style=display:none ><p><input style=font-size:10px onclick='alterarTemas(\"\",\""+d[i].pranchas[j].id_prancha+"\")' type=button value='Adicionar um novo tema' /></p>" | |
| 135 | + ins += "<div id=temas_"+d[i].pranchas[j].id_prancha+" ></div>" | |
| 136 | + ins += "</div></fieldset>" | |
| 137 | + ins += "</div></fieldset><br>" | |
| 138 | + } | |
| 139 | + if(document.getElementById("pranchas_"+d[i].id_atlas)) | |
| 140 | + {document.getElementById("pranchas_"+d[i].id_atlas).innerHTML = ins} | |
| 141 | + } | |
| 142 | + listaTemas(retorno) | |
| 143 | +} | |
| 144 | +function listaTemas(retorno) | |
| 145 | +{ | |
| 146 | + var d = retorno.data; | |
| 147 | + var nm = retorno.data.length | |
| 148 | + for (i=0;i<nm;i++) | |
| 149 | + { | |
| 150 | + var nf = d[i].pranchas.length | |
| 151 | + for (j=0;j<nf;j++) | |
| 152 | + { | |
| 153 | + var ins = "" | |
| 154 | + var nt = d[i].pranchas[j].temas.length | |
| 155 | + for(k=0;k<nt;k++) | |
| 156 | + { | |
| 157 | + ins += "<fieldset><legend>"+d[i].pranchas[j].temas[k].codigo_tema+"</legend>" | |
| 158 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
| 159 | + ins += "<tr>" | |
| 160 | + ins += "<td>Nome: </td>" | |
| 161 | + ins += "<td><select onchange='this.style.color=\"blue\"' id='codigo_"+d[i].pranchas[j].temas[k].id_tema+"' >" | |
| 162 | + ins += comboObjeto($temas,"codigo_tema","nome_tema",d[i].pranchas[j].temas[k].codigo_tema) | |
| 163 | + ins += "</select></td></tr>" | |
| 164 | + ins += "</tr>" | |
| 165 | + ins += "<tr>" | |
| 166 | + ins += "<td>Ligado: </td>" | |
| 167 | + ins += "<td>" | |
| 168 | + ins += "<select onchange='this.style.color=\"blue\"' id='ligado_"+d[i].pranchas[j].temas[k].id_tema+"' >" | |
| 169 | + ins += combosimnao(d[i].pranchas[j].temas[k].ligado_tema) | |
| 170 | + ins += "</select></td>" | |
| 171 | + ins += "</tr>" | |
| 172 | + ins += "</table>" | |
| 173 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluirTemas(\""+d[i].pranchas[j].temas[k].id_tema+"\")'/></td>" | |
| 174 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarTemas(\""+d[i].pranchas[j].temas[k].id_tema+"\",\""+d[i].pranchas[j].id_prancha+"\")'/></td>" | |
| 175 | + ins += "</tr></table>" | |
| 176 | + ins += "</div></fieldset><br>" | |
| 177 | + } | |
| 178 | + if(document.getElementById("temas_"+d[i].pranchas[j].id_prancha)) | |
| 179 | + {document.getElementById("temas_"+d[i].pranchas[j].id_prancha).innerHTML = ins} | |
| 180 | + } | |
| 181 | + } | |
| 182 | + ativaLegenda() | |
| 183 | +} | |
| 184 | + | |
| 185 | +function alterarTemas(id_tema,id_prancha) | |
| 186 | +{ | |
| 187 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 188 | + //{ | |
| 189 | + var retorna = function(retorno) | |
| 190 | + { | |
| 191 | + listaTemas(retorno); | |
| 192 | + } | |
| 193 | + if (id_tema != "") | |
| 194 | + { | |
| 195 | + var codigo_tema = document.getElementById("codigo_"+id_tema).value | |
| 196 | + var ligado_tema = document.getElementById("ligado_"+id_tema).value | |
| 197 | + } | |
| 198 | + else | |
| 199 | + { | |
| 200 | + var id_tema = ""; | |
| 201 | + var codigo_tema = "" | |
| 202 | + var ligado_tema = "250" | |
| 203 | + } | |
| 204 | + var p = "../php/atlas.php?funcao=alterarTemas&id_prancha="+id_prancha+"&id_tema="+id_tema+"&codigo_tema="+codigo_tema+"&ligado_tema="+ligado_tema | |
| 205 | + cPaint.call(p,"",retorna); | |
| 206 | + //} | |
| 207 | +} | |
| 208 | +function alterarPranchas(id_prancha,id_atlas) | |
| 209 | +{ | |
| 210 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 211 | + //{ | |
| 212 | + var retorna = function(retorno) | |
| 213 | + { | |
| 214 | + listaPranchas(retorno); | |
| 215 | + } | |
| 216 | + if (id_prancha != "") | |
| 217 | + { | |
| 218 | + var desc_prancha = document.getElementById("descP_"+id_prancha).value | |
| 219 | + var h_prancha = document.getElementById("hP_"+id_prancha).value | |
| 220 | + var w_prancha = document.getElementById("wP_"+id_prancha).value | |
| 221 | + var icone_prancha = document.getElementById("iconeP_"+id_prancha).value | |
| 222 | + var link_prancha = document.getElementById("linkP_"+id_prancha).value | |
| 223 | + var titulo_prancha = document.getElementById("tituloP_"+id_prancha).value | |
| 224 | + var mapext_prancha = document.getElementById("mapextP_"+id_prancha).value | |
| 225 | + } | |
| 226 | + else | |
| 227 | + { | |
| 228 | + var id_prancha = ""; | |
| 229 | + var desc_prancha = "" | |
| 230 | + var h_prancha = "250" | |
| 231 | + var w_prancha = "250" | |
| 232 | + var icone_prancha = "" | |
| 233 | + var link_prancha = "" | |
| 234 | + var titulo_prancha = ""; | |
| 235 | + var mapext_prancha = ""; | |
| 236 | + } | |
| 237 | + var p = "../php/atlas.php?funcao=alterarPranchas&id_atlas="+id_atlas+"&id_prancha="+id_prancha+"&titulo_prancha="+titulo_prancha+"&desc_prancha="+desc_prancha+"&h_prancha="+h_prancha+"&w_prancha="+w_prancha+"&icone_prancha="+icone_prancha+"&link_prancha="+link_prancha | |
| 238 | + cPaint.call(p,"",retorna); | |
| 239 | + //} | |
| 240 | +} | |
| 241 | + | |
| 242 | +function alterarAtlas(id_atlas,onde) | |
| 243 | +{ | |
| 244 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 245 | + //{ | |
| 246 | + var retorna = function(retorno) | |
| 247 | + { | |
| 248 | + if(id_atlas == "") | |
| 249 | + listaAtlas(retorno); | |
| 250 | + else | |
| 251 | + {ins = "";montaAtlas(retorno,onde)} | |
| 252 | + } | |
| 253 | + if (id_atlas != "") | |
| 254 | + { | |
| 255 | + var titulo_atlas = document.getElementById("titulo_"+id_atlas).value | |
| 256 | + var desc_atlas = document.getElementById("desc_"+id_atlas).value | |
| 257 | + var h_atlas = document.getElementById("h_"+id_atlas).value | |
| 258 | + var w_atlas = document.getElementById("w_"+id_atlas).value | |
| 259 | + var icone_atlas = document.getElementById("icone_"+id_atlas).value | |
| 260 | + var link_atlas = document.getElementById("link_"+id_atlas).value | |
| 261 | + var pranchadefault_atlas = document.getElementById("pranchadefault_"+id_atlas).value | |
| 262 | + var template_atlas = document.getElementById("template_"+id_atlas).value | |
| 263 | + var tipoguias_atlas = document.getElementById("tipoguias_"+id_atlas).value | |
| 264 | + var basemapfile_atlas = document.getElementById("basemapfile_"+id_atlas).value | |
| 265 | + } | |
| 266 | + else | |
| 267 | + { | |
| 268 | + var id_atlas = ""; | |
| 269 | + var desc_atlas = "" | |
| 270 | + var h_atlas = "250" | |
| 271 | + var w_atlas = "250" | |
| 272 | + var icone_atlas = "" | |
| 273 | + var link_atlas = "" | |
| 274 | + var pranchadefault_atlas = "" | |
| 275 | + var template_atlas = "" | |
| 276 | + var tipoguias_atlas = "expandida" | |
| 277 | + var titulo_atlas = ""; | |
| 278 | + var basemapfile_atlas = ""; | |
| 279 | + } | |
| 280 | + var p = "../php/atlas.php?funcao=alterarAtlas&id_atlas="+id_atlas+"&basemapfile_atlas="+basemapfile_atlas+"&titulo_atlas="+titulo_atlas+"&desc_atlas="+desc_atlas+"&h_atlas="+h_atlas+"&w_atlas="+w_atlas+"&icone_atlas="+icone_atlas+"&link_atlas="+link_atlas+"&pranchadefault_atlas="+pranchadefault_atlas+"&template_atlas="+template_atlas+"&tipoguias_atlas="+tipoguias_atlas | |
| 281 | + cPaint.call(p,"",retorna); | |
| 282 | + //} | |
| 283 | +} | |
| 284 | +function excluir(id) | |
| 285 | +{ | |
| 286 | + if(confirm("Você realmente quer fazer isso?")) | |
| 287 | + { | |
| 288 | + var retorna = function(retorno) | |
| 289 | + { | |
| 290 | + if(retorno.data == "erro") | |
| 291 | + { | |
| 292 | + alert("Nao foi possivel excluir.Exclua as pranchas primeiro") | |
| 293 | + } | |
| 294 | + else | |
| 295 | + { | |
| 296 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 297 | + montaParametros() | |
| 298 | + } | |
| 299 | + } | |
| 300 | + var p = "../php/atlas.php?funcao=excluir&id="+id; | |
| 301 | + cPaint.call(p,"",retorna); | |
| 302 | + } | |
| 303 | +} | |
| 304 | +function excluirPranchas(id) | |
| 305 | +{ | |
| 306 | + if(confirm("Você realmente quer fazer isso?")) | |
| 307 | + { | |
| 308 | + var retorna = function(retorno) | |
| 309 | + { | |
| 310 | + if(retorno.data == "erro") | |
| 311 | + { | |
| 312 | + alert("Nao foi possivel excluir.Exclua os temas primeiro") | |
| 313 | + } | |
| 314 | + else | |
| 315 | + { | |
| 316 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 317 | + montaParametros() | |
| 318 | + } | |
| 319 | + } | |
| 320 | + var p = "../php/atlas.php?funcao=excluirPranchas&id="+id; | |
| 321 | + cPaint.call(p,"",retorna); | |
| 322 | + } | |
| 323 | +} | |
| 324 | +function excluirTemas(id) | |
| 325 | +{ | |
| 326 | + if(confirm("Você realmente quer fazer isso?")) | |
| 327 | + { | |
| 328 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 329 | + var retorna = function() | |
| 330 | + { | |
| 331 | + montaParametros() | |
| 332 | + } | |
| 333 | + var p = "../php/atlas.php?funcao=excluirTemas&id="+id; | |
| 334 | + cPaint.call(p,"",retorna); | |
| 335 | + } | |
| 336 | +} | |
| 337 | + | |
| 338 | +function importarXmlAtlas() | |
| 339 | +{ | |
| 340 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 341 | + var retorna = function(retorno) | |
| 342 | + {$i("resultado").innerHTML = retorno.data} | |
| 343 | + var p = "../php/atlas.php?funcao=importarXmlAtlas&xml="+$i("arquivo").value; | |
| 344 | + cPaint.call(p,"",retorna); | |
| 345 | +} | |
| 0 | 346 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,136 @@ |
| 1 | +/* | |
| 2 | +Title: Identifica | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do cadastro de sistemas da ferramenta identifica | |
| 5 | + | |
| 6 | +File: i3geo/admin/webservices.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | + | |
| 33 | +Ao retornar, por default, executa a função montaParametros() | |
| 34 | +*/ | |
| 35 | +function iniciaAdmin() | |
| 36 | +{ | |
| 37 | + verificaEditores() | |
| 38 | +} | |
| 39 | +function montaParametros() | |
| 40 | +{ | |
| 41 | + if(!$i("resultado")) | |
| 42 | + {document.body.innerHTML += "<div id=resultado ></div>"} | |
| 43 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 44 | + var p = "../php/identifica.php?funcao=pegaFuncoes"; | |
| 45 | + cPaint.call(p,"",listaFuncoes); | |
| 46 | +} | |
| 47 | +/* | |
| 48 | +Function: listaFuncoes | |
| 49 | + | |
| 50 | +Monta o html com os parametros e os divs que receberão os dados dos formulários. | |
| 51 | +*/ | |
| 52 | +function listaFuncoes(retorno) | |
| 53 | +{ | |
| 54 | + ins = "<p><input style=font-size:10px onclick='alterarFuncoes(\"\",\"resultado\")' type=button value='Adicionar uma nova função' /></p>" | |
| 55 | + montaFuncoes(retorno,"resultado") | |
| 56 | + | |
| 57 | +} | |
| 58 | +function montaFuncoes(retorno,onde) | |
| 59 | +{ | |
| 60 | + var d = retorno.data; | |
| 61 | + var nm = retorno.data.length | |
| 62 | + for (i=0;i<nm;i++) | |
| 63 | + { | |
| 64 | + if(!$i(d[i].id_i)) | |
| 65 | + {ins += "<div id='"+d[i].id_i+"' >"} | |
| 66 | + ins += "<fieldset><legend style='background-color:white;'><b>+- "+d[i].nome_i+"</b></legend>" | |
| 67 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
| 68 | + var param = { | |
| 69 | + "linhas":[ | |
| 70 | + {titulo:"Nome",prefixoid:"nome_",id:"id_i",valor:"nome_i"}, | |
| 71 | + {titulo:"Destino",prefixoid:"destino_",id:"id_i",valor:"target_i"}, | |
| 72 | + {titulo:"Programa",prefixoid:"abrir_",id:"id_prancha",valor:"abrir_i"} | |
| 73 | + ] | |
| 74 | + } | |
| 75 | + ins += (geraLinhas(d[i],param,2)); | |
| 76 | + ins += "</table>" | |
| 77 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluir(\""+d[i].id_i+"\")'/></td>" | |
| 78 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarFuncoes(\""+d[i].id_i+"\",\""+d[i].id_i+"\")'/></td>" | |
| 79 | + ins += "</tr></table>" | |
| 80 | + ins += "</div></fieldset><br>" | |
| 81 | + if(!$i(d[i].id_i)) | |
| 82 | + ins += "</div>" | |
| 83 | + } | |
| 84 | + $i(onde).innerHTML = ins | |
| 85 | + ativaLegenda() | |
| 86 | +} | |
| 87 | + | |
| 88 | +function alterarFuncoes(id,onde) | |
| 89 | +{ | |
| 90 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 91 | + //{ | |
| 92 | + var retorna = function(retorno) | |
| 93 | + { | |
| 94 | + if(id == "") | |
| 95 | + listaFuncoes(retorno); | |
| 96 | + else | |
| 97 | + {ins = "";montaFuncoes(retorno,onde)} | |
| 98 | + } | |
| 99 | + if (id != "") | |
| 100 | + { | |
| 101 | + var nome = $i("nome_"+id).value | |
| 102 | + var destino = $i("destino_"+id).value | |
| 103 | + var abrir = $i("abrir_"+id).value | |
| 104 | + } | |
| 105 | + else | |
| 106 | + { | |
| 107 | + var id = ""; | |
| 108 | + var destino = "" | |
| 109 | + var abrir = "" | |
| 110 | + var nome = "" | |
| 111 | + } | |
| 112 | + var p = "../php/identifica.php?funcao=alterarFuncoes&id_i="+id+"&nome_i="+nome+"&target_i="+destino+"&abrir_i="+abrir | |
| 113 | + cPaint.call(p,"",retorna); | |
| 114 | + //} | |
| 115 | +} | |
| 116 | +function excluir(id) | |
| 117 | +{ | |
| 118 | + if(confirm("Você realmente quer fazer isso?")) | |
| 119 | + { | |
| 120 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 121 | + var retorna = function() | |
| 122 | + { | |
| 123 | + montaParametros() | |
| 124 | + } | |
| 125 | + var p = "../php/identifica.php?funcao=excluir&id="+id; | |
| 126 | + cPaint.call(p,"",retorna); | |
| 127 | + } | |
| 128 | +} | |
| 129 | +function importarXmlI() | |
| 130 | +{ | |
| 131 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 132 | + var retorna = function(retorno) | |
| 133 | + {$i("resultado").innerHTML = retorno.data} | |
| 134 | + var p = "../php/identifica.php?funcao=importarXmlI&xml="+$i("arquivo").value; | |
| 135 | + cPaint.call(p,"",retorna); | |
| 136 | +} | |
| 0 | 137 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,177 @@ |
| 1 | +/* | |
| 2 | +Title: Arvore | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do menu de mapas | |
| 5 | + | |
| 6 | +File: i3geo/admin/mapas.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | + | |
| 33 | +Ao retornar, por default, executa a função montaParametros() | |
| 34 | +*/ | |
| 35 | +function iniciaAdmin() | |
| 36 | +{ | |
| 37 | + verificaEditores() | |
| 38 | +} | |
| 39 | +function montaParametros() | |
| 40 | +{ | |
| 41 | + if(!$i("resultado")) | |
| 42 | + {document.body.innerHTML += "<div id=resultado ></div>"} | |
| 43 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 44 | + var p = "../php/mapas.php?funcao=pegaMapas"; | |
| 45 | + cPaint.call(p,"",listaMapas); | |
| 46 | +} | |
| 47 | +/* | |
| 48 | +Function: listaMapas | |
| 49 | + | |
| 50 | +Monta o html com os parametros e os divs que receberão os dados dos formulários. | |
| 51 | + | |
| 52 | +Para cada registro na variável $parameters, é montado um formulário. | |
| 53 | +*/ | |
| 54 | +function listaMapas(retorno) | |
| 55 | +{ | |
| 56 | + ins = "<p><input style=font-size:10px onclick='alterarMapas(\"\",\"resultado\")' type=button value='Adicionar um novo mapa' /></p>" | |
| 57 | + montaMapa(retorno,"resultado") | |
| 58 | +} | |
| 59 | +function montaMapa(retorno,onde) | |
| 60 | +{ | |
| 61 | + var d = retorno.data; | |
| 62 | + var nm = retorno.data.length | |
| 63 | + for (i=0;i<nm;i++) | |
| 64 | + { | |
| 65 | + if(!$i(d[i].id_mapa)) | |
| 66 | + ins += "<div id='"+d[i].id_mapa+"' >" | |
| 67 | + ins += "<fieldset><legend style='background-color:white;'><b>+- "+d[i].nome_mapa+"</b></legend>" | |
| 68 | + ins += "<div style=display:none > <table class=lista ><tr><td></td><td></td></tr>"; | |
| 69 | + var param = { | |
| 70 | + "linhas":[ | |
| 71 | + {titulo:"Nome",prefixoid:"nome_",id:"id_mapa",valor:"nome_mapa"}, | |
| 72 | + {titulo:"Descrição",prefixoid:"desc_",id:"id_mapa",valor:"desc_mapa"}, | |
| 73 | + {titulo:"Perfis",prefixoid:"perfil_",id:"id_mapa",valor:"perfil_mapa"}, | |
| 74 | + {titulo:"Extensão",prefixoid:"ext_",id:"id_mapa",valor:"ext_mapa"}, | |
| 75 | + {titulo:"Imagem",prefixoid:"imagem_",id:"id_mapa",valor:"imagem_mapa"}, | |
| 76 | + {titulo:"Outros",prefixoid:"outros_",id:"id_mapa",valor:"outros_mapa"}, | |
| 77 | + {titulo:"Direto",prefixoid:"linkdireto_",id:"id_mapa",valor:"linkdireto_mapa"} | |
| 78 | + ] | |
| 79 | + } | |
| 80 | + ins += (geraLinhas(d[i],param,3)); | |
| 81 | + ins += "<tr>" | |
| 82 | + ins += "<td>Temas: </td>" | |
| 83 | + ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='temas_"+d[i].id_mapa+"' value='"+d[i].temas_mapa+"' /></td>" | |
| 84 | + ins += "<td><select onchange='adicionaTema(\""+d[i].id_mapa+"\",this.value)'>" | |
| 85 | + ins += comboObjeto($temas,"codigo_tema","nome_tema","") | |
| 86 | + ins += "</select>" | |
| 87 | + ins += "</td>" | |
| 88 | + ins += "</tr>" | |
| 89 | + ins += "<tr>" | |
| 90 | + ins += "<td>Ligados: </td>" | |
| 91 | + ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='ligados_"+d[i].id_mapa+"' value='"+d[i].ligados_mapa+"' /></td>" | |
| 92 | + ins += "</tr>" | |
| 93 | + ins += "</table>" | |
| 94 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluir(\""+d[i].id_mapa+"\")'/></td>" | |
| 95 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarMapas(\""+d[i].id_mapa+"\",\""+d[i].id_mapa+"\")'/></td>" | |
| 96 | + ins += "</tr></table>" | |
| 97 | + if(d[i].linkdireto_mapa != "") | |
| 98 | + {var l = d[i].linkdireto_mapa;} | |
| 99 | + else | |
| 100 | + { | |
| 101 | + var l = "../ms_criamapa.php?temasa="+d[i].temas_mapa+"&layers="+d[i].ligados_mapa | |
| 102 | + if (d[i].ext_mapa != "") | |
| 103 | + {l += "&mapext="+d[i].ext_mapa} | |
| 104 | + if (d[i].outros_mapa != "") | |
| 105 | + {l += "&"+d[i].outros_mapa} | |
| 106 | + } | |
| 107 | + ins += "<br>Testar: <a href='"+l+"' target=blank >"+l+"</a>" | |
| 108 | + if(d[i].imagem_mapa != "") | |
| 109 | + ins += "<br><img src='"+d[i].imagem_mapa+"' />" | |
| 110 | + ins += "</div></fieldset><br>" | |
| 111 | + if(!$i(d[i].id_mapa)) | |
| 112 | + ins += "</div>" | |
| 113 | + } | |
| 114 | + $i(onde).innerHTML = ins | |
| 115 | + ativaLegenda() | |
| 116 | +} | |
| 117 | +function adicionaTema(id,codigo) | |
| 118 | +{ | |
| 119 | + var valor = $i("temas_"+id).value | |
| 120 | + if(valor == "") | |
| 121 | + $i("temas_"+id).value = codigo | |
| 122 | + else | |
| 123 | + $i("temas_"+id).value += " "+codigo | |
| 124 | +} | |
| 125 | +function alterarMapas(id_mapa,onde) | |
| 126 | +{ | |
| 127 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 128 | + //{ | |
| 129 | + var retorna = function(retorno) | |
| 130 | + { | |
| 131 | + if(id_mapa == "") | |
| 132 | + listaMapas(retorno); | |
| 133 | + else | |
| 134 | + {ins = "";montaMapa(retorno,onde)} | |
| 135 | + } | |
| 136 | + if (id_mapa != "") | |
| 137 | + { | |
| 138 | + var nome = $i("nome_"+id_mapa).value | |
| 139 | + var desc = $i("desc_"+id_mapa).value | |
| 140 | + var ext = $i("ext_"+id_mapa).value | |
| 141 | + var imagem = $i("imagem_"+id_mapa).value | |
| 142 | + var outros = $i("outros_"+id_mapa).value | |
| 143 | + var linkdireto = $i("linkdireto_"+id_mapa).value | |
| 144 | + var temas = $i("temas_"+id_mapa).value | |
| 145 | + var ligados = $i("ligados_"+id_mapa).value | |
| 146 | + var perfil = $i("perfil_"+id_mapa).value | |
| 147 | + } | |
| 148 | + else | |
| 149 | + { | |
| 150 | + var id_mapa = ""; | |
| 151 | + var perfil = ""; | |
| 152 | + } | |
| 153 | + var p = "../php/mapas.php?funcao=alterarMapas&id_mapa="+id_mapa+"&nome="+nome+"&desc="+desc+"&ext="+ext+"&imagem="+imagem+"&outros="+outros+"&linkdireto="+linkdireto+"&temas="+temas+"&ligados="+ligados+"&perfil="+perfil | |
| 154 | + cPaint.call(p,"",retorna); | |
| 155 | + //} | |
| 156 | +} | |
| 157 | +function excluir(id) | |
| 158 | +{ | |
| 159 | + if(confirm("Você realmente quer fazer isso?")) | |
| 160 | + { | |
| 161 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 162 | + var retorna = function() | |
| 163 | + { | |
| 164 | + montaParametros() | |
| 165 | + } | |
| 166 | + var p = "../php/mapas.php?funcao=excluir&id="+id; | |
| 167 | + cPaint.call(p,"",retorna); | |
| 168 | + } | |
| 169 | +} | |
| 170 | +function importarXmlMapas() | |
| 171 | +{ | |
| 172 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 173 | + var retorna = function(retorno) | |
| 174 | + {$i("resultado").innerHTML = retorno.data} | |
| 175 | + var p = "../php/mapas.php?funcao=importarXmlMapas&xml="+$i("arquivo").value; | |
| 176 | + cPaint.call(p,"",retorna); | |
| 177 | +} | |
| 0 | 178 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,118 @@ |
| 1 | +/* | |
| 2 | +Title: mapfiles | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração de mapfiles básicos | |
| 5 | + | |
| 6 | +File: i3geo/admin/mapfiles.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | +*/ | |
| 33 | +function iniciaAdmin() | |
| 34 | +{ | |
| 35 | +$parametros = { | |
| 36 | + "simples": [ | |
| 37 | + { mensagem: "Arquivo que define as fontes de texto utilizadas",cabeca: "FONTSET", variavel: "FONTSET"}, | |
| 38 | + { mensagem: "Arquivo que define a simbologia",cabeca: "SYMBOLSET", variavel: "SYMBOLSET"}, | |
| 39 | + { mensagem: "Diretório com o caminho padrão para arquivos shapefile",cabeca: "SHAPEPATH", variavel: "SHAPEPATH"}, | |
| 40 | + { mensagem: "Extensão geográfica. Após alterar os valores, clique na imagem para atualizar.",cabeca: "EXTENT", variavel: "EXTENT"}, | |
| 41 | + { mensagem: "Endereço da imagem de referência",cabeca: "IMAGE", variavel: "IMAGE"}, | |
| 42 | + { mensagem: "Caminho para o armazenamento das imagens temporárias",cabeca: "IMAGEPATH", variavel: "IMAGEPATH"}, | |
| 43 | + { mensagem: "Complemento para a url das imagens",cabeca: "IMAGEURL", variavel: "IMAGEURL"} | |
| 44 | + ]}; | |
| 45 | + verificaEditores() | |
| 46 | +} | |
| 47 | +/* | |
| 48 | +Function: montaParametros | |
| 49 | + | |
| 50 | +Monta o html com os parametros | |
| 51 | +*/ | |
| 52 | +function montaParametros() | |
| 53 | +{ | |
| 54 | + montaCampos() | |
| 55 | + pegaParametros() | |
| 56 | +} | |
| 57 | +/* | |
| 58 | + | |
| 59 | +http://labs.metacarta.com/wms-c/Basic.py?LAYERS=basic&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-70,-40,-30,0&WIDTH=200&HEIGHT=200 | |
| 60 | + | |
| 61 | + | |
| 62 | +Function: pegaParametros | |
| 63 | + | |
| 64 | +Pega os parâmetros do mapfiles.php | |
| 65 | + | |
| 66 | +*/ | |
| 67 | +function pegaParametros() | |
| 68 | +{ | |
| 69 | + var l = $i("EXTENT").parentNode.parentNode.parentNode | |
| 70 | + l.innerHTML += "<div id=mapaRef ></div>" | |
| 71 | + var retorna = function(retorno) | |
| 72 | + { | |
| 73 | + for (i=0;i<$parametros.simples.length;i++) | |
| 74 | + { | |
| 75 | + if($i($parametros.simples[i].variavel)) | |
| 76 | + {$i($parametros.simples[i].variavel).value = eval("retorno.data."+$parametros.simples[i].variavel);} | |
| 77 | + } | |
| 78 | + maparef() | |
| 79 | + } | |
| 80 | + var p = "../php/mapfiles.php?funcao=pegaParametrosConfigura"; | |
| 81 | + cPaint.call(p,"",retorna); | |
| 82 | +} | |
| 83 | +function maparef() | |
| 84 | +{ | |
| 85 | + var bb = $i("EXTENT").value.split(" ") | |
| 86 | + var bb = bb.toString() | |
| 87 | + $i("mapaRef").innerHTML = "<br><img onclick='maparef()' title='Clique para atualizar' src='http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&LAYERS=baseraster&STYLES=default&SRS=EPSG%3A4326&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&BBOX="+bb+"&WIDTH=200&HEIGHT=200' />" | |
| 88 | +} | |
| 89 | +/* | |
| 90 | +Function - restauraPadrao | |
| 91 | + | |
| 92 | +Copia o arquivo ms_configura.default para mapfiles.php | |
| 93 | +*/ | |
| 94 | +function restauraPadrao() | |
| 95 | +{ | |
| 96 | + if(confirm("Você realmente quer fazer isso?")) | |
| 97 | + { | |
| 98 | + var retorna = function(retorno) | |
| 99 | + {window.location.reload();} | |
| 100 | + var p = "../php/mapfiles.php?funcao=restauraConfigura"; | |
| 101 | + cPaint.call(p,"",retorna); | |
| 102 | + } | |
| 103 | +} | |
| 104 | +/* | |
| 105 | +Function - salva | |
| 106 | + | |
| 107 | +Salva o novo valor de uma variável | |
| 108 | +*/ | |
| 109 | +function salva(variavel) | |
| 110 | +{ | |
| 111 | + if(confirm("Você realmente quer fazer isso?")) | |
| 112 | + { | |
| 113 | + var retorna = function(retorno) | |
| 114 | + {window.location.reload();} | |
| 115 | + var p = "../php/mapfiles.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value; | |
| 116 | + cPaint.call(p,"",retorna); | |
| 117 | + } | |
| 118 | +} | |
| 0 | 119 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,441 @@ |
| 1 | +/* | |
| 2 | +Title: Menutemas | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do menu de temas | |
| 5 | + | |
| 6 | +File: i3geo/admin/menutemas.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | +*/ | |
| 33 | +function iniciaAdmin() | |
| 34 | +{ | |
| 35 | + verificaEditores() | |
| 36 | +} | |
| 37 | +/* | |
| 38 | +Function: importarXmlMenu | |
| 39 | + | |
| 40 | +Importa um arquivo xml para o banco de dados. | |
| 41 | + | |
| 42 | +O xml deve ser estruturado no padrão menutemas.xml | |
| 43 | +*/ | |
| 44 | +function importarXmlMenu() | |
| 45 | +{ | |
| 46 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 47 | + var retorna = function(retorno) | |
| 48 | + {$i("resultado").innerHTML = retorno.data} | |
| 49 | + var p = "../php/menutemas.php?funcao=importarXmlMenu&nomemenu="+$i("nome").value+"&xml="+$i("arquivo").value; | |
| 50 | + cPaint.call(p,"",retorna); | |
| 51 | +} | |
| 52 | +/* | |
| 53 | +Function: montaParametros | |
| 54 | + | |
| 55 | +Monta o html com os parametros e os divs que receberão os dados dos formulários. | |
| 56 | + | |
| 57 | +Para cada registro na variável $parametrs, é montado um formulário. | |
| 58 | +*/ | |
| 59 | +function montaParametros() | |
| 60 | +{ | |
| 61 | + var ins = "" | |
| 62 | + for (i=0;i<$parametros.simples.length;i++) | |
| 63 | + { | |
| 64 | + ins += "<fieldset><legend><b>"+$parametros.simples[i].cabeca+"</b></legend>" | |
| 65 | + ins += "<p><input style=font-size:10px onclick='pegaParametros()' type=button value='Listar existentes' />" | |
| 66 | + ins += " Filtro:<input id=filtro style=font-size:10px type=text value='' size=30 title='Texto para filtrar' /></p>" | |
| 67 | + ins += "<p><input onclick='alterar(\""+$parametros.simples[i].variavel+"\",\"\")' type=button value='Adicionar um novo' /></p>" | |
| 68 | + ins += "<div id='"+$parametros.simples[i].variavel+"' ></div>" | |
| 69 | + ins += "<p class=mensagem >"+$parametros.simples[i].mensagem+"</p>" | |
| 70 | + ins += "<p><input onclick='alterar(\""+$parametros.simples[i].variavel+"\",\"\")' type=button value='Adicionar um novo' /></p>" | |
| 71 | + ins += "</fieldset><br>" | |
| 72 | + } | |
| 73 | + document.body.innerHTML += ins | |
| 74 | + //pegaParametros() | |
| 75 | +} | |
| 76 | +/* | |
| 77 | +Function: pegaParametros | |
| 78 | + | |
| 79 | +Pega os parâmetros do mapfiles.php | |
| 80 | + | |
| 81 | +*/ | |
| 82 | +function pegaParametros(tipo) | |
| 83 | +{ | |
| 84 | + if(tipo == "tags" || arguments.length == 0 && $i("tags")) | |
| 85 | + { | |
| 86 | + var retornaTags = function(retorno) | |
| 87 | + { | |
| 88 | + var r = retorno.data | |
| 89 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td></td><td></td></tr>"; | |
| 90 | + for (i=0;i<r.length;i++) | |
| 91 | + { | |
| 92 | + ins += "<tr>" | |
| 93 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"tags\",\""+r[i].id_tag+"\")'/></td>" | |
| 94 | + ins += "<td>" | |
| 95 | + ins += "<div class=aplicar title='Aplicar' onclick='alterar(\"tags\",\""+r[i].id_tag+"\")'/>" | |
| 96 | + ins += "</td>" | |
| 97 | + ins += "<td><input onchange=this.style.color='blue' id='nometag_"+r[i].id_tag+"' type=text size=40 value='"+r[i].nome+"'/></td>" | |
| 98 | + ins += "</tr>" | |
| 99 | + } | |
| 100 | + ins += "</table>" | |
| 101 | + $i("tags").innerHTML = ins; | |
| 102 | + } | |
| 103 | + var p = "../php/menutemas.php?funcao=pegaTags"; | |
| 104 | + cPaint.call(p,"pegaTags",retornaTags); | |
| 105 | + } | |
| 106 | + if(tipo == "menus" || arguments.length == 0 && $i("menus")) | |
| 107 | + { | |
| 108 | + var retornaMenus = function(retorno) | |
| 109 | + { | |
| 110 | + var r = retorno.data | |
| 111 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td><td><b>Aberto</td></tr>"; | |
| 112 | + for (i=0;i<r.length;i++) | |
| 113 | + { | |
| 114 | + ins += "<tr>" | |
| 115 | + ins += "<td>id= "+r[i].id_menu+"<div class=excluir title='Excluir' onclick='excluir(\"menus\",\""+r[i].id_menu+"\")'/></td>" | |
| 116 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\"menus\",\""+r[i].id_menu+"\")'/></td>" | |
| 117 | + ins += "<td><input onchange=this.style.color='blue' id='nomemenu_"+r[i].id_menu+"' type=text size=40 value='"+r[i].nome_menu+"'/></td>" | |
| 118 | + ins += "<td><input onchange=this.style.color='blue' id='descmenu_"+r[i].id_menu+"' type=text size=20 value='"+r[i].desc_menu+"' /></td>" | |
| 119 | + ins += "<td><select onchange=this.style.color='blue' id='abertomenu_"+r[i].id_menu+"' >" | |
| 120 | + ins += combosimnao(r[i].aberto) | |
| 121 | + ins += "</td></tr>" | |
| 122 | + } | |
| 123 | + ins += "</table>" | |
| 124 | + $i("menus").innerHTML = ins; | |
| 125 | + } | |
| 126 | + var p = "../php/menutemas.php?funcao=pegaMenus"; | |
| 127 | + cPaint.call(p,"pegaMenus",retornaMenus); | |
| 128 | + } | |
| 129 | + if(tipo == "grupos" || arguments.length == 0 && $i("grupos")) | |
| 130 | + { | |
| 131 | + var retornaGrupos = function(retorno) | |
| 132 | + { | |
| 133 | + var r = retorno.data | |
| 134 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td></tr>"; | |
| 135 | + for (i=0;i<r.length;i++) | |
| 136 | + { | |
| 137 | + ins += montaOpcoes("grupo",r[i].id_grupo,r[i].nome_grupo,r[i].desc_grupo) | |
| 138 | + } | |
| 139 | + ins += "</table>" | |
| 140 | + $i("grupos").innerHTML = ins; | |
| 141 | + } | |
| 142 | + var p = "../php/menutemas.php?funcao=pegaGrupos"; | |
| 143 | + cPaint.call(p,"pegaGrupos",retornaGrupos); | |
| 144 | + } | |
| 145 | + if(tipo == "subgrupos" || arguments.length == 0 && $i("subgrupos")) | |
| 146 | + { | |
| 147 | + var retornaSubGrupos = function(retorno) | |
| 148 | + { | |
| 149 | + var r = retorno.data | |
| 150 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td></tr>"; | |
| 151 | + for (i=0;i<r.length;i++) | |
| 152 | + { | |
| 153 | + ins += montaOpcoes("subgrupo",r[i].id_subgrupo,r[i].nome_subgrupo,r[i].desc_subgrupo) | |
| 154 | + } | |
| 155 | + ins += "</table>" | |
| 156 | + $i("subgrupos").innerHTML = ins; | |
| 157 | + } | |
| 158 | + var p = "../php/menutemas.php?funcao=pegaSubGrupos"; | |
| 159 | + cPaint.call(p,"pegaSubGrupos",retornaSubGrupos); | |
| 160 | + } | |
| 161 | + if(tipo == "temas" || arguments.length == 0 && $i("temas")) | |
| 162 | + { | |
| 163 | + var retornaTemas = function(retorno) | |
| 164 | + { | |
| 165 | + var r = retorno.data | |
| 166 | + ins = "" | |
| 167 | + for (var j=0;j<r.length;j++) | |
| 168 | + { | |
| 169 | + ins += "<div id=div_"+r[j].id_tema+" >" | |
| 170 | + var temp = montaDivTemas(r[j]) | |
| 171 | + ins += temp+"</div>" | |
| 172 | + } | |
| 173 | + $i("temas").innerHTML = ins; | |
| 174 | + ativaLegenda() | |
| 175 | + } | |
| 176 | + var p = "../php/menutemas.php?funcao=pegaTemas&filtro="+$i("filtro").value; | |
| 177 | + cPaint.call(p,"pegaTemas",retornaTemas); | |
| 178 | + } | |
| 179 | + | |
| 180 | + if(tipo == "arvore" || arguments.length == 0 && $i("arvore")) | |
| 181 | + { | |
| 182 | + var retornaArvore = function(retorno) | |
| 183 | + { | |
| 184 | + var r = retorno.data | |
| 185 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td></tr>"; | |
| 186 | + for (i=0;i<r.length;i++) | |
| 187 | + { | |
| 188 | + ins += "<tr>" | |
| 189 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"subgrupos\",\""+r[i].id_subgrupo+"\")'/></td>" | |
| 190 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\"subgrupos\",\""+r[i].id_subgrupo+"\")'/></td>" | |
| 191 | + ins += "<td><input onchange=this.style.color='blue' id='nomesubgrupo_"+r[i].id_subgrupo+"' type=text size=40 value='"+r[i].nome_subgrupo+"'/></td>" | |
| 192 | + ins += "<td><input onchange=this.style.color='blue' id='descsubgrupo_"+r[i].id_subgrupo+"' type=text size=20 value='"+r[i].desc_subgrupo+"' /></td></tr>" | |
| 193 | + } | |
| 194 | + ins += "</table>" | |
| 195 | + $i("subgrupos").innerHTML = ins; | |
| 196 | + } | |
| 197 | + var p = "../php/menutemas.php?funcao=pegaSubXGrupos"; | |
| 198 | + cPaint.call(p,"pegaSubXGrupos",retornaSubXGrupos); | |
| 199 | + } | |
| 200 | +} | |
| 201 | +/* | |
| 202 | +Function: montaOpcoes | |
| 203 | +*/ | |
| 204 | +function montaOpcoes(prefixo,id,nome,desc,opc) | |
| 205 | +{ | |
| 206 | + var ins = "<tr>" | |
| 207 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\""+prefixo+"s\",\""+id+"\")'/></td>" | |
| 208 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\""+prefixo+"s\",\""+id+"\")'/></td>" | |
| 209 | + ins += "<td><input onchange=this.style.color='blue' id='nome"+prefixo+"_"+id+"' type=text size=40 value='"+nome+"'/></td>" | |
| 210 | + ins += "<td><input onchange=this.style.color='blue' id='desc"+prefixo+"_"+id+"' type=text size=20 value='"+desc+"' /></td></tr>" | |
| 211 | + return (ins) | |
| 212 | +} | |
| 213 | +/* | |
| 214 | +Function: montaDivTemas | |
| 215 | + | |
| 216 | +Preenche a div com os dados de um tema específico na edição da lista de temas | |
| 217 | + | |
| 218 | +Parameters: | |
| 219 | + | |
| 220 | +i - objeto json com os dados para montar o formulário | |
| 221 | +*/ | |
| 222 | +function montaDivTemas(i) | |
| 223 | +{ | |
| 224 | + var ins = "<br><fieldset><legend>+- "+i.nome_tema+"</legend>" | |
| 225 | + ins += "<div style=display:none > <table class=lista ><tr><td></td></tr>"; | |
| 226 | + var param = { | |
| 227 | + "linhas":[ | |
| 228 | + {titulo:"Nome do tema",prefixoid:"nometema_",id:"id_tema",valor:"nome_tema"}, | |
| 229 | + {titulo:"Descrição",prefixoid:"desctema_",id:"id_tema",valor:"desc_tema"}, | |
| 230 | + {titulo:"Link para a fonte",prefixoid:"linktema_",id:"id_tema",valor:"link_tema"} | |
| 231 | + ] | |
| 232 | + } | |
| 233 | + ins += (geraLinhas(i,param,2)); | |
| 234 | + | |
| 235 | + ins += "<tr><td>Tags (separe com espaço):</td><td>" | |
| 236 | + ins += "<input type=text size=40 value='"+i.tags_tema+"' id='tagstema_"+i.id_tema+"' >" | |
| 237 | + ins += "<select onchange='registraTag(\"tagstema_"+i.id_tema+"\",this.value)'>" | |
| 238 | + ins += comboObjeto($listaTags,"nome","nome","") | |
| 239 | + ins += "</select></td></tr>" | |
| 240 | + | |
| 241 | + ins += "<tr><td>Tipo:</td><td>" | |
| 242 | + ins += "<select id='tipoatema_"+i.id_tema+"' />" | |
| 243 | + ins += "<option value='' " | |
| 244 | + if (i.tipoa_tema == ""){ins += "selected";} | |
| 245 | + ins += ">---</option>" | |
| 246 | + ins += "<option value='WMS' " | |
| 247 | + if (i.tipoa_tema == "WMS"){ins += "selected";} | |
| 248 | + ins += " >WMS<option>" | |
| 249 | + | |
| 250 | + ins += "<tr><td>Mapfile:</td><td>" | |
| 251 | + ins += "<select id='codigotema_"+i.id_tema+"' >" | |
| 252 | + ins += combolista($listaDeMapfiles,i.codigo_tema) | |
| 253 | + ins += "</select></td></tr>" | |
| 254 | + | |
| 255 | + ins += "<tr><td>Permite acesso via WMS/WFS?</td><td>" | |
| 256 | + ins += "<select id='ogctema_"+i.id_tema+"' >" | |
| 257 | + ins += combosimnao(i.ogc_tema) | |
| 258 | + ins += "</select></td></tr>" | |
| 259 | + | |
| 260 | + ins += "<tr><td>Permite o download na aplicação datadownload.htm?</td><td>" | |
| 261 | + ins += "<select id='downloadtema_"+i.id_tema+"' >" | |
| 262 | + ins += combosimnao(i.download_tema) | |
| 263 | + ins += "</select></td></tr>" | |
| 264 | + | |
| 265 | + ins += "<tr><td>Permite acesso via kml?</td><td>" | |
| 266 | + ins += "<select id='kmltema_"+i.id_tema+"' >" | |
| 267 | + ins += combosimnao(i.kml_tema) | |
| 268 | + ins += "</select></td></tr>" | |
| 269 | + | |
| 270 | + ins += "</table>" | |
| 271 | + ins += "<table><tr>"; | |
| 272 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"temas\",\""+i.id_tema+"\")'/></td>" | |
| 273 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\"temas\",\""+i.id_tema+"\")'/></td></table>" | |
| 274 | + | |
| 275 | + ins += "</div></fieldset>" | |
| 276 | + return(ins) | |
| 277 | +} | |
| 278 | +function registraTag(id,tag) | |
| 279 | +{ | |
| 280 | + var tags = $i(id).value | |
| 281 | + if(tag == "") | |
| 282 | + $i(id).value = tag | |
| 283 | + else | |
| 284 | + $i(id).value = $i(id).value+" "+tag | |
| 285 | +} | |
| 286 | +/* | |
| 287 | +Function: alterar | |
| 288 | + | |
| 289 | +Altera o valor de uma variável | |
| 290 | +*/ | |
| 291 | +function alterar(prefixo,id) | |
| 292 | +{ | |
| 293 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 294 | + //{ | |
| 295 | + var retorna = function() | |
| 296 | + {pegaParametros(prefixo);} | |
| 297 | + if(prefixo == "tags") | |
| 298 | + { | |
| 299 | + if (id != "") | |
| 300 | + { | |
| 301 | + var nome = $i("nometag_"+id).value | |
| 302 | + } | |
| 303 | + else | |
| 304 | + { | |
| 305 | + var nome = ""; | |
| 306 | + } | |
| 307 | + $i(prefixo).innerHTML =$mensagemAguarde | |
| 308 | + var p = "../php/menutemas.php?funcao=alteraTags&nome="+nome+"&id="+id; | |
| 309 | + //window.open(p) | |
| 310 | + | |
| 311 | + } | |
| 312 | + if(prefixo == "menus") | |
| 313 | + { | |
| 314 | + if (id != "") | |
| 315 | + { | |
| 316 | + var nome = $i("nomemenu_"+id).value | |
| 317 | + var desc = $i("descmenu_"+id).value | |
| 318 | + var aberto = $i("abertomenu_"+id).value | |
| 319 | + if(nome == "null"){var nome = "";} | |
| 320 | + if(desc == "null"){var desc = "";} | |
| 321 | + if(aberto == "null"){var aberto = "";} | |
| 322 | + } | |
| 323 | + else | |
| 324 | + { | |
| 325 | + var nome = ""; | |
| 326 | + var desc = ""; | |
| 327 | + var aberto = ""; | |
| 328 | + } | |
| 329 | + $i(prefixo).innerHTML =$mensagemAguarde | |
| 330 | + var p = "../php/menutemas.php?funcao=alteraMenus&nome="+nome+"&desc="+desc+"&id="+id+"&aberto="+aberto; | |
| 331 | + } | |
| 332 | + if(prefixo == "grupos") | |
| 333 | + { | |
| 334 | + if (id != "") | |
| 335 | + { | |
| 336 | + var nome = $i("nomegrupo_"+id).value | |
| 337 | + var desc = $i("descgrupo_"+id).value | |
| 338 | + if(nome == "null"){var nome = "";} | |
| 339 | + if(desc == "null"){var desc = "";} | |
| 340 | + } | |
| 341 | + else | |
| 342 | + { | |
| 343 | + var nome = ""; | |
| 344 | + var desc = ""; | |
| 345 | + } | |
| 346 | + $i(prefixo).innerHTML =$mensagemAguarde | |
| 347 | + var p = "../php/menutemas.php?funcao=alteraGrupos&nome="+nome+"&desc="+desc+"&id="+id; | |
| 348 | + } | |
| 349 | + if(prefixo == "subgrupos") | |
| 350 | + { | |
| 351 | + if (id != "") | |
| 352 | + { | |
| 353 | + var nome = $i("nomesubgrupo_"+id).value | |
| 354 | + var desc = $i("descsubgrupo_"+id).value | |
| 355 | + if(nome == "null"){var nome = "";} | |
| 356 | + if(desc == "null"){var desc = "";} | |
| 357 | + } | |
| 358 | + else | |
| 359 | + { | |
| 360 | + var nome = ""; | |
| 361 | + var desc = ""; | |
| 362 | + } | |
| 363 | + $i(prefixo).innerHTML =$mensagemAguarde | |
| 364 | + var p = "../php/menutemas.php?funcao=alteraSubGrupos&nome="+nome+"&desc="+desc+"&id="+id; | |
| 365 | + } | |
| 366 | + if(prefixo == "temas") | |
| 367 | + { | |
| 368 | + if (id != "") | |
| 369 | + { | |
| 370 | + var nome = $i("nometema_"+id).value | |
| 371 | + var codigo = $i("codigotema_"+id).value | |
| 372 | + var desc = $i("desctema_"+id).value | |
| 373 | + var tipoa = $i("tipoatema_"+id).value | |
| 374 | + var link = $i("linktema_"+id).value | |
| 375 | + var ogc = $i("ogctema_"+id).value | |
| 376 | + var kml = $i("kmltema_"+id).value | |
| 377 | + var download = $i("downloadtema_"+id).value | |
| 378 | + var tags = $i("tagstema_"+id).value | |
| 379 | + if(nome == "null"){var nome = "";} | |
| 380 | + if(codigo == "null"){var codigo = "";} | |
| 381 | + if(desc == "null"){var desc = "";} | |
| 382 | + if(tipoa == "null"){var tipoa = "";} | |
| 383 | + if(link == "null"){var link = "";} | |
| 384 | + if(ogc == "null"){var ogc = "";} | |
| 385 | + if(kml == "null"){var kml = "";} | |
| 386 | + if(download == "null"){var download = "";} | |
| 387 | + if(tags == "null"){var tags = "";} | |
| 388 | + } | |
| 389 | + else | |
| 390 | + { | |
| 391 | + var nome = ""; | |
| 392 | + var codigo = ""; | |
| 393 | + var desc = ""; | |
| 394 | + var link = ""; | |
| 395 | + var tipoa = ""; | |
| 396 | + var ogc = ""; | |
| 397 | + var kml = ""; | |
| 398 | + var download = ""; | |
| 399 | + var tags = ""; | |
| 400 | + } | |
| 401 | + $i(prefixo).innerHTML =$mensagemAguarde | |
| 402 | + var p = "../php/menutemas.php?funcao=alteraTemas&tags="+tags+"&download="+download+"&kml="+kml+"&ogc="+ogc+"&tipoa="+tipoa+"&desc="+desc+"&link="+link+"&nome="+nome+"&codigo="+codigo+"&id="+id; | |
| 403 | + } | |
| 404 | + | |
| 405 | + cPaint.call(p,"",retorna); | |
| 406 | + //} | |
| 407 | +} | |
| 408 | +/* | |
| 409 | +Function: excluir | |
| 410 | + | |
| 411 | +Exclui um registro | |
| 412 | +*/ | |
| 413 | +function excluir(prefixo,id) | |
| 414 | +{ | |
| 415 | + if(confirm("Você realmente quer fazer isso?")) | |
| 416 | + { | |
| 417 | + var retorna = function() | |
| 418 | + {pegaParametros(prefixo);} | |
| 419 | + $i(prefixo).innerHTML = $mensagemAguarde | |
| 420 | + var p = "../php/menutemas.php?funcao=excluirRegistro&id="+id+"&tabela="+prefixo; | |
| 421 | + cPaint.call(p,"",retorna); | |
| 422 | + } | |
| 423 | +} | |
| 424 | + | |
| 425 | +/* | |
| 426 | +Function: pegaMapfiles | |
| 427 | + | |
| 428 | +Pega a lista de mapfiles existentes no i3geo | |
| 429 | + | |
| 430 | +Parameters: | |
| 431 | + | |
| 432 | +retorna - nome da função que processará o resultado | |
| 433 | +*/ | |
| 434 | +function pegaMapfiles(retorna) | |
| 435 | +{ | |
| 436 | + var cPaint = new cpaint(); | |
| 437 | + //cPaint.set_async("true"); | |
| 438 | + cPaint.set_response_type("JSON"); | |
| 439 | + var p = "../php/menutemas.php?funcao=listaMapsTemas"; | |
| 440 | + cPaint.call(p,"listaMapsTemas",retorna); | |
| 441 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,117 @@ |
| 1 | +/* | |
| 2 | +Title: Admin | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração | |
| 5 | + | |
| 6 | +File: i3geo/admin/admin.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | +*/ | |
| 33 | +function iniciaAdmin() | |
| 34 | +{ | |
| 35 | +$parametros = { | |
| 36 | + "simples": [ | |
| 37 | + { mensagem: "Mensagem mostrada sempre que o i3geo é inicializado",cabeca: "Mensagem de inicialização", variavel: "$mensagemInicia"}, | |
| 38 | + { mensagem: "Texto mostrado na barra superior do navegador e em alguns aplicativos do i3geo, como a versão mobile",cabeca: "Título", variavel: "$tituloInstituicao"}, | |
| 39 | + { mensagem: "Diretório (caminho absoluto) utilizado para armazenar os mapfiles temporários e outros arquivos utilizados durante a operação do i3geo",cabeca: "Diretório temporário", variavel: "$dir_tmp"}, | |
| 40 | + { mensagem: "Local no servidor (caminho absoluto) onde o i3geo está armazenado",cabeca: "Localização do i3geo", variavel: "$locaplic"}, | |
| 41 | + { mensagem: "Diretório onde ficam os arquivos mapfiles dos temas disponíveis para uso na guia de adição de temas",cabeca: "Diretório com os temas", variavel: "$temasdir"}, | |
| 42 | + { mensagem: "Diretório onde ficam armazenados os arquivos de template HTML e mapfiles iniciais",cabeca: "Diretório aplicmap", variavel: "$temasaplic"}, | |
| 43 | + { mensagem: "Onde está armazenado o mapserv CGI no servidor",cabeca: "Mapserv CGI", variavel: "$locmapserv"}, | |
| 44 | + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de sistemas que são incluídos na guia de adição de temas",cabeca: "XML sistemas", variavel: "$locsistemas"}, | |
| 45 | + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de programas especiais executados na ferramenta de identificação",cabeca: "XML identifica", variavel: "$locidentifica"}, | |
| 46 | + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de mapas que são mostrados na versão mobile e na guia mapas",cabeca: "XML mapas", variavel: "$locmapas"}, | |
| 47 | + { mensagem: "(opcional) Endereço do arquivo XML ou programa PHP que gera o xml com a lista de atlas e pranchas utilizadas na interface Atlas do i3geo.",cabeca: "XML Atlas", variavel: "$atlasxml"}, | |
| 48 | + { mensagem: "Caminho onde fica o arquivo executável do software R",cabeca: "Caminho para o R", variavel: "$R_path"}, | |
| 49 | + { mensagem: "(depreciado) string de conexão com o banco de dados postgis para a realização de cálculos geométricos, como área. Na versão 5.x do mapserver não é mais necessário",cabeca: "Conexão postgis para cálculos", variavel: "$postgis_con"}, | |
| 50 | + { mensagem: "(depreciado) código da projeção definida no banco de dados postgis para cálculos de área",cabeca: "SRID postgis", variavel: "$srid_area"}, | |
| 51 | + { mensagem: "(opcional) string de conexão com o banco de dados para substituir o item CONECTION quando o mesmo estiver vazio",cabeca: "Substituição de conexão", variavel: "$postgis_mapa"}, | |
| 52 | + { mensagem: "sim|nao Define se o desenho da imagem do mapa será feito por meio do CGI ou não. A escolha do uso do CGI ou não deve ser testada para verificar qual a melhor performance em cada instalação.",cabeca: "Utiliza CGI", variavel: "$utilizacgi"}, | |
| 53 | + { mensagem: "sim|nao Expõe ou não o endereço do arquivo mapfile utilizado no mapa que está sendo usado. Quando essa variável for definida como nao algumas das funcionalidades do i3geo poderão ficar prejudicadas, mas sem comprometimento das funções principais",cabeca: "Expõe o mapfile", variavel: "$expoeMapfile"}, | |
| 54 | + { mensagem: "Arquivo (PHP) que define a conexão com o banco de dados administrativo. Mantendo esse valor como vazio, o i3geo irá utilizar o banco de dados padrão em SQLITE. Veja i3geo/ms_configura.php e i3geo/admin/conexao.php para maiores informações sobre como utilizar outros bancos de dados.",cabeca: "Conexão com o banco de dados administrativo", variavel: "$conexaoadmin"} | |
| 55 | + ]}; | |
| 56 | + verificaEditores() | |
| 57 | +} | |
| 58 | +/* | |
| 59 | +Function: montaParametros | |
| 60 | + | |
| 61 | +Monta o html com os parametros | |
| 62 | +*/ | |
| 63 | +function montaParametros() | |
| 64 | +{ | |
| 65 | + montaCampos() | |
| 66 | + pegaParametros() | |
| 67 | +} | |
| 68 | +/* | |
| 69 | +Function: pegaParametros | |
| 70 | + | |
| 71 | +Pega os parâmetros do ms_configura.php | |
| 72 | + | |
| 73 | +*/ | |
| 74 | +function pegaParametros() | |
| 75 | +{ | |
| 76 | + var retorna = function(retorno) | |
| 77 | + { | |
| 78 | + for (i=0;i<$parametros.simples.length;i++) | |
| 79 | + { | |
| 80 | + if($i($parametros.simples[i].variavel)) | |
| 81 | + {$i($parametros.simples[i].variavel).value = eval("retorno.data."+$parametros.simples[i].variavel);} | |
| 82 | + } | |
| 83 | + document.getElementById("aguarde").style.display="none" | |
| 84 | + } | |
| 85 | + var p = "../php/ms_configura.php?funcao=pegaParametrosConfigura"; | |
| 86 | + cPaint.call(p,"",retorna); | |
| 87 | +} | |
| 88 | +/* | |
| 89 | +Function - restauraPadrao | |
| 90 | + | |
| 91 | +Copia o arquivo ms_configura.default para ms_configura.php | |
| 92 | +*/ | |
| 93 | +function restauraPadrao() | |
| 94 | +{ | |
| 95 | + if(confirm("Você realmente quer fazer isso?")) | |
| 96 | + { | |
| 97 | + var retorna = function(retorno) | |
| 98 | + {window.location.reload();} | |
| 99 | + var p = "../php/ms_configura.php?funcao=restauraConfigura"; | |
| 100 | + cPaint.call(p,"",retorna); | |
| 101 | + } | |
| 102 | +} | |
| 103 | +/* | |
| 104 | +Function - salva | |
| 105 | + | |
| 106 | +Salva o novo valor de uma variável | |
| 107 | +*/ | |
| 108 | +function salva(variavel) | |
| 109 | +{ | |
| 110 | + if(confirm("Você realmente quer fazer isso?")) | |
| 111 | + { | |
| 112 | + var retorna = function(retorno) | |
| 113 | + {window.location.reload();} | |
| 114 | + var p = "../php/ms_configura.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value; | |
| 115 | + cPaint.call(p,"",retorna); | |
| 116 | + } | |
| 117 | +} | |
| 0 | 118 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,209 @@ |
| 1 | +/* | |
| 2 | +Title: Sistemas | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do cadastro de web services | |
| 5 | + | |
| 6 | +File: i3geo/admin/webservices.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | + | |
| 33 | +Ao retornar, por default, executa a função montaParametros() | |
| 34 | +*/ | |
| 35 | +function iniciaAdmin() | |
| 36 | +{ | |
| 37 | + verificaEditores() | |
| 38 | +} | |
| 39 | +function montaParametros() | |
| 40 | +{ | |
| 41 | + if(!$i("resultado")) | |
| 42 | + {document.body.innerHTML += "<div id=resultado ></div>"} | |
| 43 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 44 | + var p = "../php/sistemas.php?funcao=pegaSistemas"; | |
| 45 | + cPaint.call(p,"",listaSistemas); | |
| 46 | +} | |
| 47 | +/* | |
| 48 | +Function: listaSistemas | |
| 49 | + | |
| 50 | +Monta o html com os parametros e os divs que receberão os dados dos formulários. | |
| 51 | +*/ | |
| 52 | +function listaSistemas(retorno) | |
| 53 | +{ | |
| 54 | + ins = "<p><input style=font-size:10px onclick='alterarSistemas(\"\",\"resultado\")' type=button value='Adicionar um novo sistema' /></p>" | |
| 55 | + montaSistemas(retorno,"resultado") | |
| 56 | +} | |
| 57 | +function montaSistemas(retorno,onde) | |
| 58 | +{ | |
| 59 | + var d = retorno.data; | |
| 60 | + var nm = retorno.data.length | |
| 61 | + for (i=0;i<nm;i++) | |
| 62 | + { | |
| 63 | + if(!$i(d[i].id_sistema)) | |
| 64 | + {ins += "<div id="+d[i].id_sistema+" >"} | |
| 65 | + ins += "<fieldset><legend style='background-color:white;'><b>+- "+d[i].nome_sistema+"</b></legend>" | |
| 66 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
| 67 | + var param = { | |
| 68 | + "linhas":[ | |
| 69 | + {titulo:"Nome",prefixoid:"nome_",id:"id_sistema",valor:"nome_sistema"}, | |
| 70 | + {titulo:"Perfil",prefixoid:"perfil_",id:"id_sistema",valor:"perfil_sistema"} | |
| 71 | + ] | |
| 72 | + } | |
| 73 | + ins += (geraLinhas(d[i],param,2)); | |
| 74 | + ins += "</table>" | |
| 75 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluir(\""+d[i].id_sistema+"\")'/></td>" | |
| 76 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarSistemas(\""+d[i].id_sistema+"\",\""+d[i].id_sistema+"\")'/></td>" | |
| 77 | + ins += "</tr></table>" | |
| 78 | + | |
| 79 | + ins += "<fieldset><legend>+- Funções</legend>" | |
| 80 | + ins += "<div style=display:none ><p><input style=font-size:10px onclick='alterarFuncoes(\"\",\""+d[i].id_sistema+"\")' type=button value='Adicionar uma nova função' /></p>" | |
| 81 | + var nf = d[i].funcoes.length | |
| 82 | + for (j=0;j<nf;j++) | |
| 83 | + { | |
| 84 | + ins += "<fieldset><legend>+- "+d[i].funcoes[j].nome_funcao+"</legend>" | |
| 85 | + var func = d[i].funcoes[j] | |
| 86 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
| 87 | + var param = { | |
| 88 | + "linhas":[ | |
| 89 | + {titulo:"Nome da função",prefixoid:"nomefuncao_",id:"id_funcao",valor:"nome_funcao"}, | |
| 90 | + {titulo:"Perfil",prefixoid:"perfilfuncao_",id:"id_funcao",valor:"perfil_funcao"}, | |
| 91 | + {titulo:"Abrir programa",prefixoid:"abrir_",id:"id_funcao",valor:"abrir_funcao"}, | |
| 92 | + {titulo:"Largura da janela",prefixoid:"w_",id:"id_funcao",valor:"w_funcao"}, | |
| 93 | + {titulo:"Altura",prefixoid:"h_",id:"id_funcao",valor:"h_funcao"} | |
| 94 | + ] | |
| 95 | + } | |
| 96 | + ins += (geraLinhas(func,param,2)); | |
| 97 | + ins += "</table>" | |
| 98 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluirFuncoes(\""+d[i].funcoes[j].id_funcao+"\")'/></td>" | |
| 99 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarFuncoes(\""+d[i].funcoes[j].id_funcao+"\",\""+d[i].id_sistema+"\")'/></td>" | |
| 100 | + ins += "</tr></table>" | |
| 101 | + ins += "</div></fieldset><br>" | |
| 102 | + ins += "</div></fieldset>" | |
| 103 | + } | |
| 104 | + ins += "</div></fieldset>" | |
| 105 | + ins += "</fieldset><br>" | |
| 106 | + if(!$i(d[i].id_sistema)) | |
| 107 | + ins += "</div>" | |
| 108 | + } | |
| 109 | + $i(onde).innerHTML = ins | |
| 110 | + ativaLegenda() | |
| 111 | +} | |
| 112 | +function alterarFuncoes(id_funcao,id_sistema) | |
| 113 | +{ | |
| 114 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 115 | + //{ | |
| 116 | + var retorna = function(retorno) | |
| 117 | + { | |
| 118 | + if(id_funcao == "") | |
| 119 | + listaSistemas(retorno); | |
| 120 | + else | |
| 121 | + {ins = "";montaSistemas(retorno,id_sistema)} | |
| 122 | + } | |
| 123 | + if (id_funcao != "") | |
| 124 | + { | |
| 125 | + var nomefuncao = $i("nomefuncao_"+id_funcao).value | |
| 126 | + var perfil = $i("perfilfuncao_"+id_funcao).value | |
| 127 | + var abrir = $i("abrir_"+id_funcao).value | |
| 128 | + var w = $i("w_"+id_funcao).value | |
| 129 | + var h = $i("h_"+id_funcao).value | |
| 130 | + } | |
| 131 | + else | |
| 132 | + { | |
| 133 | + //var id_sistema = ""; | |
| 134 | + var id_funcao = "" | |
| 135 | + var nomefuncao = "" | |
| 136 | + var perfil = "" | |
| 137 | + var abrir = "" | |
| 138 | + var w = 200 | |
| 139 | + var h = 200 | |
| 140 | + } | |
| 141 | + var p = "../php/sistemas.php?funcao=alterarFuncoes&h="+h+"&w="+w+"&abrir="+abrir+"&perfil="+perfil+"&nomefuncao="+nomefuncao+"&id_funcao="+id_funcao+"&id_sistema="+id_sistema | |
| 142 | + cPaint.call(p,"",retorna); | |
| 143 | + //} | |
| 144 | +} | |
| 145 | +function alterarSistemas(id_sistema,onde) | |
| 146 | +{ | |
| 147 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 148 | + //{ | |
| 149 | + var retorna = function(retorno) | |
| 150 | + { | |
| 151 | + if(id_sistema == "") | |
| 152 | + listaSistemas(retorno); | |
| 153 | + else | |
| 154 | + {ins = "";montaSistemas(retorno,onde)} | |
| 155 | + } | |
| 156 | + if (id_sistema != "") | |
| 157 | + { | |
| 158 | + var nome = $i("nome_"+id_sistema).value | |
| 159 | + var perfil = $i("perfil_"+id_sistema).value | |
| 160 | + } | |
| 161 | + else | |
| 162 | + { | |
| 163 | + var id_sistema = ""; | |
| 164 | + var nome = "" | |
| 165 | + var perfil = "" | |
| 166 | + } | |
| 167 | + var p = "../php/sistemas.php?funcao=alterarSistemas&id_sistema="+id_sistema+"&nome="+nome+"&perfil="+perfil | |
| 168 | + cPaint.call(p,"",retorna); | |
| 169 | + //} | |
| 170 | +} | |
| 171 | +function excluir(id) | |
| 172 | +{ | |
| 173 | + if(confirm("Você realmente quer fazer isso?")) | |
| 174 | + { | |
| 175 | + var retorna = function(retorno) | |
| 176 | + { | |
| 177 | + if(retorno.data=="erro") | |
| 178 | + {alert("Não foi possivel excluir. Exclua as funcoes primeiro");} | |
| 179 | + else | |
| 180 | + { | |
| 181 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 182 | + montaParametros() | |
| 183 | + } | |
| 184 | + } | |
| 185 | + var p = "../php/sistemas.php?funcao=excluir&id="+id; | |
| 186 | + cPaint.call(p,"",retorna); | |
| 187 | + } | |
| 188 | +} | |
| 189 | +function excluirFuncoes(id) | |
| 190 | +{ | |
| 191 | + if(confirm("Você realmente quer fazer isso?")) | |
| 192 | + { | |
| 193 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 194 | + var retorna = function() | |
| 195 | + { | |
| 196 | + montaParametros() | |
| 197 | + } | |
| 198 | + var p = "../php/sistemas.php?funcao=excluirFuncoes&id="+id; | |
| 199 | + cPaint.call(p,"",retorna); | |
| 200 | + } | |
| 201 | +} | |
| 202 | +function importarXmlSistemas() | |
| 203 | +{ | |
| 204 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 205 | + var retorna = function(retorno) | |
| 206 | + {$i("resultado").innerHTML = retorno.data} | |
| 207 | + var p = "../php/sistemas.php?funcao=importarXmlSistemas&xml="+$i("arquivo").value; | |
| 208 | + cPaint.call(p,"",retorna); | |
| 209 | +} | |
| 0 | 210 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,791 @@ |
| 1 | +/* | |
| 2 | +Title: Arvore | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do menu de mapas | |
| 5 | + | |
| 6 | +File: i3geo/admin/mapas.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +contaN = 0; | |
| 29 | +objcontype = [ | |
| 30 | + {texto:"MS_INLINE",valor:"0"}, | |
| 31 | + {texto:"MS_SHAPEFILE",valor:"1"}, | |
| 32 | + {texto:"MS_TILED_SHAPEFILE",valor:"2"}, | |
| 33 | + {texto:"MS_SDE",valor:"3"}, | |
| 34 | + {texto:"MS_OGR",valor:"4"}, | |
| 35 | + {texto:"MS_TILED_OGR",valor:"5"}, | |
| 36 | + {texto:"MS_POSTGIS",valor:"6"}, | |
| 37 | + {texto:"MS_WMS",valor:"7"}, | |
| 38 | + {texto:"MS_ORACLESPATIAL",valor:"8"}, | |
| 39 | + {texto:"MS_WFS",valor:"9"}, | |
| 40 | + {texto:"MS_GRATICULE",valor:"10"}, | |
| 41 | + {texto:"MS_MYGIS",valor:"11"}, | |
| 42 | + {texto:"MS_RASTER",valor:"12"}, | |
| 43 | + {texto:"MS_PLUGIN",valor:"13"} | |
| 44 | +]; | |
| 45 | +objbool_tf = [ | |
| 46 | + {texto:"MS_TRUE",valor:"0"}, | |
| 47 | + {texto:"MS_FALSE",valor:"1"} | |
| 48 | +]; | |
| 49 | +objbool_of = [ | |
| 50 | + {texto:"MS_ON",valor:"2"}, | |
| 51 | + {texto:"MS_OFF",valor:"3"} | |
| 52 | +]; | |
| 53 | +objbool_yn = [ | |
| 54 | + {texto:"MS_YES",valor:"4"}, | |
| 55 | + {texto:"MS_NO",valor:"5"} | |
| 56 | +]; | |
| 57 | +objmapunits = [ | |
| 58 | + {texto:"MS_INCHES",valor:"0"}, | |
| 59 | + {texto:"MS_FEET",valor:"1"}, | |
| 60 | + {texto:"MS_MILES",valor:"2"}, | |
| 61 | + {texto:"MS_METERS",valor:"3"}, | |
| 62 | + {texto:"MS_KILOMETERS",valor:"4"}, | |
| 63 | + {texto:"MS_DD",valor:"5"}, | |
| 64 | + {texto:"MS_PIXELS",valor:"6"} | |
| 65 | +]; | |
| 66 | +objlayertypes = [ | |
| 67 | + {texto:"MS_LAYER_POINT",valor:"0"}, | |
| 68 | + {texto:"MS_LAYER_LINE",valor:"1"}, | |
| 69 | + {texto:"MS_LAYER_POLYGON",valor:"2"}, | |
| 70 | + {texto:"MS_LAYER_RASTER",valor:"3"}, | |
| 71 | + {texto:"MS_LAYER_ANNOTATION",valor:"4"}, | |
| 72 | + {texto:"MS_LAYER_QUERY",valor:"5"}, | |
| 73 | + {texto:"MS_LAYER_CIRCLE",valor:"6"}, | |
| 74 | + {texto:"MS_LAYER_TILEINDEX",valor:"7"}, | |
| 75 | + {texto:"MS_LAYER_CHART",valor:"8"} | |
| 76 | +]; | |
| 77 | +objstatus = [ | |
| 78 | + {texto:"MS_ON",valor:"1"}, | |
| 79 | + {texto:"MS_OFF",valor:"0"}, | |
| 80 | + {texto:"MS_DEFAULT",valor:"2"} | |
| 81 | +]; | |
| 82 | +objfonttypes = [ | |
| 83 | + {texto:"MS_TRUETYPE",valor:"0"}, | |
| 84 | + {texto:"MS_BITMAP",valor:"1"} | |
| 85 | +]; | |
| 86 | +objposition = [ | |
| 87 | + {texto:"MS_UL",valor:"0"}, | |
| 88 | + {texto:"MS_LR",valor:"1"}, | |
| 89 | + {texto:"MS_UR",valor:"2"}, | |
| 90 | + {texto:"MS_LL",valor:"3"}, | |
| 91 | + {texto:"MS_CR",valor:"4"}, | |
| 92 | + {texto:"MS_CL",valor:"5"}, | |
| 93 | + {texto:"MS_UC",valor:"6"}, | |
| 94 | + {texto:"MS_WMS",valor:"7"}, | |
| 95 | + {texto:"MS_LC",valor:"8"}, | |
| 96 | + {texto:"MS_CC",valor:"9"}, | |
| 97 | + {texto:"MS_AUTO",valor:"10"}, | |
| 98 | + {texto:"MS_XY",valor:"11"}, | |
| 99 | + {texto:"MS_FOLLOW",valor:"12"} | |
| 100 | +]; | |
| 101 | +objfontstyle = [ | |
| 102 | + {texto:"MS_TINY",valor:"0"}, | |
| 103 | + {texto:"MS_SMALL",valor:"1"}, | |
| 104 | + {texto:"MS_MEDIUM",valor:"2"}, | |
| 105 | + {texto:"MS_LARGE",valor:"3"}, | |
| 106 | + {texto:"MS_GIANT",valor:"4"}, | |
| 107 | +]; | |
| 108 | +objshapetype = [ | |
| 109 | + {texto:"MS_SHAPE_POINT",valor:"0"}, | |
| 110 | + {texto:"MS_SHAPE_LINE",valor:"1"}, | |
| 111 | + {texto:"MS_SHAPE_POLYGON",valor:"2"}, | |
| 112 | + {texto:"MS_SHAPE_NULL",valor:"3"} | |
| 113 | +]; | |
| 114 | +objshapefiletype = [ | |
| 115 | + {texto:"MS_SHP_POINT",valor:"0"}, | |
| 116 | + {texto:"MS_SHP_ARC",valor:"1"}, | |
| 117 | + {texto:"MS_SHP_POLYGON",valor:"2"}, | |
| 118 | + {texto:"MS_SHP_MULTIPOINT",valor:"3"} | |
| 119 | +]; | |
| 120 | +objalignment = [ | |
| 121 | + {texto:"MS_ALIGN_LEFT",valor:"0"}, | |
| 122 | + {texto:"MS_ALIGN_CENTER",valor:"1"}, | |
| 123 | + {texto:"MS_ALIGN_RIGHT",valor:"2"} | |
| 124 | +]; | |
| 125 | + | |
| 126 | +$i = function(i) | |
| 127 | +{return document.getElementById(i);}; | |
| 128 | + | |
| 129 | +var retorna = function(retorno) | |
| 130 | +{ | |
| 131 | + fontes = retorno.data; | |
| 132 | +} | |
| 133 | +var p = "../php/temas.php?funcao=pegaFontes"; | |
| 134 | +cPaint.call(p,"",retorna); | |
| 135 | + | |
| 136 | +function iniciaAdmin() | |
| 137 | +{ | |
| 138 | + verificaEditores() | |
| 139 | +} | |
| 140 | +function montaParametros() | |
| 141 | +{ | |
| 142 | + var retorna = function(retorno) | |
| 143 | + { | |
| 144 | + ins = "<select id=temaAtivo onchange='ativaTema(this.value)'>" | |
| 145 | + ins += comboObjeto(retorno.data,"codigo_tema","nome_tema","") | |
| 146 | + ins += "</select>" | |
| 147 | + $i("arquivoAtivo").innerHTML = ins | |
| 148 | + } | |
| 149 | + var p = "../php/menutemas.php?funcao=pegaTemas"; | |
| 150 | + cPaint.call(p,"",retorna); | |
| 151 | +} | |
| 152 | +function adicionarLayer() | |
| 153 | +{ | |
| 154 | + var codigoMap = $i("temaAtivo").value | |
| 155 | + if(codigoMap != "") | |
| 156 | + { | |
| 157 | + var retorna = function(retorno) | |
| 158 | + { | |
| 159 | + ativaTema(codigoMap) | |
| 160 | + } | |
| 161 | + var p = "../php/temas.php?funcao=criarNovoLayer&codigoMap="+codigoMap; | |
| 162 | + cPaint.call(p,"",retorna); | |
| 163 | + } | |
| 164 | +} | |
| 165 | +function criarNovoMap() | |
| 166 | +{ | |
| 167 | + var nome = $i("nomeNovoMap").value | |
| 168 | + var codigo = $i("codigoNovoMap").value | |
| 169 | + if(nome != "" && codigo != "") | |
| 170 | + { | |
| 171 | + var retorna = function(retorno) | |
| 172 | + { | |
| 173 | + $i("nomeNovoMap").value = "" | |
| 174 | + $i("codigoNovoMap").value = "" | |
| 175 | + $i("forms").style.display="none" | |
| 176 | + montaParametros() | |
| 177 | + } | |
| 178 | + var p = "../php/temas.php?funcao=criarNovoMap&nome="+nome+"&codigo="+codigo; | |
| 179 | + cPaint.call(p,"",retorna); | |
| 180 | + } | |
| 181 | +} | |
| 182 | +function ativaTema(codigoMap) | |
| 183 | +{ | |
| 184 | + var retorna = function(retorno) | |
| 185 | + { | |
| 186 | + var cl = retorno.data.layers | |
| 187 | + var ins = "" | |
| 188 | + for(c=0;c<cl.length;c++) | |
| 189 | + { | |
| 190 | + ins += "<br><fieldset><legend>+- "+cl[c]+"</legend><div >" | |
| 191 | + ins += "<div id='geral_"+cl[c]+"_"+codigoMap+"' >" | |
| 192 | + ins += "</div>" | |
| 193 | + ins += "<div id='metadados_"+cl[c]+"_"+codigoMap+"' >" | |
| 194 | + ins += "</div>" | |
| 195 | + ins += "<div id='classes_"+cl[c]+"_"+codigoMap+"' >" | |
| 196 | + ins += "</div>" | |
| 197 | + | |
| 198 | + ins += "</div></fieldset>" | |
| 199 | + } | |
| 200 | + $i("forms").innerHTML = ins | |
| 201 | + var ins = "" | |
| 202 | + for(c=0;c<cl.length;c++) | |
| 203 | + { | |
| 204 | + pegaCaracteristicasGerais(codigoMap,cl[c]) | |
| 205 | + pegaMetadados(codigoMap,cl[c]) | |
| 206 | + pegaClasses(codigoMap,cl[c]) | |
| 207 | + } | |
| 208 | + } | |
| 209 | + $i("forms").style.display="block" | |
| 210 | + var p = "../php/temas.php?funcao=pegaLayers&codigoMap="+codigoMap; | |
| 211 | + cPaint.call(p,"",retorna); | |
| 212 | +} | |
| 213 | +function pegaClasses(codigoMap,codigoLayer) | |
| 214 | +{ | |
| 215 | + var ins = "<br><fieldset style='background-color:beige'><legend>+- Classes</legend><div style=display:none >" | |
| 216 | + ins += "<p><input onclick=adicionarClasse('"+codigoLayer+"',this) type=button value='Adicionar classe' /></p>" | |
| 217 | + ins += "<br><fieldset><legend>+- Legenda (amostra)</legend><div style=display:none >" | |
| 218 | + ins += "<img id='legenda_"+codigoLayer+"' src='../ogc.php?tema=bioma&service=wms&request=getlegendgraphic&layer="+codigoLayer+"&format=image/png' />" | |
| 219 | + ins += "</div></fieldset>" | |
| 220 | + var retorna = function(retorna) | |
| 221 | + { | |
| 222 | + var nc = retorna.data.length | |
| 223 | + for(c=0;c<nc;c++) | |
| 224 | + { | |
| 225 | + d = retorna.data[c] | |
| 226 | + var param = { | |
| 227 | + "linhas":[ | |
| 228 | + {texto:"Nome da classe para ser mostrada na legenda", | |
| 229 | + titulo:"name",prefixoid:"name_",id:codigoLayer+"_"+d.id,valor:"name"} | |
| 230 | + ] | |
| 231 | + } | |
| 232 | + | |
| 233 | + ins += "<br><fieldset><legend>+- "+d.id+"</legend><div style=display:none >" | |
| 234 | + ins += "<p><input onclick=excluirClasse('"+codigoLayer+"','"+d.id+"',this) type=button value='Excluir classe' /></p>" | |
| 235 | + ins += "<br><fieldset><legend>+- status</legend><div style=display:none >" | |
| 236 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Sets the current display status of the class. Default turns the class on.</p>" | |
| 237 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='status_"+codigoLayer+"_"+d.id+"' >" | |
| 238 | + ins += comboObjeto(objstatus,"valor","texto",d.dados.status) | |
| 239 | + ins += "</select>" | |
| 240 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasse(\""+codigoLayer+"_"+d.id+"\",\"status\",this)'/>" | |
| 241 | + ins += "</p></div></fieldset>" | |
| 242 | + | |
| 243 | + ins += "<br><fieldset><legend>+- expression</legend><div style=display:none >" | |
| 244 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Four types of expressions are now supported to define class membership. String comparisons, regular expressions, simple logical expressions, and string functions. If no expression is given, then all features are said to belong to this class.<br>String comparisons are case sensitive and are the fastest to evaluate. No special delimiters are necessary although string must be quoted if they contain special characters. (As a matter of good habit, it is recommended you quote all strings).<br>Regular expressions function just like previous versions of MapServer. However, you must now delimit a regular expression using /regex/. No quotes should be used.<br><br>Logical expressions allow you to build fairly complex tests based on one or more attributes and therefore are only available with shapefiles. Logical expressions are delimited by parentheses '(expression)'. Attribute names are delimited by square brackets '[ATTRIBUTE]'. These names are case sensitive and must match the items in the shapefile. For example: EXPRESSION ([POPULATION] > 50000 AND '[LANGUAGE]' eq 'FRENCH') ... The following logical operators are supported: =,>,<,<=,>=,=,or,and,lt,gt,ge,le,eq,ne. As you might expect this level of complexity is slower to process.<br>One string function exists: length(). This obviously computes the length of a string. An example follows:<br>EXPRESSION (length('[NAME_E]') < 8)<br>String comparisons and regular expressions work from the classitem defined at the layer level. You may mix expression types within the different classes of a layer.</p>" | |
| 245 | + ins += "<p><input type=text onchange='this.style.color=\"blue\"' id='expression_"+codigoLayer+"_"+d.id+"' value=\""+d.dados.expression+"\" />" | |
| 246 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasse(\""+codigoLayer+"_"+d.id+"\",\"expression\",this)'/>" | |
| 247 | + ins += "</p></div></fieldset>" | |
| 248 | + | |
| 249 | + ins += (geraLinhas2(d.dados,param,"salvarClasse")); | |
| 250 | + | |
| 251 | + var param = { | |
| 252 | + "linhas":[ | |
| 253 | + {texto:"Full filename of the legend image for the CLASS. This image is used when building a legend (or requesting a legend icon via MapScript or the CGI application).", | |
| 254 | + titulo:"keyimage",prefixoid:"keyimage_",id:codigoLayer+"_"+d.id,valor:"keyimage"}, | |
| 255 | + {texto:"Maximum scale at which this CLASS is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
| 256 | + titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer+"_"+d.id,valor:"maxscale"}, | |
| 257 | + {texto:"Minimum scale at which this CLASS is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
| 258 | + titulo:"minscale",prefixoid:"minscale_",id:codigoLayer+"_"+d.id,valor:"minscale"}, | |
| 259 | + {texto:"Maximum size in pixels to draw a symbol. Default is 50.", | |
| 260 | + titulo:"maxsize",prefixoid:"maxsize_",id:codigoLayer+"_"+d.id,valor:"maxsize"}, | |
| 261 | + {texto:"Minimum size in pixels to draw a symbol. Default is 0.", | |
| 262 | + titulo:"minsize",prefixoid:"minsize_",id:codigoLayer+"_"+d.id,valor:"minsize"}, | |
| 263 | + {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. For vector (and ellipse) symbol types the default size is based on the range of Y values in the POINTS defining the symbol. For pixmaps, the default is the vertical size of the image. Default size is 1 for TTF symbols.", | |
| 264 | + titulo:"size",prefixoid:"size_",id:codigoLayer+"_"+d.id,valor:"size"}, | |
| 265 | + {texto:"Static text to label features in this class with. This overrides values obtained from the LABELTIEM. The string may be given as an expression delimited using the ()'s. This allows you to concatenate multiple attributes into a single label. For example: ([FIRSTNAME],[LASTNAME]).", | |
| 266 | + titulo:"text",prefixoid:"text_",id:codigoLayer+"_"+d.id,valor:"text"} | |
| 267 | + ] | |
| 268 | + } | |
| 269 | + | |
| 270 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
| 271 | + ins += (geraLinhas2(d.dados,param,"salvarClasse")); | |
| 272 | + ins += "</fieldset>" | |
| 273 | + //labels | |
| 274 | + ins += "<br><fieldset><legend style=color:brown >+- Label (para ativar, defina LABELITEM em caract. gerais)</legend><div style=display:none >" | |
| 275 | + var param = { | |
| 276 | + "linhas":[ | |
| 277 | + {texto:"Color to draw text with.", | |
| 278 | + titulo:"color",prefixoid:"label_color_",id:codigoLayer+"_"+d.id,valor:"label.color"}, | |
| 279 | + {texto:"Text size. Use integer to give the size in pixels of your TrueType font based label, or any of theother 5 listed keywords to bitmap fonts.", | |
| 280 | + titulo:"size",prefixoid:"label_size_",id:codigoLayer+"_"+d.id,valor:"label.size"}, | |
| 281 | + {texto:"Position of the label relative to the labeling point (layers only). First letter is Y position, second letter is X position. Auto tells MapServer to calculate a label position that will not interfere with other labels. With points and polygons, MapServer selects from the 8 outer positions (i.e. excluding cc). With lines, it only uses lc or uc, until it finds a position that doesn't collide with labels that have already been drawn. If all positions cause a conflict, then the label is not drawn (Unless the label's FORCE a parameter is set to true). Auto placement is only available with cached labels.", | |
| 282 | + titulo:"position",prefixoid:"label_position_",id:codigoLayer+"_"+d.id,valor:"label.position"}, | |
| 283 | + {texto:"Padding, in pixels, around labels. Useful for maintaining spacing around text to enhance readability. Available only for cached labels. Default is 0.", | |
| 284 | + titulo:"buffer",prefixoid:"label_buffer_",id:codigoLayer+"_"+d.id,valor:"label.buffer"} | |
| 285 | + ] | |
| 286 | + } | |
| 287 | + | |
| 288 | + ins += "<br><fieldset><legend>+- font</legend><div style=display:none >" | |
| 289 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Font alias (as defined in the FONTSET) to use for labeling.</p>" | |
| 290 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_font_"+codigoLayer+"_"+d.id+"' >" | |
| 291 | + ins += combolista(fontes,d.dados.label.font) | |
| 292 | + ins += "</select>" | |
| 293 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".font\",this)'/>" | |
| 294 | + ins += "</p></div></fieldset>" | |
| 295 | + | |
| 296 | + ins += "<br><fieldset><legend>+- type</legend><div style=display:none >" | |
| 297 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Type of font to use. Generally bitmap fonts are faster to draw then TrueType fonts. However,TrueType fonts are scalable and available in a variety of faces. Be sure to set the FONT parameter ifyou select TrueType.</p>" | |
| 298 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
| 299 | + ins += comboObjeto(objfonttypes,"valor","texto",d.dados.label.type) | |
| 300 | + ins += "</select>" | |
| 301 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".type\",this)'/>" | |
| 302 | + ins += "</p></div></fieldset>" | |
| 303 | + | |
| 304 | + ins += "<br><fieldset><legend>+- partials</legend><div style=display:none >" | |
| 305 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Can text run off the edge of the map? Default is true.</p>" | |
| 306 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
| 307 | + ins += comboObjeto(objbool_tf,"valor","texto",d.dados.label.partials) | |
| 308 | + ins += "</select>" | |
| 309 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".partials\",this)'/>" | |
| 310 | + ins += "</p></div></fieldset>" | |
| 311 | + | |
| 312 | + ins += "<br><fieldset><legend>+- force</legend><div style=display:none >" | |
| 313 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Forces labels for a particular class on, regardless of collisions. Available only for cached labels. Default is false.</p>" | |
| 314 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
| 315 | + ins += comboObjeto(objbool_tf,"valor","texto",d.dados.label.force) | |
| 316 | + ins += "</select>" | |
| 317 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".force\",this)'/>" | |
| 318 | + ins += "</p></div></fieldset>" | |
| 319 | + | |
| 320 | + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | |
| 321 | + var param = { | |
| 322 | + "linhas":[ | |
| 323 | + {texto:"Color to draw a background rectangle (i.e. billboard). Off by default.", | |
| 324 | + titulo:"backgroundcolor",prefixoid:"label_backgroundcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundcolor"}, | |
| 325 | + {texto:"Color to draw a background rectangle (i.e. billboard) shadow. Off by default.", | |
| 326 | + titulo:"backgroundshadowcolor",prefixoid:"label_backgroundshadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowcolor"}, | |
| 327 | + {texto:"Color to draw a one pixel outline around the text.", | |
| 328 | + titulo:"outlinecolor",prefixoid:"label_outlinecolor_",id:codigoLayer+"_"+d.id,valor:"label.outlinecolor"}, | |
| 329 | + {texto:"Color of drop shadow.", | |
| 330 | + titulo:"shadowcolor",prefixoid:"label_shadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.shadowcolor"}, | |
| 331 | + {texto:"Shadow offset in pixels.", | |
| 332 | + titulo:"shadowsizex",prefixoid:"label_shadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizex"}, | |
| 333 | + {texto:"Shadow offset in pixels.", | |
| 334 | + titulo:"shadowsizey",prefixoid:"label_shadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizey"}, | |
| 335 | + {texto:"How far should the background rectangle be offset? Default is 1.", | |
| 336 | + titulo:"backgroundshadowsizex",prefixoid:"label_backgroundshadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizex"}, | |
| 337 | + {texto:"How far should the background rectangle be offset? Default is 1.", | |
| 338 | + titulo:"backgroundshadowsizey",prefixoid:"label_backgroundshadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizey"}, | |
| 339 | + {texto:"Minimum font size to use when scaling text (pixels). Default is 4.", | |
| 340 | + titulo:"minsize",prefixoid:"label_minsize_",id:codigoLayer+"_"+d.id,valor:"label.minsize"}, | |
| 341 | + {texto:"Maximum font size to use when scaling text (pixels). Default is 256.", | |
| 342 | + titulo:"maxsize",prefixoid:"label_maxsize_",id:codigoLayer+"_"+d.id,valor:"label.maxsize"}, | |
| 343 | + {texto:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", | |
| 344 | + titulo:"offsetx",prefixoid:"label_offsetx_",id:codigoLayer+"_"+d.id,valor:"label.offsetx"}, | |
| 345 | + {texto:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", | |
| 346 | + titulo:"offsety",prefixoid:"label_offsety_",id:codigoLayer+"_"+d.id,valor:"label.offsety"}, | |
| 347 | + {texto:"Angle, given in degrees, to draw the label or AUTO to allow the software to compute the angle, AUTO is valid for LINE layers only. FOLLOW was introduced in version 4.10 and tells map server to compute a curved label for appropriate linear features", | |
| 348 | + titulo:"angle",prefixoid:"label_angle_",id:codigoLayer+"_"+d.id,valor:"label.angle"}, | |
| 349 | + {texto:"Should text be antialiased? Note that this requires more available colors, decreased drawing performance, and results in slightly larger output images.", | |
| 350 | + titulo:"antialias",prefixoid:"label_antialias_",id:codigoLayer+"_"+d.id,valor:"label.antialias"}, | |
| 351 | + {texto:"Character that represents an end-of-line condition in label text, thus resulting in a multi-line label.", | |
| 352 | + titulo:"wrap",prefixoid:"label_wrap_",id:codigoLayer+"_"+d.id,valor:"label.wrap"}, | |
| 353 | + {texto:"Minimum size a feature must be to be labeled. Given in pixels. For line data the overall length of the displayed line is used, for polygons features the smallest dimension of the bounding box is used. Auto keyword tells MapServer to only label features that are larger than their corresponding label. Available for cached labels only.", | |
| 354 | + titulo:"minfeaturesize",prefixoid:"label_minfeaturesize_",id:codigoLayer+"_"+d.id,valor:"label.minfeaturesize"}, | |
| 355 | + {texto:"Minimum distance between duplicate labels. Given in pixels.", | |
| 356 | + titulo:"mindistance",prefixoid:"label_mindistance_",id:codigoLayer+"_"+d.id,valor:"label.mindistance"}, | |
| 357 | + {texto:"Supported encoding format to be used for labels. If the format is not supported, the label will not be drawn. Requires the iconv library (present on most systems). The library is always detected if present on the system, but if not the label will not be drawn. Required for displaying international characters in MapServer. More information can be found at: http://www.foss4g.org/FOSS4G/MAPSERVER/mpsnf-i18n-en.html.", | |
| 358 | + titulo:"encoding",prefixoid:"label_encoding_",id:codigoLayer+"_"+d.id,valor:"label.encoding"} | |
| 359 | + ] | |
| 360 | + } | |
| 361 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
| 362 | + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | |
| 363 | + ins += "</fieldset>" | |
| 364 | + | |
| 365 | + ins += "</div></fieldset>" | |
| 366 | + | |
| 367 | + ins += "<br><fieldset><legend style=color:brown >+- Estilos</legend><div style=display:none >" | |
| 368 | + ins += "<p><input onclick=adicionarEstilo('"+codigoLayer+"','"+d.id+"',this) type=button value='Adicionar estilo' /></p>" | |
| 369 | + ins += "<div id='estilos_"+codigoLayer+"_"+d.id+"' ></div>" | |
| 370 | + ins += "</div></fieldset>" | |
| 371 | + ins += "</div></fieldset>" | |
| 372 | + } | |
| 373 | + ins += "</div></fieldset>" | |
| 374 | + $i("classes_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
| 375 | + pegaEstilos(codigoMap,codigoLayer) | |
| 376 | + } | |
| 377 | + var p = "../php/temas.php?funcao=pegaClasses&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
| 378 | + cPaint.call(p,"",retorna); | |
| 379 | + | |
| 380 | +} | |
| 381 | +function pegaEstilos(codigoMap,codigoLayer) | |
| 382 | +{ | |
| 383 | + var retorna = function(retorno) | |
| 384 | + { | |
| 385 | + var nc = retorno.data.length | |
| 386 | + for(c=0;c<nc;c++) | |
| 387 | + { | |
| 388 | + var idclasse = retorno.data[c].classe | |
| 389 | + var estilos = retorno.data[c].estilos | |
| 390 | + var divestilos = "estilos_"+codigoLayer+"_"+idclasse; | |
| 391 | + var nes = retorno.data[c].estilos.length | |
| 392 | + for(est=0;est<nes;est++) | |
| 393 | + { | |
| 394 | + var ins = "" | |
| 395 | + var d = retorno.data[c].estilos[est].dados | |
| 396 | + var preid = codigoLayer+"_"+idclasse+"_"+est | |
| 397 | + var param = { | |
| 398 | + "linhas":[ | |
| 399 | + {texto:"The symbol name or number to use for all features if attribute tables are not used. The number is the index of the symbol in the symbol file, starting at 1, the 5th symbol in the file is therefore symbol number 5. You can also give your symbols names using the NAME keyword in the symbol definition file, and use those to refer to them. Default is 0, which results in a single pixel, single width line, or solid polygon fill, depending on layer type.You can also specify a gif or png filename. The path is relative to the location of the mapfile.", | |
| 400 | + titulo:"symbolname",prefixoid:"",id:"symbolname_"+preid,valor:"symbolname"}, | |
| 401 | + {texto:"Color to use for drawing features.", | |
| 402 | + titulo:"color",prefixoid:"",id:"color_"+preid,valor:"color"}, | |
| 403 | + {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
| 404 | + titulo:"size",prefixoid:"",id:"size_"+preid,valor:"size"}, | |
| 405 | + {texto:"Color to use for outlining polygons and certain marker symbols. Line symbols do not support outline colors.", | |
| 406 | + titulo:"outlinecolor",prefixoid:"",id:"outlinecolor_"+preid,valor:"outlinecolor"}, | |
| 407 | + {texto:"Width refers to the thickness of line work drawn, in pixels. Default is 1. For symbols of Type HATCH, the WIDTH is how thick the hatched lines are. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
| 408 | + titulo:"width",prefixoid:"",id:"width_"+preid,valor:"width"}, | |
| 409 | + ] | |
| 410 | + } | |
| 411 | + ins += "<br><fieldset style='background-color:rgb(240,240,240)'><legend>+- "+est+"</legend>" | |
| 412 | + ins += (geraLinhas2(d,param,"salvarEstilo")); | |
| 413 | + | |
| 414 | + var param = { | |
| 415 | + "linhas":[ | |
| 416 | + {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
| 417 | + titulo:"minsize",prefixoid:"",id:"minsize_"+preid,valor:"minsize"}, | |
| 418 | + {texto:"Maximum size in pixels to draw a symbol. Default is 50.", | |
| 419 | + titulo:"maxsize",prefixoid:"",id:"maxsize_"+preid,valor:"maxsize"}, | |
| 420 | + {texto:"Offset values for shadows, hollow symbols, etc ...", | |
| 421 | + titulo:"offsetx",prefixoid:"",id:"offsetx_"+preid,valor:"offsetx"}, | |
| 422 | + {texto:"Offset values for shadows, hollow symbols, etc ...", | |
| 423 | + titulo:"offsety",prefixoid:"",id:"offsety_"+preid,valor:"offsety"}, | |
| 424 | + {texto:"Should TrueType fonts and Cartoline symbols be antialiased.", | |
| 425 | + titulo:"antialias",prefixoid:"",id:"antialias_"+preid,valor:"antialias"}, | |
| 426 | + {texto:"Minimum width in pixels to draw the line work.", | |
| 427 | + titulo:"minwidth",prefixoid:"",id:"minwidth_"+preid,valor:"minwidth"}, | |
| 428 | + {texto:"Angle, given in degrees, to draw the line work. Default is 0. For symbols of Type HATCH, this is the angle of the hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
| 429 | + titulo:"angle",prefixoid:"",id:"angle_"+preid,valor:"angle"}, | |
| 430 | + {texto:"For MapServer versions <5, this is the attribute/field that stores the angle to be used in rendering. Angle is given in degrees with 0 meaning no rotation.", | |
| 431 | + titulo:"angleitem",prefixoid:"",id:"angleitem_"+preid,valor:"angleitem"}, | |
| 432 | + {texto:"For MapServer versions <5, this is the attribute/field that stores the size to be used in rendering. Value is given in pixels.", | |
| 433 | + titulo:"sizeitem",prefixoid:"",id:"sizeitem_"+preid,valor:"sizeitem"} | |
| 434 | + ] | |
| 435 | + } | |
| 436 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
| 437 | + ins += (geraLinhas2(d,param,"salvarEstilo")); | |
| 438 | + ins += "</fieldset>" | |
| 439 | + ins += "</fieldset>" | |
| 440 | + $i(divestilos).innerHTML = ins | |
| 441 | + } | |
| 442 | + } | |
| 443 | + ativaLegenda() | |
| 444 | + } | |
| 445 | + var p = "../php/temas.php?funcao=pegaEstilos&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
| 446 | + cPaint.call(p,"",retorna); | |
| 447 | +} | |
| 448 | +function pegaMetadados(codigoMap,codigoLayer) | |
| 449 | +{ | |
| 450 | + var ins = "<br><fieldset><legend>+- Metadados</legend><div style=display:none >" | |
| 451 | + var retorna = function(retorna) | |
| 452 | + { | |
| 453 | + ins += ""; | |
| 454 | + var param = { | |
| 455 | + "linhas":[ | |
| 456 | + {texto:"Nome que será utilizado na legenda do mapa e na guia 'Temas'", | |
| 457 | + titulo:"tema",prefixoid:"tema_",id:codigoLayer,valor:"tema"}, | |
| 458 | + {texto:"Denominador da escala da fonte dos dados utilizado pelo tema. É utilizado para apresentar a indicação de compatibilidade entre a escala do tema e a escala do mapa que está sendo visto.", | |
| 459 | + titulo:"escala",prefixoid:"escala_",id:codigoLayer,valor:"escala"}, | |
| 460 | + {texto:"Extensão geográfica máxima do tema, no formato xmin ymin xmax ymax. É utilizado na opção de 'zoom para o tema'. Quando o tema é baseado em shapefile, esse metadata não é necessário, pois o mapserver consegue calcular a extensão. Já em outros tipos de dados, como Postgis, o parâmetro é necessário. Nesse caso, se não for indicado, o botão de zoom para o tema não será visível para o usuário", | |
| 461 | + titulo:"extensao",prefixoid:"extensao_",id:codigoLayer,valor:"extensao"} | |
| 462 | + ] | |
| 463 | + } | |
| 464 | + ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); | |
| 465 | + | |
| 466 | + ins += "<br><fieldset><legend>+- aplicaextensao</legend><div style=display:none >" | |
| 467 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se a extensão geográfica do mapa deve ser alterada quando o tema for adicionado ao mapa</p>" | |
| 468 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='aplicaextensao_"+codigoLayer+"' >" | |
| 469 | + ins += combosimnao(retorna.data.aplicaextensao) | |
| 470 | + ins += "</select>" | |
| 471 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"aplicaextensao\",this)'/>" | |
| 472 | + ins += "</p></div></fieldset>" | |
| 473 | + | |
| 474 | + | |
| 475 | + ins += "<br><fieldset><legend>+- download</legend><div style=display:none >" | |
| 476 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o usuário pode fazer download do tema</p>" | |
| 477 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='download_"+codigoLayer+"' >" | |
| 478 | + ins += combosimnao(retorna.data.download) | |
| 479 | + ins += "</select>" | |
| 480 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"download\",this)'/>" | |
| 481 | + ins += "</p></div></fieldset>" | |
| 482 | + | |
| 483 | + var param = { | |
| 484 | + "linhas":[ | |
| 485 | + {texto:"Nomes das colunas da tabela de atributos do tema, que serão mostradas na ferramenta de identificação. Se for vazio, todas as colunas serão mostradas. A lista de itens deve ser separada por ',' e grafada em caixa alta no caso de shapefile.", | |
| 486 | + titulo:"itens",prefixoid:"itens_",id:codigoLayer,valor:"itens"}, | |
| 487 | + {texto:"Lista com os 'alias', ou apelidos, para os nomes das colunas listados no metadata 'itens'. Os alias devem ser separados por ',' e seguir a ordem definida em ITENS.", | |
| 488 | + titulo:"itensdesc",prefixoid:"itensdesc_",id:codigoLayer,valor:"itensdesc"}, | |
| 489 | + {texto:"Lista de links que serão incluídos em cada resultado de busca da ferramenta de identificação. A lista de links deve ser separada por ',', podendo-se incluir '' para indicar que o item não tem link. Exemplo de uso para inclusão de links para o site do IBGE quando um município é clicado no mapa:<br>ITENS 'codigo,nome2,uf'<br>ITENSDESC 'codigo do IBGE,nome do município,uf'<br>ITENSLLINK ',http://www.ibge.gov.br/munic2001/tabelas.php?codmun=[codigo]&descricao=[nome],'", | |
| 490 | + titulo:"itenslink",prefixoid:"itenslink_",id:codigoLayer,valor:"itenslink"}, | |
| 491 | + {texto:"Lista de colunas que serão utilizadas na opção de inclusão de 'etiquetas'. As etiquetas são mostradas no mapa quando o usuário estaciona o mouse por alguns instantes sobre o mapa. Separe a lista com ','.", | |
| 492 | + titulo:"tip",prefixoid:"tip_",id:codigoLayer,valor:"tip"}, | |
| 493 | + {texto:"Mensagem que será mostrada no rodapé do mapa quando o tema estiver visível. É útil para apresentar ao usuário observações especiais sobre o uso daquele tema.", | |
| 494 | + titulo:"mensagem",prefixoid:"mensagem_",id:codigoLayer,valor:"mensagem"}, | |
| 495 | + {texto:"É possível a geração de classes automaticamente por meio da definição de colunas na tabela de atributos do tema que armazenam as informações sobre cor, tamanho, etc. Esse metadata é utilizado para definir qual a coluna da tabela que identifica unicamente cada classe. Para cada valor será criada uma classe.<br>O tema que utiliza a geração de classes de forma automática, deve ter definido apenas uma classe. Essa classe será utilizada como padrão para geração das demais.", | |
| 496 | + titulo:"classesitem",prefixoid:"classesitem_",id:codigoLayer,valor:"classesitem"}, | |
| 497 | + {texto:"Nome da coluna que será utilizada para compor o nome das classes geradas automaticamente.", | |
| 498 | + titulo:"classesnome",prefixoid:"classesnome_",id:codigoLayer,valor:"classesnome"}, | |
| 499 | + {texto:"Nome da coluna que definirá a cor do símbolo utilizado em cada classe. As cores devem ser definidas em RGB.", | |
| 500 | + titulo:"classescor",prefixoid:"classescor_",id:codigoLayer,valor:"classescor"}, | |
| 501 | + {texto:"Nome da coluna que definirá o símbolo utilizado em cada classe.", | |
| 502 | + titulo:"classessimbolo",prefixoid:"classessimbolo_",id:codigoLayer,valor:"classessimbolo"}, | |
| 503 | + {texto:"Nome da coluna que definirá o tamanho de cada símbolo.", | |
| 504 | + titulo:"classestamanho",prefixoid:"classestamanho_",id:codigoLayer,valor:"classestamanho"} | |
| 505 | + ] | |
| 506 | + } | |
| 507 | + | |
| 508 | + | |
| 509 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
| 510 | + | |
| 511 | + ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); | |
| 512 | + | |
| 513 | + ins += "<br><fieldset><legend>+- classe</legend><div style=display:none >" | |
| 514 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM.</p>" | |
| 515 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='classe_"+codigoLayer+"' >" | |
| 516 | + ins += combosimnao(retorna.data.classe) | |
| 517 | + ins += "</select>" | |
| 518 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"classe\",this)'/>" | |
| 519 | + ins += "</p></div></fieldset>" | |
| 520 | + | |
| 521 | + ins += "<br><fieldset><legend>+- escondido</legend><div style=display:none >" | |
| 522 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'</p>" | |
| 523 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='escondido_"+codigoLayer+"' >" | |
| 524 | + ins += combosimnao(retorna.data.escondido) | |
| 525 | + ins += "</select>" | |
| 526 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"escondido\",this)'/>" | |
| 527 | + ins += "</p></div></fieldset>" | |
| 528 | + | |
| 529 | + ins += "<br><fieldset><legend>+- identifica</legend><div style=display:none >" | |
| 530 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o tema irá ser mostrado na ferramenta de identificação</p>" | |
| 531 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='identifica_"+codigoLayer+"' >" | |
| 532 | + ins += combosimnao(retorna.data.identifica) | |
| 533 | + ins += "</select>" | |
| 534 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"identifica\",this)'/>" | |
| 535 | + ins += "</p></div></fieldset>" | |
| 536 | + | |
| 537 | + ins += "</div></fieldset>" | |
| 538 | + | |
| 539 | + $i("metadados_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
| 540 | + } | |
| 541 | + var p = "../php/temas.php?funcao=pegaMetadados&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
| 542 | + cPaint.call(p,"",retorna); | |
| 543 | +} | |
| 544 | +function pegaCaracteristicasGerais(codigoMap,codigoLayer) | |
| 545 | +{ | |
| 546 | + var ins = "<p><input onclick=excluirLayer('"+codigoLayer+"',this) type=button value='Excluir este layer' /></p>" | |
| 547 | + ins += "<br><fieldset><legend>+- Características gerais</legend><div style=display:none >" | |
| 548 | + var retorna = function(retorna) | |
| 549 | + { | |
| 550 | + var param = { | |
| 551 | + "linhas":[ | |
| 552 | + {texto:"Layer name", | |
| 553 | + titulo:"name",prefixoid:"name_",id:codigoLayer,valor:"name"}, | |
| 554 | + {texto:"Database connection string to retrieve remote data.An SDE connection string consists of a hostname, instance name, database name, username and password separated by commas.A PostGIS connection string is basically a regular PostgreSQL connection string, it takes the form of 'user=nobody password=****** dbname=dbname host=localhost port=5432' An Oracle connection string: user/pass[@db]", | |
| 555 | + titulo:"connection",prefixoid:"connection_",id:codigoLayer,valor:"connection"}, | |
| 556 | + {texto:"Full filename of the spatial data to process. No file extension is necessary for shapefiles. Can be specified relative to the SHAPEPATH option from the Map Object.If this is an SDE layer, the parameter should include the name of the layer as well as the geometry column, i.e. 'mylayer,shape,myversion'.If this is a PostGIS layer, the parameter should be in the form of '<columnname> from <tablename>', where 'columnname' is the name of the column containing the geometry objects and 'tablename' is the name of the table from which the geometry data will be read.For Oracle, use 'shape FROM table' or 'shape FROM (SELECT statement)' or even more complex Oracle compliant queries! Note that there are important performance impacts when using spatial subqueries however. Try using MapServer's FILTER whenever possible instead. You can also see the SQL submitted by forcing an error, for instance by submitting a DATA parameter you know won't work, using for example a bad column name.", | |
| 557 | + titulo:"data",prefixoid:"data_",id:codigoLayer,valor:"data"} | |
| 558 | + ] | |
| 559 | + } | |
| 560 | + ins += "<p>Colunas: "+retorna.data.colunas+"</p>" | |
| 561 | + ins += "<br><fieldset><legend>+- status</legend><div style=display:none >" | |
| 562 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Sets the current status of the layer. Often modified by MapServer itself. Default turns the layer on permanently.</b></p>" | |
| 563 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='status_"+codigoLayer+"' >" | |
| 564 | + ins += comboObjeto(objstatus,"valor","texto",retorna.data.status) | |
| 565 | + ins += "</select>" | |
| 566 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"status\",this)'/>" | |
| 567 | + ins += "</p></fieldset>" | |
| 568 | + | |
| 569 | + ins += "<br><fieldset><legend>+- type</legend><div style=display:none >" | |
| 570 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Specifies how the data should be drawn. Need not be the same as the shapefile type. For example, a polygon shapefile may be drawn as a point layer, but a point shapefile may not be drawn as a polygon layer. Common sense rules. Annotation means that a label point will be calculated for the features, but the feature itself will not be drawn although a marker symbol can be optionally drawn. this allows for advanced labeling like numbered highway shields. Points are labeled at that point. Polygons are labeled first using a centroid, and if that doesn't fall in the polygon a scanline approach is used to guarantee the label falls within the feature. Lines are labeled at the middle of the longest arc in the visible portion of the line. Query only means the layer can be queried but not drawn.In order to differentiate between POLYGONs and POLYLINEs (which do not exist as a type), simply respectively use or ommit the COLOR keyword when classifying. If you use it, it's a polygon with a fill color, otherwise it's a polyline with only an OUTLINECOLOR.For CHART layers, see the Dynamic Charting howto.A circle must be defined by a a minimum bounding rectangle. That is, 2 points that define the smallest square that can contain it. These 2 points are the two opposite corners of said box.</b></p>" | |
| 571 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='type_"+codigoLayer+"' >" | |
| 572 | + ins += comboObjeto(objlayertypes,"valor","texto",retorna.data.type) | |
| 573 | + ins += "</select>" | |
| 574 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"type\",this)'/>" | |
| 575 | + ins += "</p></fieldset>" | |
| 576 | + | |
| 577 | + ins += "<br><fieldset><legend>+- connectiontype</legend><div style=display:none >" | |
| 578 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Type of connection. Default is local.</b></p>" | |
| 579 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='connectiontype_"+codigoLayer+"' >" | |
| 580 | + ins += comboObjeto(objcontype,"valor","texto",retorna.data.connectiontype) | |
| 581 | + ins += "</select>" | |
| 582 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"connectiontype\",this)'/>" | |
| 583 | + ins += "</p></div></fieldset>" | |
| 584 | + | |
| 585 | + ins += (geraLinhas2(retorna.data,param,"salvarLayer")); | |
| 586 | + | |
| 587 | + | |
| 588 | + var param = { | |
| 589 | + "linhas":[ | |
| 590 | + {texto:"Name of a group that this layer belongs to. The group name can then be reference as a regular layer name in the template files, allowing to do things like turning on and off a group of layers at once.", | |
| 591 | + titulo:"group",prefixoid:"group_",id:codigoLayer,valor:"group"}, | |
| 592 | + {texto:"Item that contains the location of an individual tile, default is 'location'.", | |
| 593 | + titulo:"tileitem",prefixoid:"tileitem_",id:codigoLayer,valor:"tileitem"}, | |
| 594 | + {texto:"Name of the tileindex file or layer. A tileindex is similar to an ArcInfo library index. The tileindex contains polygon features for each tile. The item that contains the location of the tiled data is given using the TILEITEM parameter. When a file is used as the tileindex for shapefile or raster layers, the tileindex should be a shapefile. For CONNECTIONTYPE OGR layers, any OGR supported datasource can be a tileindex. Normally the location should contain the path to the tile file relative to the shapepath, not relative to the tileindex itself. If the DATA parameter contains a value then it is added to the end of the location. When a tileindex layer is used, it works similarly to directly referring to a file, but any supported feature source can be used (ie. postgres, oracle).NOTE: All files in the tileindex should have the same coordinate system, and for vector files the same set of attributes in the same order.", | |
| 595 | + titulo:"tileindex",prefixoid:"tileindex_",id:codigoLayer,valor:"tileindex"}, | |
| 596 | + {texto:"Maximum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
| 597 | + titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer,valor:"maxscale"}, | |
| 598 | + {texto:"Minimum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
| 599 | + titulo:"minscale",prefixoid:"minscale_",id:codigoLayer,valor:"minscale"}, | |
| 600 | + {texto:"Sets the color index to treat as transparent for raster layers.", | |
| 601 | + titulo:"offsite (R,G,B)",prefixoid:"offsite_",id:codigoLayer,valor:"offsite"}, | |
| 602 | + {texto:"Sets the opacity level (or the inability to see through the layer) of all classed pixels for a given layer. The value can either be an integer in the range (0-100) or the named symbol 'ALPHA'. A value of 100 is opaque and 0 is fully transparent. Implemented in MapServer 5.0, to replace the deprecated TRANSPARENCY parameter.The 'ALPHA' symbol directs the MapServer rendering code to honor the indexed or alpha transparency of pixmap symbols used to style a layer. This is only needed in the case of RGB output formats, and should be used only when necessary as it is expensive to render transparent pixmap symbols onto an RGB map image.", | |
| 603 | + titulo:"opacity",prefixoid:"opacity_",id:codigoLayer,valor:"opacity"}, | |
| 604 | + {texto:"This parameter allows for data specific attribute filtering that is done at the same time spatial filtering is done, but before any CLASS expressions are evaluated. For OGR and shapefiles the string is simply a mapserver regular expression. For spatial databases the string is a SQL WHERE clause that is valid with respect to the underlying database.For example: FILTER type='road' and size <2", | |
| 605 | + titulo:"filter",prefixoid:"filter_",id:codigoLayer,valor:"filter"}, | |
| 606 | + {texto:"Item to use with simple FILTER expressions. OGR and shapefiles only.", | |
| 607 | + titulo:"filteritem",prefixoid:"filteritem_",id:codigoLayer,valor:"filteritem"}, | |
| 608 | + {texto:"Item name in attribute table to use for class annotation angles. Values should be in degrees.", | |
| 609 | + titulo:"labelangleitem",prefixoid:"labelangleitem_",id:codigoLayer,valor:"labelangleitem"}, | |
| 610 | + {texto:"Item name in attribute table to use for class annotation (i.e. labeling).", | |
| 611 | + titulo:"labelitem",prefixoid:"labelitem_",id:codigoLayer,valor:"labelitem"}, | |
| 612 | + {texto:"Maximum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
| 613 | + titulo:"labelmaxscale",prefixoid:"labelmaxscale_",id:codigoLayer,valor:"labelmaxscale"}, | |
| 614 | + {texto:"Minimum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
| 615 | + titulo:"labelminscale",prefixoid:"labelminscale_",id:codigoLayer,valor:"labelminscale"}, | |
| 616 | + {texto:"Item name in attribute table to use for class annotation sizes. Values should be in pixels.", | |
| 617 | + titulo:"labelsizeitem",prefixoid:"labelsizeitem_",id:codigoLayer,valor:"labelsizeitem"}, | |
| 618 | + {texto:"The scale at which symbols and/or text appear full size. This allows for dynamic scaling of objects based on the scale of the map. If not set then this layer will always appear at the same size. Scaling only takes place within the limits of MINSIZE and MAXSIZE as described above. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
| 619 | + titulo:"symbolscale",prefixoid:"symbolscale_",id:codigoLayer,valor:"symbolscale"}, | |
| 620 | + {texto:"Sensitivity for point based queries (i.e. via mouse and/or map coordinates). Given in TOLERANCEUNITS. If the layer is a POINT or a LINE, the default is 3. For all other layer types, the default is 0. To restrict polygon searches so that the point must occur in the polygon set the tolerance to zero.", | |
| 621 | + titulo:"tolerance",prefixoid:"tolerance_",id:codigoLayer,valor:"tolerance"}, | |
| 622 | + {texto:" ", | |
| 623 | + titulo:"projection",prefixoid:"projection_",id:codigoLayer,valor:"projection"} | |
| 624 | + ] | |
| 625 | + } | |
| 626 | + | |
| 627 | + | |
| 628 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
| 629 | + ins += (geraLinhas2(retorna.data,param,"salvarLayer")); | |
| 630 | + | |
| 631 | + ins += "<br><fieldset><legend>+- sizeunits</legend><div style=display:none >" | |
| 632 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Sets the unit of CLASS object SIZE values (default is pixels). Useful for simulating buffering.</b><p>" | |
| 633 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='sizeunits_"+codigoLayer+"' >" | |
| 634 | + ins += comboObjeto(objmapunits,"valor","texto",retorna.data.sizeunits) | |
| 635 | + ins += "</select>" | |
| 636 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"sizeunits\",this)'/>" | |
| 637 | + ins += "</p></div></fieldset>" | |
| 638 | + | |
| 639 | + ins += "</div></fieldset>" | |
| 640 | + | |
| 641 | + ins += "</div></fieldset>" | |
| 642 | + $i("geral_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
| 643 | + } | |
| 644 | + var p = "../php/temas.php?funcao=pegaCaracteristicasGerais&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
| 645 | + cPaint.call(p,"",retorna); | |
| 646 | +} | |
| 647 | +function testarMap() | |
| 648 | +{ | |
| 649 | + var codigo = $i("temaAtivo").value | |
| 650 | + window.open("../testamapfile.php?map="+codigo+".map") | |
| 651 | +} | |
| 652 | +function salvarLayer(layer,parametro,icone) | |
| 653 | +{ | |
| 654 | + icone.src="../imagens/aguarde.gif" | |
| 655 | + var retorna = function(retorno) | |
| 656 | + {icone.src="../imagens/02.png";} | |
| 657 | + var valor = $i(parametro+"_"+layer).value | |
| 658 | + $i(parametro+"_"+layer).style.color="black" | |
| 659 | + var p = "../php/temas.php?funcao=alteraLayer&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | |
| 660 | + cPaint.call(p,"",retorna); | |
| 661 | +} | |
| 662 | +function salvarMetadados(layer,parametro,icone) | |
| 663 | +{ | |
| 664 | + icone.src="../imagens/aguarde.gif" | |
| 665 | + var retorna = function(retorno) | |
| 666 | + {icone.src="../imagens/02.png";} | |
| 667 | + var valor = $i(parametro+"_"+layer).value | |
| 668 | + $i(parametro+"_"+layer).style.color="black" | |
| 669 | + var p = "../php/temas.php?funcao=alteraMetadados&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | |
| 670 | + cPaint.call(p,"",retorna); | |
| 671 | +} | |
| 672 | +function salvarClasse(layer,parametro,icone) | |
| 673 | +{ | |
| 674 | + icone.src="../imagens/aguarde.gif" | |
| 675 | + var temp = layer.split("_") | |
| 676 | + var layer = temp[0] | |
| 677 | + var classe = temp[1] | |
| 678 | + var retorna = function(retorno) | |
| 679 | + { | |
| 680 | + icone.src="../imagens/02.png"; | |
| 681 | + contaN++ | |
| 682 | + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | |
| 683 | + } | |
| 684 | + var valor = $i(parametro+"_"+layer+"_"+classe).value | |
| 685 | + $i(parametro+"_"+layer+"_"+classe).style.color="black" | |
| 686 | + var p = "../php/temas.php?funcao=alteraClasse&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | |
| 687 | + cPaint.call(p,"",retorna); | |
| 688 | +} | |
| 689 | +function salvarClasseLabel(layer,parametro,icone) | |
| 690 | +{ | |
| 691 | + icone.src="../imagens/aguarde.gif" | |
| 692 | + var temp = layer.split("_") | |
| 693 | + var layer = temp[0] | |
| 694 | + var classe = temp[1] | |
| 695 | + var parametro = parametro.split("."); | |
| 696 | + var parametro = parametro[1] | |
| 697 | + var retorna = function(retorno) | |
| 698 | + {icone.src="../imagens/02.png";} | |
| 699 | + var valor = $i("label_"+parametro+"_"+layer+"_"+classe).value | |
| 700 | + $i("label_"+parametro+"_"+layer+"_"+classe).style.color="black" | |
| 701 | + var p = "../php/temas.php?funcao=alteraClasseLabel&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | |
| 702 | + cPaint.call(p,"",retorna); | |
| 703 | +} | |
| 704 | +function salvarEstilo(estilo,parametro,icone) | |
| 705 | +{ | |
| 706 | + icone.src="../imagens/aguarde.gif" | |
| 707 | + var temp = estilo.split("_") | |
| 708 | + var layer = temp[1] | |
| 709 | + var classe = temp[2] | |
| 710 | + var estilo = temp[3] | |
| 711 | + var retorna = function(retorno) | |
| 712 | + { | |
| 713 | + icone.src="../imagens/02.png"; | |
| 714 | + contaN++ | |
| 715 | + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | |
| 716 | + } | |
| 717 | + var valor = $i(parametro+"_"+layer+"_"+classe+"_"+estilo).value | |
| 718 | + $i(parametro+"_"+layer+"_"+classe+"_"+estilo).style.color="black" | |
| 719 | + var p = "../php/temas.php?funcao=alteraEstilo&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"&estilo="+estilo+"¶metro="+parametro+"&valor="+valor; | |
| 720 | + cPaint.call(p,"",retorna); | |
| 721 | +} | |
| 722 | +function adicionarClasse(codigoLayer,botao) | |
| 723 | +{ | |
| 724 | + botao.style.color="red" | |
| 725 | + var o = botao.value | |
| 726 | + botao.value = "Aguarde..." | |
| 727 | + var codigoMap = $i("temaAtivo").value | |
| 728 | + if(codigoMap != "") | |
| 729 | + { | |
| 730 | + var retorna = function(retorno) | |
| 731 | + { | |
| 732 | + pegaClasses(codigoMap,codigoLayer) | |
| 733 | + } | |
| 734 | + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
| 735 | + cPaint.call(p,"",retorna); | |
| 736 | + } | |
| 737 | +} | |
| 738 | +function adicionarEstilo(codigoLayer,codigoClasse,botao) | |
| 739 | +{ | |
| 740 | + botao.style.color="red" | |
| 741 | + var o = botao.value | |
| 742 | + botao.value = "Aguarde..." | |
| 743 | + var codigoMap = $i("temaAtivo").value | |
| 744 | + if(codigoMap != "") | |
| 745 | + { | |
| 746 | + var retorna = function(retorno) | |
| 747 | + { | |
| 748 | + pegaEstilos(codigoMap,codigoLayer) | |
| 749 | + } | |
| 750 | + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | |
| 751 | + cPaint.call(p,"",retorna); | |
| 752 | + } | |
| 753 | +} | |
| 754 | +function excluirClasse(codigoLayer,codigoClasse,botao) | |
| 755 | +{ | |
| 756 | + if(confirm("Você realmente quer fazer isso?")) | |
| 757 | + { | |
| 758 | + botao.style.color="red" | |
| 759 | + var o = botao.value | |
| 760 | + botao.value = "Aguarde..." | |
| 761 | + var codigoMap = $i("temaAtivo").value | |
| 762 | + if(codigoMap != "") | |
| 763 | + { | |
| 764 | + var retorna = function(retorno) | |
| 765 | + { | |
| 766 | + pegaClasses(codigoMap,codigoLayer) | |
| 767 | + } | |
| 768 | + var p = "../php/temas.php?funcao=excluirClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | |
| 769 | + cPaint.call(p,"",retorna); | |
| 770 | + } | |
| 771 | + } | |
| 772 | +} | |
| 773 | +function excluirLayer(codigoLayer,botao) | |
| 774 | +{ | |
| 775 | + if(confirm("Você realmente quer fazer isso?")) | |
| 776 | + { | |
| 777 | + botao.style.color="red" | |
| 778 | + var o = botao.value | |
| 779 | + botao.value = "Aguarde..." | |
| 780 | + var codigoMap = $i("temaAtivo").value | |
| 781 | + if(codigoMap != "") | |
| 782 | + { | |
| 783 | + var retorna = function(retorno) | |
| 784 | + { | |
| 785 | + ativaTema(codigoMap) | |
| 786 | + } | |
| 787 | + var p = "../php/temas.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
| 788 | + cPaint.call(p,"",retorna); | |
| 789 | + } | |
| 790 | + } | |
| 791 | +} | |
| 0 | 792 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,155 @@ |
| 1 | +/* | |
| 2 | +Title: Arvore | |
| 3 | + | |
| 4 | +Funções javascript utilizadas no sistema de administração do cadastro de web services | |
| 5 | + | |
| 6 | +File: i3geo/admin/webservices.js | |
| 7 | + | |
| 8 | +About: Licença | |
| 9 | + | |
| 10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 11 | + | |
| 12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 14 | + | |
| 15 | +Este programa é software livre; você pode redistribuí-lo | |
| 16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 17 | +GNU conforme publicada pela Free Software Foundation; | |
| 18 | +tanto a versão 2 da Licença. | |
| 19 | +Este programa é distribuído na expectativa de que seja útil, | |
| 20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 24 | +GNU junto com este programa; se não, escreva para a | |
| 25 | +Free Software Foundation, Inc., no endereço | |
| 26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 27 | +*/ | |
| 28 | +/* | |
| 29 | +Function: iniciaAdmin | |
| 30 | + | |
| 31 | +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração | |
| 32 | + | |
| 33 | +Ao retornar, por default, executa a função montaParametros() | |
| 34 | +*/ | |
| 35 | +function iniciaAdmin() | |
| 36 | +{ | |
| 37 | + verificaEditores() | |
| 38 | +} | |
| 39 | +function montaParametros() | |
| 40 | +{ | |
| 41 | + if(!$i("resultado")) | |
| 42 | + {document.body.innerHTML += "<div id=resultado ></div>"} | |
| 43 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 44 | + var p = "../php/webservices.php?funcao=pegaWS"; | |
| 45 | + cPaint.call(p,"",listaWS); | |
| 46 | +} | |
| 47 | +/* | |
| 48 | +Function: listaWS | |
| 49 | + | |
| 50 | +Monta o html com os parametros e os divs que receberão os dados dos formulários. | |
| 51 | +*/ | |
| 52 | +function listaWS(retorno) | |
| 53 | +{ | |
| 54 | + ins = "<p><input style=font-size:10px onclick='alterarWS(\"\",\"resultado\")' type=button value='Adicionar um novo web service' /></p>" | |
| 55 | + montaWS(retorno,"resultado") | |
| 56 | +} | |
| 57 | +function montaWS(retorno,onde) | |
| 58 | +{ | |
| 59 | + var d = retorno.data; | |
| 60 | + var nm = retorno.data.length | |
| 61 | + for (i=0;i<nm;i++) | |
| 62 | + { | |
| 63 | + if(!$i(d[i].id_ws)) | |
| 64 | + {ins += "<div id="+d[i].id_ws+" >"} | |
| 65 | + ins += "<fieldset><legend style='background-color:white;'><b>+- "+d[i].nome_ws+"</b></legend>" | |
| 66 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td></tr>"; | |
| 67 | + var param = { | |
| 68 | + "linhas":[ | |
| 69 | + {titulo:"Nome",prefixoid:"nome_",id:"id_ws",valor:"nome_ws"}, | |
| 70 | + {titulo:"Descrição",prefixoid:"desc_",id:"id_ws",valor:"desc_ws"}, | |
| 71 | + {titulo:"Autor",prefixoid:"autor_",id:"id_ws",valor:"autor_ws"}, | |
| 72 | + {titulo:"Endereço",prefixoid:"link_",id:"id_ws",valor:"link_ws"}, | |
| 73 | + {titulo:"Nome",prefixoid:"nome_",id:"id_ws",valor:"nome_ws"} | |
| 74 | + ] | |
| 75 | + } | |
| 76 | + ins += (geraLinhas(d[i],param,2)); | |
| 77 | + ins += "<tr>" | |
| 78 | + ins += "<td>Tipo: </td>" | |
| 79 | + ins += "<td><select onchange='this.style.color=\"blue\"' id='tipo_"+d[i].id_ws+"' >" | |
| 80 | + ins += combolista(tipos,d[i].tipo_ws) | |
| 81 | + ins += "</select>" | |
| 82 | + ins += "</td>" | |
| 83 | + ins += "</tr>" | |
| 84 | + ins += "</table>" | |
| 85 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluir(\""+d[i].id_ws+"\")'/></td>" | |
| 86 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarWS(\""+d[i].id_ws+"\",\""+d[i].id_ws+"\")'/></td>" | |
| 87 | + ins += "</tr></table>" | |
| 88 | + ins += "</div></fieldset><br>" | |
| 89 | + if(!$i(d[i].id_ws)) | |
| 90 | + ins += "</div>" | |
| 91 | + } | |
| 92 | + $i(onde).innerHTML = ins | |
| 93 | + ativaLegenda() | |
| 94 | +} | |
| 95 | +function adicionaTema(id,codigo) | |
| 96 | +{ | |
| 97 | + var valor = $i("temas_"+id).value | |
| 98 | + if(valor == "") | |
| 99 | + $i("temas_"+id).value = codigo | |
| 100 | + else | |
| 101 | + $i("temas_"+id).value += " "+codigo | |
| 102 | +} | |
| 103 | +function alterarWS(id_ws,onde) | |
| 104 | +{ | |
| 105 | + //if(confirm("Você realmente quer fazer isso?")) | |
| 106 | + //{ | |
| 107 | + var retorna = function(retorno) | |
| 108 | + { | |
| 109 | + if(id_ws == "") | |
| 110 | + listaWS(retorno); | |
| 111 | + else | |
| 112 | + {ins = "";montaWS(retorno,onde)} | |
| 113 | + } | |
| 114 | + if (id_ws != "") | |
| 115 | + { | |
| 116 | + var nome = $i("nome_"+id_ws).value | |
| 117 | + var desc = $i("desc_"+id_ws).value | |
| 118 | + var autor = $i("autor_"+id_ws).value | |
| 119 | + var link = $i("link_"+id_ws).value | |
| 120 | + var tipo = $i("tipo_"+id_ws).value | |
| 121 | + } | |
| 122 | + else | |
| 123 | + { | |
| 124 | + var id_ws = ""; | |
| 125 | + var nome = "" | |
| 126 | + var desc = "" | |
| 127 | + var autor = "" | |
| 128 | + var link = "" | |
| 129 | + var tipo = "" | |
| 130 | + } | |
| 131 | + var p = "../php/webservices.php?funcao=alterarWS&id_ws="+id_ws+"&nome="+nome+"&desc="+desc+"&autor="+autor+"&link="+link+"&tipo="+tipo | |
| 132 | + cPaint.call(p,"",retorna); | |
| 133 | + //} | |
| 134 | +} | |
| 135 | +function excluir(id) | |
| 136 | +{ | |
| 137 | + if(confirm("Você realmente quer fazer isso?")) | |
| 138 | + { | |
| 139 | + $i("resultado").innerHTML = $mensagemAguarde; | |
| 140 | + var retorna = function() | |
| 141 | + { | |
| 142 | + montaParametros() | |
| 143 | + } | |
| 144 | + var p = "../php/webservices.php?funcao=excluir&id="+id; | |
| 145 | + cPaint.call(p,"",retorna); | |
| 146 | + } | |
| 147 | +} | |
| 148 | +function importarXmlWS() | |
| 149 | +{ | |
| 150 | + $i("resultado").innerHTML = $mensagemAguarde | |
| 151 | + var retorna = function(retorno) | |
| 152 | + {$i("resultado").innerHTML = retorno.data} | |
| 153 | + var p = "../php/webservices.php?funcao=importarXmlWS&xml="+$i("arquivo").value+"&tipo="+$i("tipo").value; | |
| 154 | + cPaint.call(p,"",retorna); | |
| 155 | +} | |
| 0 | 156 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,150 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Funções gerais | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/mapfiles.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +include_once("../../classesphp/pega_variaveis.php"); | |
| 31 | +error_reporting(0); | |
| 32 | +session_name("i3GeoPHP"); | |
| 33 | +if (isset($g_sid)) | |
| 34 | +{session_id($g_sid);} | |
| 35 | +session_start(); | |
| 36 | +foreach(array_keys($_SESSION) as $k) | |
| 37 | +{ | |
| 38 | + eval("\$".$k."='".$_SESSION[$k]."';"); | |
| 39 | +} | |
| 40 | +// | |
| 41 | +//carrega o phpmapscript | |
| 42 | +// | |
| 43 | +include_once ("../../classesphp/carrega_ext.php"); | |
| 44 | +include_once("../../ms_configura.php"); | |
| 45 | +include_once("../../pacotes/cpaint/cpaint2.inc.php"); | |
| 46 | +set_time_limit(120); | |
| 47 | +// | |
| 48 | +//verifica se o cliente pode editar | |
| 49 | +//se funcao for verificaEditores vai para case específico | |
| 50 | +// | |
| 51 | +if($funcao !="verificaEditores") | |
| 52 | +{if(verificaEditores($editores) == "nao"){exit;}} | |
| 53 | +if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
| 54 | +{ | |
| 55 | + $mapfile = "geral1windows"; | |
| 56 | +} | |
| 57 | +else | |
| 58 | +{ | |
| 59 | + $mapfile = "geral1"; | |
| 60 | +} | |
| 61 | +if($funcao == "limpar") | |
| 62 | +{ | |
| 63 | + $tabelas = array("i3geoadmin_atlas","i3geoadmin_atlasp","i3geoadmin_atlast","i3geoadmin_grupos","i3geoadmin_identifica","i3geoadmin_mapas","i3geoadmin_menus","i3geoadmin_n1","i3geoadmin_n2","i3geoadmin_n3","i3geoadmin_raiz","i3geoadmin_sistemas","i3geoadmin_sistemasf","i3geoadmin_subgrupos","i3geoadmin_tags","i3geoadmin_temas","i3geoadmin_ws"); | |
| 64 | + include("conexao.php"); | |
| 65 | + foreach($tabelas as $t) | |
| 66 | + { | |
| 67 | + $dbh->query("DELETE from $t"); | |
| 68 | + } | |
| 69 | + $dbh = null; | |
| 70 | + exit; | |
| 71 | +} | |
| 72 | +function verificaDuplicados($sql,$dbh) | |
| 73 | +{ | |
| 74 | + $res = $dbh->query($sql,PDO::FETCH_ASSOC); | |
| 75 | + if(count($res->fetchAll())>0) | |
| 76 | + return true; | |
| 77 | + else | |
| 78 | + return false; | |
| 79 | +} | |
| 80 | +/* | |
| 81 | +Function: verificaEditores | |
| 82 | + | |
| 83 | +Verifica se o usuário atual está cadastrado como editor | |
| 84 | + | |
| 85 | +Parameters: | |
| 86 | + | |
| 87 | +editores - array com a lista de editores obtido do ms_configura.php | |
| 88 | + | |
| 89 | +Return: | |
| 90 | + | |
| 91 | +string - sim|nao | |
| 92 | +*/ | |
| 93 | +function verificaEditores($editores) | |
| 94 | +{ | |
| 95 | + $editor = "nao"; | |
| 96 | + foreach ($editores as $e) | |
| 97 | + { | |
| 98 | + $e = gethostbyname($e); | |
| 99 | + $ip = "UNKNOWN"; | |
| 100 | + if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); | |
| 101 | + else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); | |
| 102 | + else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); | |
| 103 | + else $ip = "UNKNOWN"; | |
| 104 | + if ($e == $ip){$editor="sim";} | |
| 105 | + } | |
| 106 | + return $editor; | |
| 107 | +} | |
| 108 | +/* | |
| 109 | +Function: exclui | |
| 110 | + | |
| 111 | +Exlcui um registro de uma tabela | |
| 112 | +*/ | |
| 113 | +function exclui() | |
| 114 | +{ | |
| 115 | + global $tabela,$coluna,$id; | |
| 116 | + try | |
| 117 | + { | |
| 118 | + include("conexao.php"); | |
| 119 | + $dbh->query("DELETE from $tabela WHERE $coluna = $id"); | |
| 120 | + $dbh = null; | |
| 121 | + return "ok"; | |
| 122 | + } | |
| 123 | + catch (PDOException $e) | |
| 124 | + { | |
| 125 | + return "Error!: " . $e->getMessage(); | |
| 126 | + } | |
| 127 | +} | |
| 128 | +/* | |
| 129 | +Function: pegaDados | |
| 130 | + | |
| 131 | +Executa um sql de busca de dados | |
| 132 | +*/ | |
| 133 | +function pegaDados($sql) | |
| 134 | +{ | |
| 135 | + try | |
| 136 | + { | |
| 137 | + $resultado = array(); | |
| 138 | + include("conexao.php"); | |
| 139 | + $q = $dbh->query($sql,PDO::FETCH_ASSOC); | |
| 140 | + $resultado = $q->fetchAll(); | |
| 141 | + $dbh = null; | |
| 142 | + return $resultado; | |
| 143 | + } | |
| 144 | + catch (PDOException $e) | |
| 145 | + { | |
| 146 | + return "Error!: " . $e->getMessage(); | |
| 147 | + } | |
| 148 | +} | |
| 149 | + | |
| 150 | +?> | |
| 0 | 151 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,213 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Arvore | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/arvore.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +require_once("admin.php"); | |
| 31 | +$cp = new cpaint(); | |
| 32 | +//faz a busca da função que deve ser executada | |
| 33 | +switch ($funcao) | |
| 34 | +{ | |
| 35 | + //verifica os editores | |
| 36 | + case "verificaEditores": | |
| 37 | + $cp->set_data(verificaEditores($editores)); | |
| 38 | + $cp->return_data(); | |
| 39 | + break; | |
| 40 | + case "pegaTemasRaiz": | |
| 41 | + $cp->set_data(pegaDados("select * from i3geoadmin_raiz LEFT JOIN i3geoadmin_temas ON i3geoadmin_raiz.id_tema = i3geoadmin_temas.id_tema")); | |
| 42 | + $cp->return_data(); | |
| 43 | + break; | |
| 44 | + case "pegaN1": | |
| 45 | + $cp->set_data(pegaDados("select * from i3geoadmin_n1 where id_menu=$menu")); | |
| 46 | + $cp->return_data(); | |
| 47 | + break; | |
| 48 | + case "alterarRaiz": | |
| 49 | + alterarRaiz(); | |
| 50 | + $cp->set_data(pegaDados("select * from i3geoadmin_raiz LEFT JOIN i3geoadmin_temas ON i3geoadmin_raiz.id_tema = i3geoadmin_temas.id_tema")); | |
| 51 | + $cp->return_data(); | |
| 52 | + break; | |
| 53 | + case "alteraN1": | |
| 54 | + $cp->set_data(alteraN1()); | |
| 55 | + $cp->return_data(); | |
| 56 | + break; | |
| 57 | + case "alteraN2": | |
| 58 | + $cp->set_data(alteraN2()); | |
| 59 | + $cp->return_data(); | |
| 60 | + break; | |
| 61 | + case "alteraN3": | |
| 62 | + $cp->set_data(alteraN3()); | |
| 63 | + $cp->return_data(); | |
| 64 | + break; | |
| 65 | + case "pegaN2": | |
| 66 | + $cp->set_data(pegaDados("select * from i3geoadmin_n2 where id_n1=$idn1")); | |
| 67 | + $cp->return_data(); | |
| 68 | + break; | |
| 69 | + case "pegaN3": | |
| 70 | + $cp->set_data(pegaDados("select * from i3geoadmin_n3 where id_n2=$idn2")); | |
| 71 | + $cp->return_data(); | |
| 72 | + break; | |
| 73 | + case "excluir"; | |
| 74 | + if($tabela != "i3geoadmin_raiz") | |
| 75 | + { | |
| 76 | + $f = verificaFilhos(); | |
| 77 | + if(!$f) | |
| 78 | + $cp->set_data(exclui()); | |
| 79 | + else | |
| 80 | + $cp->set_data("erro"); | |
| 81 | + } | |
| 82 | + else | |
| 83 | + { | |
| 84 | + exclui(); | |
| 85 | + $cp->set_data(pegaDados("select * from i3geoadmin_raiz LEFT JOIN i3geoadmin_temas ON i3geoadmin_raiz.id_tema = i3geoadmin_temas.id_tema")); | |
| 86 | + } | |
| 87 | + $cp->return_data(); | |
| 88 | + break; | |
| 89 | +} | |
| 90 | +/* | |
| 91 | +Function: verificaFilhos | |
| 92 | + | |
| 93 | +Verifica se o pai tem filhos | |
| 94 | +*/ | |
| 95 | +function verificaFilhos() | |
| 96 | +{ | |
| 97 | + global $tabela,$coluna,$id; | |
| 98 | + try | |
| 99 | + { | |
| 100 | + $res = false; | |
| 101 | + if($tabela == "i3geoadmin_n2") | |
| 102 | + { | |
| 103 | + $r = pegaDados("select * from i3geoadmin_n3 where id_n2=$id"); | |
| 104 | + if(count($r) > 0) | |
| 105 | + $res = true; | |
| 106 | + } | |
| 107 | + if($tabela == "i3geoadmin_n1") | |
| 108 | + { | |
| 109 | + $r = pegaDados("select * from i3geoadmin_n2 where id_n1=$id"); | |
| 110 | + if(count($r) > 0) | |
| 111 | + $res = true; | |
| 112 | + } | |
| 113 | + return $res; | |
| 114 | + } | |
| 115 | + catch (PDOException $e) | |
| 116 | + { | |
| 117 | + return "Error!: " . $e->getMessage(); | |
| 118 | + } | |
| 119 | +} | |
| 120 | +/* | |
| 121 | +Function: alteraN3 | |
| 122 | + | |
| 123 | +Altera o registro de um nível 3 (temas) | |
| 124 | +*/ | |
| 125 | +function alteraN3() | |
| 126 | +{ | |
| 127 | + global $perfil,$id,$idtema,$idsubgrupo; | |
| 128 | + try | |
| 129 | + { | |
| 130 | + require_once("conexao.php"); | |
| 131 | + if($id != "") | |
| 132 | + $dbh->query("UPDATE i3geoadmin_n3 SET id_tema = '$idtema', n3_perfil = '$perfil' WHERE id_n3 = $id"); | |
| 133 | + else | |
| 134 | + $dbh->query("INSERT INTO i3geoadmin_n3 (id_n2,id_tema,n3_perfil) VALUES ($idsubgrupo,'', '')"); | |
| 135 | + $dbh = null; | |
| 136 | + return "ok"; | |
| 137 | + } | |
| 138 | + catch (PDOException $e) | |
| 139 | + { | |
| 140 | + return "Error!: " . $e->getMessage(); | |
| 141 | + } | |
| 142 | +} | |
| 143 | +/* | |
| 144 | +Function: alteraN2 | |
| 145 | + | |
| 146 | +Altera o registro de um nível 2 | |
| 147 | +*/ | |
| 148 | +function alteraN2() | |
| 149 | +{ | |
| 150 | + global $perfil,$id,$idsubgrupo,$idgrupo; | |
| 151 | + try | |
| 152 | + { | |
| 153 | + require_once("conexao.php"); | |
| 154 | + if($id != "") | |
| 155 | + $dbh->query("UPDATE i3geoadmin_n2 SET id_subgrupo = '$idsubgrupo', n2_perfil = '$perfil' WHERE id_n2 = $id"); | |
| 156 | + else | |
| 157 | + $dbh->query("INSERT INTO i3geoadmin_n2 (id_n1,id_subgrupo,n2_perfil) VALUES ($idgrupo,'', '')"); | |
| 158 | + $dbh = null; | |
| 159 | + return "ok"; | |
| 160 | + } | |
| 161 | + catch (PDOException $e) | |
| 162 | + { | |
| 163 | + return "Error!: " . $e->getMessage(); | |
| 164 | + } | |
| 165 | +} | |
| 166 | +/* | |
| 167 | +Function: alteraN1 | |
| 168 | + | |
| 169 | +Altera o registro de um nível 1 | |
| 170 | +*/ | |
| 171 | +function alteraN1() | |
| 172 | +{ | |
| 173 | + global $perfil,$idgrupo,$id,$idmenu; | |
| 174 | + try | |
| 175 | + { | |
| 176 | + require_once("conexao.php"); | |
| 177 | + if($id != "") | |
| 178 | + $dbh->query("UPDATE i3geoadmin_n1 SET id_grupo = '$idgrupo', n1_perfil = '$perfil' WHERE id_menu = $idmenu and id_n1 = $id"); | |
| 179 | + else | |
| 180 | + $dbh->query("INSERT INTO i3geoadmin_n1 (id_menu,id_grupo,n1_perfil) VALUES ($idmenu,'', '')"); | |
| 181 | + $dbh = null; | |
| 182 | + return "ok"; | |
| 183 | + } | |
| 184 | + catch (PDOException $e) | |
| 185 | + { | |
| 186 | + return "Error!: " . $e->getMessage(); | |
| 187 | + } | |
| 188 | +} | |
| 189 | +/* | |
| 190 | +Function: alterarRaiz | |
| 191 | + | |
| 192 | +Altera o registro na raiz de um nível | |
| 193 | +*/ | |
| 194 | +function alterarRaiz() | |
| 195 | +{ | |
| 196 | + global $id_nivel,$nivel,$id_raiz,$id_menu,$perfil,$id_tema; | |
| 197 | + try | |
| 198 | + { | |
| 199 | + include("conexao.php"); | |
| 200 | + if($id_raiz != "") | |
| 201 | + $dbh->query("UPDATE i3geoadmin_raiz SET id_nivel = '$nivel', nivel = '$nivel', perfil = '$perfil', id_menu = '$id_menu', id_tema = '$id_tema' WHERE id_raiz = $id_raiz"); | |
| 202 | + else | |
| 203 | + $dbh->query("INSERT INTO i3geoadmin_raiz (id_nivel,nivel,id_menu,perfil,id_tema) VALUES ($id_nivel,$nivel,$id_menu,'','')"); | |
| 204 | + $dbh = null; | |
| 205 | + return "ok"; | |
| 206 | + } | |
| 207 | + catch (PDOException $e) | |
| 208 | + { | |
| 209 | + return "Error!: " . $e->getMessage(); | |
| 210 | + } | |
| 211 | +} | |
| 212 | + | |
| 213 | +?> | |
| 0 | 214 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,309 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração do cadastro de sistemas | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/sistemas.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | + | |
| 31 | +include_once("admin.php"); | |
| 32 | +$cp = new cpaint(); | |
| 33 | +//faz a busca da função que deve ser executada | |
| 34 | +switch ($funcao) | |
| 35 | +{ | |
| 36 | + //verifica os editores | |
| 37 | + case "verificaEditores": | |
| 38 | + $cp->set_data(verificaEditores($editores)); | |
| 39 | + $cp->return_data(); | |
| 40 | + break; | |
| 41 | + | |
| 42 | + case "pegaAtlas": | |
| 43 | + $sis = dadosAtlas(); | |
| 44 | + $cp->set_data($sis); | |
| 45 | + $cp->return_data(); | |
| 46 | + break; | |
| 47 | + | |
| 48 | + case "alterarAtlas": | |
| 49 | + alterarAtlas(); | |
| 50 | + $sis = dadosAtlas(); | |
| 51 | + $cp->set_data($sis); | |
| 52 | + $cp->return_data(); | |
| 53 | + break; | |
| 54 | + | |
| 55 | + case "alterarPranchas": | |
| 56 | + alterarPranchas(); | |
| 57 | + $sis = dadosAtlas(); | |
| 58 | + $cp->set_data($sis); | |
| 59 | + $cp->return_data(); | |
| 60 | + break; | |
| 61 | + | |
| 62 | + case "alterarTemas": | |
| 63 | + alterarTemas(); | |
| 64 | + $sis = dadosAtlas(); | |
| 65 | + $cp->set_data($sis); | |
| 66 | + $cp->return_data(); | |
| 67 | + break; | |
| 68 | + | |
| 69 | + case "excluir": | |
| 70 | + $tabela = "i3geoadmin_atlas"; | |
| 71 | + $f = verificaFilhos(); | |
| 72 | + if(!$f) | |
| 73 | + $cp->set_data(excluirAtlas()); | |
| 74 | + else | |
| 75 | + $cp->set_data("erro"); | |
| 76 | + $cp->return_data(); | |
| 77 | + break; | |
| 78 | + | |
| 79 | + case "excluirPranchas": | |
| 80 | + $tabela = "i3geoadmin_atlasp"; | |
| 81 | + $f = verificaFilhos(); | |
| 82 | + if(!$f) | |
| 83 | + $cp->set_data(excluirPranchas()); | |
| 84 | + else | |
| 85 | + $cp->set_data("erro"); | |
| 86 | + $cp->return_data(); | |
| 87 | + break; | |
| 88 | + | |
| 89 | + case "excluirTemas": | |
| 90 | + $cp->set_data(excluirTemas()); | |
| 91 | + $cp->return_data(); | |
| 92 | + break; | |
| 93 | + | |
| 94 | + case "importarXmlAtlas": | |
| 95 | + $cp->set_data(importarXmlAtlas()); | |
| 96 | + $cp->return_data(); | |
| 97 | + break; | |
| 98 | +} | |
| 99 | +function dadosAtlas() | |
| 100 | +{ | |
| 101 | + global $id_atlas; | |
| 102 | + if($id_atlas == "") | |
| 103 | + $sis = pegaDados('SELECT * from i3geoadmin_atlas order by titulo_atlas'); | |
| 104 | + else | |
| 105 | + $sis = pegaDados("SELECT * from i3geoadmin_atlas where id_atlas = '$id_atlas' "); | |
| 106 | + for($i=0;$i<count($sis);++$i) | |
| 107 | + { | |
| 108 | + $pranchas = pegaDados('SELECT * from i3geoadmin_atlasp where id_atlas ='.($sis[$i]["id_atlas"])); | |
| 109 | + for($j=0;$j<count($pranchas);++$j) | |
| 110 | + { | |
| 111 | + $temas = pegaDados('SELECT * from i3geoadmin_atlast where id_prancha ='.($pranchas[$j]["id_prancha"])); | |
| 112 | + if(count($temas) > 0) | |
| 113 | + $pranchas[$j]["temas"] = $temas; | |
| 114 | + else | |
| 115 | + $pranchas[$j]["temas"] = ""; | |
| 116 | + } | |
| 117 | + if(count($pranchas) > 0) | |
| 118 | + $sis[$i]["pranchas"] = $pranchas; | |
| 119 | + else | |
| 120 | + $sis[$i]["pranchas"] = ""; | |
| 121 | + } | |
| 122 | + return $sis; | |
| 123 | +} | |
| 124 | +function alterarAtlas() | |
| 125 | +{ | |
| 126 | + global $id_atlas,$basemapfile_atlas,$desc_atlas,$h_atlas,$w_atlas,$icone_atlas,$link_atlas,$pranchadefault_atlas,$template_atlas,$tipoguias_atlas,$titulo_atlas; | |
| 127 | + | |
| 128 | + try | |
| 129 | + { | |
| 130 | + $desc_atlas = mb_convert_encoding($desc_atlas,"UTF-8","ISO-8859-1"); | |
| 131 | + $titulo_atlas = mb_convert_encoding($titulo_atlas,"UTF-8","ISO-8859-1"); | |
| 132 | + include("conexao.php"); | |
| 133 | + if($id_atlas != "") | |
| 134 | + $dbh->query("UPDATE i3geoadmin_atlas SET basemapfile_atlas='$basemapfile_atlas',desc_atlas='$desc_atlas',h_atlas='$h_atlas',w_atlas='$w_atlas',icone_atlas='$icone_atlas',link_atlas='$link_atlas',pranchadefault_atlas='$pranchadefault_atlas',template_atlas='$template_atlas',tipoguias_atlas='$tipoguias_atlas',titulo_atlas='$titulo_atlas' WHERE id_atlas = $id_atlas"); | |
| 135 | + else | |
| 136 | + $dbh->query("INSERT INTO i3geoadmin_atlas (basemapfile_atlas,desc_atlas,h_atlas,w_atlas,icone_atlas,link_atlas,pranchadefault_atlas,template_atlas,tipoguias_atlas,titulo_atlas) VALUES ('','','$h_atlas','$w_atlas','','','','','$tipoguias_atlas','')"); | |
| 137 | + $dbh = null; | |
| 138 | + return "ok"; | |
| 139 | + } | |
| 140 | + catch (PDOException $e) | |
| 141 | + { | |
| 142 | + return "Error!: " . $e->getMessage(); | |
| 143 | + } | |
| 144 | +} | |
| 145 | +function alterarPranchas() | |
| 146 | +{ | |
| 147 | + global $mapext_prancha,$id_atlas,$id_prancha,$desc_prancha,$h_prancha,$w_prancha,$icone_prancha,$link_prancha,$titulo_prancha; | |
| 148 | + try | |
| 149 | + { | |
| 150 | + $desc_prancha = mb_convert_encoding($desc_prancha,"UTF-8","ISO-8859-1"); | |
| 151 | + $titulo_prancha = mb_convert_encoding($titulo_prancha,"UTF-8","ISO-8859-1"); | |
| 152 | + include("conexao.php"); | |
| 153 | + if($id_prancha != "") | |
| 154 | + $dbh->query("UPDATE i3geoadmin_atlasp SET mapext_prancha='$mapext_prancha',desc_prancha='$desc_prancha',h_prancha='$h_prancha',w_prancha='$w_prancha',icone_prancha='$icone_prancha',link_prancha='$link_prancha',titulo_prancha='$titulo_prancha' WHERE id_prancha = $id_prancha and id_atlas='$id_atlas'"); | |
| 155 | + else | |
| 156 | + $dbh->query("INSERT INTO i3geoadmin_atlasp (mapext_prancha,desc_prancha,h_prancha,w_prancha,icone_prancha,link_prancha,titulo_prancha,id_atlas) VALUES ('','','$h_prancha','$w_prancha','','','','$id_atlas')"); | |
| 157 | + $dbh = null; | |
| 158 | + return "ok"; | |
| 159 | + } | |
| 160 | + catch (PDOException $e) | |
| 161 | + { | |
| 162 | + return "Error!: " . $e->getMessage(); | |
| 163 | + } | |
| 164 | +} | |
| 165 | +function alterarTemas() | |
| 166 | +{ | |
| 167 | + global $id_tema,$id_prancha,$codigo_tema,$ligado_tema; | |
| 168 | + try | |
| 169 | + { | |
| 170 | + include("conexao.php"); | |
| 171 | + if($id_tema != "") | |
| 172 | + $dbh->query("UPDATE i3geoadmin_atlast SET codigo_tema='$codigo_tema',ligado_tema='$ligado_tema' WHERE id_prancha = $id_prancha and id_tema='$id_tema'"); | |
| 173 | + else | |
| 174 | + $dbh->query("INSERT INTO i3geoadmin_atlast (codigo_tema,ligado_tema,id_prancha) VALUES ('','','$id_prancha')"); | |
| 175 | + $dbh = null; | |
| 176 | + return "ok"; | |
| 177 | + } | |
| 178 | + catch (PDOException $e) | |
| 179 | + { | |
| 180 | + return "Error!: " . $e->getMessage(); | |
| 181 | + } | |
| 182 | +} | |
| 183 | + | |
| 184 | +function excluirPranchas() | |
| 185 | +{ | |
| 186 | + global $id; | |
| 187 | + try | |
| 188 | + { | |
| 189 | + include("conexao.php"); | |
| 190 | + $dbh->query("DELETE from i3geoadmin_atlasp WHERE id_prancha = $id"); | |
| 191 | + $dbh = null; | |
| 192 | + return "ok"; | |
| 193 | + } | |
| 194 | + catch (PDOException $e) | |
| 195 | + { | |
| 196 | + return "Error!: " . $e->getMessage(); | |
| 197 | + } | |
| 198 | +} | |
| 199 | +function excluirTemas() | |
| 200 | +{ | |
| 201 | + global $id; | |
| 202 | + try | |
| 203 | + { | |
| 204 | + include("conexao.php"); | |
| 205 | + $dbh->query("DELETE from i3geoadmin_atlast WHERE id_tema = $id"); | |
| 206 | + $dbh = null; | |
| 207 | + return "ok"; | |
| 208 | + } | |
| 209 | + catch (PDOException $e) | |
| 210 | + { | |
| 211 | + return "Error!: " . $e->getMessage(); | |
| 212 | + } | |
| 213 | +} | |
| 214 | +function excluirAtlas() | |
| 215 | +{ | |
| 216 | + global $id; | |
| 217 | + try | |
| 218 | + { | |
| 219 | + include("conexao.php"); | |
| 220 | + $dbh->query("DELETE from i3geoadmin_atlas WHERE id_atlas = $id"); | |
| 221 | + $dbh = null; | |
| 222 | + return "ok"; | |
| 223 | + } | |
| 224 | + catch (PDOException $e) | |
| 225 | + { | |
| 226 | + return "Error!: " . $e->getMessage(); | |
| 227 | + } | |
| 228 | +} | |
| 229 | +function importarXmlAtlas() | |
| 230 | +{ | |
| 231 | + global $xml,$tipo; | |
| 232 | + if(!file_exists($xml)) | |
| 233 | + {return "<br><b>Arquivo $xml não encontrado";} | |
| 234 | + include_once("../../classesphp/funcoes_gerais.php"); | |
| 235 | + include("conexao.php"); | |
| 236 | + $xml = simplexml_load_file($xml); | |
| 237 | + // | |
| 238 | + //importa os atlas | |
| 239 | + // | |
| 240 | + $atlasExistentes = array(); | |
| 241 | + $q = $dbh->query("select * from i3geoadmin_atlas"); | |
| 242 | + $resultado = $q->fetchAll(); | |
| 243 | + foreach($resultado as $r) | |
| 244 | + {$atlasExistentes[$r["titulo_atlas"]] = 0;} | |
| 245 | + foreach($xml->ATLAS as $atlas) | |
| 246 | + { | |
| 247 | + $titulo = ixml($atlas,"TITULO"); | |
| 248 | + $desc = ixml($atlas,"DESCRICAO"); | |
| 249 | + $icone = ixml($atlas,"ICONE"); | |
| 250 | + $link = ixml($atlas,"LINKMAISINFO"); | |
| 251 | + $template = ixml($atlas,"TEMPLATEHTML"); | |
| 252 | + $w = ixml($atlas,"WABERTURA"); | |
| 253 | + $h = ixml($atlas,"HABERTURA"); | |
| 254 | + $pranchadefault = ixml($atlas,"PRANCHADEFAULT"); | |
| 255 | + $tipoguias = ixml($atlas,"TIPOGUIAS"); | |
| 256 | + if(!isset($atlasExistentes[$titulo])) | |
| 257 | + $dbh->query("INSERT INTO i3geoadmin_atlas (desc_atlas,h_atlas,w_atlas,icone_atlas,link_atlas,pranchadefault_atlas,template_atlas,tipoguias_atlas,titulo_atlas) VALUES ('$desc','$h','$w','$icone','$link','$pranchadefault','$template','$tipoguias','$titulo')"); | |
| 258 | + $atlasExistentes[$titulo] = 0; | |
| 259 | + $id_atlas = $dbh->lastInsertId("id_atlas"); | |
| 260 | + foreach ($atlas->PRANCHAS->PRANCHA as $prancha) | |
| 261 | + { | |
| 262 | + $titulo = ixml($prancha,"TITULO"); | |
| 263 | + $desc = ixml($prancha,"DESCRICAO"); | |
| 264 | + $icone = ixml($prancha,"ICONE"); | |
| 265 | + $link = ixml($prancha,"LINKMAISINFO"); | |
| 266 | + $w = ixml($prancha,"WABERUTRA"); | |
| 267 | + $h = ixml($prancha,"HABERTURA"); | |
| 268 | + $mapext = ixml($prancha,"MAPEXT"); | |
| 269 | + $dbh->query("INSERT INTO i3geoadmin_atlasp (id_atlas,desc_prancha,h_prancha,w_prancha,icone_prancha,link_prancha,titulo_prancha,mapext_prancha) VALUES ('$id_atlas','$desc','$h','$w','$icone','$link','$titulo','$mapext')"); | |
| 270 | + $id_prancha = $dbh->lastInsertId("id_prancha"); | |
| 271 | + foreach ($prancha->TEMAS->TEMA as $tema) | |
| 272 | + { | |
| 273 | + $codigo = ixml($tema,"CODIGO"); | |
| 274 | + $ligado = ixml($tema,"LIGADO"); | |
| 275 | + $dbh->query("INSERT INTO i3geoadmin_atlast (id_prancha,codigo_tema,ligado_tema) VALUES ('$id_prancha','$codigo','$ligado')"); | |
| 276 | + } | |
| 277 | + | |
| 278 | + } | |
| 279 | + } | |
| 280 | + $dbh = null; | |
| 281 | + return "Dados importados."; | |
| 282 | +} | |
| 283 | +function verificaFilhos() | |
| 284 | +{ | |
| 285 | + global $tabela,$id; | |
| 286 | + try | |
| 287 | + { | |
| 288 | + $res = false; | |
| 289 | + if($tabela == "i3geoadmin_atlas") | |
| 290 | + { | |
| 291 | + $r = pegaDados("select * from i3geoadmin_atlasp where id_atlas=$id"); | |
| 292 | + if(count($r) > 0) | |
| 293 | + $res = true; | |
| 294 | + } | |
| 295 | + if($tabela == "i3geoadmin_atlasp") | |
| 296 | + { | |
| 297 | + $r = pegaDados("select * from i3geoadmin_atlast where id_prancha=$id"); | |
| 298 | + if(count($r) > 0) | |
| 299 | + $res = true; | |
| 300 | + } | |
| 301 | + return $res; | |
| 302 | + } | |
| 303 | + catch (PDOException $e) | |
| 304 | + { | |
| 305 | + return "Error!: " . $e->getMessage(); | |
| 306 | + } | |
| 307 | +} | |
| 308 | + | |
| 309 | +?> | |
| 0 | 310 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Conexão | |
| 4 | + | |
| 5 | +Define a conexão com o banco de dados com as tabelas de administração dos menus do i3geo. | |
| 6 | + | |
| 7 | +Verifique se sua instalação do PHP suporta o uso da biblioteca PDO com sqlite | |
| 8 | + | |
| 9 | +Você pode alterar a conexão PDO modificando a variável de configuaração $conexaoadmin no i3geo/ms_configura.php | |
| 10 | + | |
| 11 | +Return: | |
| 12 | + | |
| 13 | +$dbh - objeto PDO com a conexão para leitura e escrita | |
| 14 | + | |
| 15 | +About: Licença | |
| 16 | + | |
| 17 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 18 | + | |
| 19 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 20 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 21 | + | |
| 22 | +Este programa é software livre; você pode redistribuí-lo | |
| 23 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 24 | +GNU conforme publicada pela Free Software Foundation; | |
| 25 | +tanto a versão 2 da Licença. | |
| 26 | +Este programa é distribuído na expectativa de que seja útil, | |
| 27 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 28 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 29 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 30 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 31 | +GNU junto com este programa; se não, escreva para a | |
| 32 | +Free Software Foundation, Inc., no endereço | |
| 33 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 34 | + | |
| 35 | +*/ | |
| 36 | +include("../ms_configura.php"); | |
| 37 | +if($conexaoadmin == "") | |
| 38 | +{ | |
| 39 | + //leitura e escrita | |
| 40 | + $dbh = new PDO('sqlite:../menutemas/admin.db'); | |
| 41 | +} | |
| 42 | +else | |
| 43 | +include($conexaoadmin); | |
| 44 | +?> | |
| 0 | 45 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,133 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração do cadastro de funções da ferramenta identifica | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/identifica.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +include_once("admin.php"); | |
| 31 | +$cp = new cpaint(); | |
| 32 | +//faz a busca da função que deve ser executada | |
| 33 | +switch ($funcao) | |
| 34 | +{ | |
| 35 | + //verifica os editores | |
| 36 | + case "verificaEditores": | |
| 37 | + $cp->set_data(verificaEditores($editores)); | |
| 38 | + $cp->return_data(); | |
| 39 | + break; | |
| 40 | + | |
| 41 | + case "pegaFuncoes": | |
| 42 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_identifica')); | |
| 43 | + $cp->return_data(); | |
| 44 | + break; | |
| 45 | + | |
| 46 | + case "alterarFuncoes": | |
| 47 | + alterarFuncoes(); | |
| 48 | + if($id_i == "") | |
| 49 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_identifica')); | |
| 50 | + else | |
| 51 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_identifica where id_i = '.$id_i)); | |
| 52 | + $cp->return_data(); | |
| 53 | + break; | |
| 54 | + | |
| 55 | + case "excluir": | |
| 56 | + $cp->set_data(excluirFuncoes()); | |
| 57 | + $cp->return_data(); | |
| 58 | + break; | |
| 59 | + | |
| 60 | + case "importarXmlI": | |
| 61 | + $cp->set_data(importarXmlI()); | |
| 62 | + $cp->return_data(); | |
| 63 | + break; | |
| 64 | +} | |
| 65 | +/* | |
| 66 | +Function: alterarFuncoes | |
| 67 | + | |
| 68 | +Altera o registro de um WS | |
| 69 | +*/ | |
| 70 | +function alterarFuncoes() | |
| 71 | +{ | |
| 72 | + global $id_i,$abrir_i,$nome_i,$target_i; | |
| 73 | + try | |
| 74 | + { | |
| 75 | + $nome_i = mb_convert_encoding($nome_i,"UTF-8","ISO-8859-1"); | |
| 76 | + require_once("conexao.php"); | |
| 77 | + if($id_i != "") | |
| 78 | + $dbh->query("UPDATE i3geoadmin_identifica SET nome_i = '$nome_i',abrir_i = '$abrir_i', target_i = '$target_i' WHERE id_i = $id_i"); | |
| 79 | + else | |
| 80 | + $dbh->query("INSERT INTO i3geoadmin_identifica (nome_i,abrir_i,target_i) VALUES ('','','')"); | |
| 81 | + $dbh = null; | |
| 82 | + return "ok"; | |
| 83 | + } | |
| 84 | + catch (PDOException $e) | |
| 85 | + { | |
| 86 | + return "Error!: " . $e->getMessage(); | |
| 87 | + } | |
| 88 | +} | |
| 89 | +function excluirFuncoes() | |
| 90 | +{ | |
| 91 | + global $id; | |
| 92 | + try | |
| 93 | + { | |
| 94 | + include("conexao.php"); | |
| 95 | + $dbh->query("DELETE from i3geoadmin_identifica WHERE id_i = $id"); | |
| 96 | + $dbh = null; | |
| 97 | + return "ok"; | |
| 98 | + } | |
| 99 | + catch (PDOException $e) | |
| 100 | + { | |
| 101 | + return "Error!: " . $e->getMessage(); | |
| 102 | + } | |
| 103 | +} | |
| 104 | +function importarXmlI() | |
| 105 | +{ | |
| 106 | + global $xml; | |
| 107 | + if(!file_exists($xml)) | |
| 108 | + {return "<br><b>Arquivo $xml não encontrado";} | |
| 109 | + include_once("../../classesphp/funcoes_gerais.php"); | |
| 110 | + include("conexao.php"); | |
| 111 | + $xml = simplexml_load_file($xml); | |
| 112 | + // | |
| 113 | + //importa os grupos | |
| 114 | + // | |
| 115 | + $wsExistentes = array(); | |
| 116 | + $q = $dbh->query("select * from i3geoadmin_identifica"); | |
| 117 | + $resultado = $q->fetchAll(); | |
| 118 | + foreach($resultado as $r) | |
| 119 | + {$iExistentes[$r["nome_i"]] = 0;} | |
| 120 | + foreach($xml->FUNCAO as $item) | |
| 121 | + { | |
| 122 | + $nome_i = ixml($item,"NOMESIS"); | |
| 123 | + $target_i = ixml($item,"TARGET"); | |
| 124 | + $abrir_i = ixml($item,"ABRIR"); | |
| 125 | + if(!isset($iExistentes[$nome_i])) | |
| 126 | + $dbh->query("INSERT INTO i3geoadmin_identifica (nome_i,target_i,abrir_i) VALUES ('$nome_i','$target_i','$abrir_i')"); | |
| 127 | + $iExistentes[$nome_i] = 0; | |
| 128 | + } | |
| 129 | + $dbh = null; | |
| 130 | + return "Dados importados."; | |
| 131 | +} | |
| 132 | + | |
| 133 | +?> | |
| 0 | 134 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,141 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração do menu de mapas | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/mapas.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +include_once("admin.php"); | |
| 31 | +$cp = new cpaint(); | |
| 32 | +//faz a busca da função que deve ser executada | |
| 33 | +switch ($funcao) | |
| 34 | +{ | |
| 35 | + //verifica os editores | |
| 36 | + case "verificaEditores": | |
| 37 | + $cp->set_data(verificaEditores($editores)); | |
| 38 | + $cp->return_data(); | |
| 39 | + break; | |
| 40 | + | |
| 41 | + case "pegaMapas": | |
| 42 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_mapas order by nome_mapa')); | |
| 43 | + $cp->return_data(); | |
| 44 | + break; | |
| 45 | + | |
| 46 | + case "alterarMapas": | |
| 47 | + alterarMapas(); | |
| 48 | + if($id_mapa == "") | |
| 49 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_mapas')); | |
| 50 | + else | |
| 51 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_mapas WHERE id_mapa = '.$id_mapa)); | |
| 52 | + $cp->return_data(); | |
| 53 | + break; | |
| 54 | + | |
| 55 | + case "excluir": | |
| 56 | + $cp->set_data(excluirMapa()); | |
| 57 | + $cp->return_data(); | |
| 58 | + break; | |
| 59 | + | |
| 60 | + case "importarXmlMapas": | |
| 61 | + $cp->set_data(importarXmlMapas()); | |
| 62 | + $cp->return_data(); | |
| 63 | + break; | |
| 64 | +} | |
| 65 | +/* | |
| 66 | +Function: alterarMapas | |
| 67 | + | |
| 68 | +Altera o registro de um mapa | |
| 69 | +*/ | |
| 70 | +function alterarMapas() | |
| 71 | +{ | |
| 72 | + global $id_mapa,$desc,$ext,$imagem,$outros,$nome,$linkdireto,$temas,$ligados,$perfil; | |
| 73 | + try | |
| 74 | + { | |
| 75 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 76 | + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | |
| 77 | + require_once("conexao.php"); | |
| 78 | + if($id_mapa != "") | |
| 79 | + $dbh->query("UPDATE i3geoadmin_mapas SET desc_mapa = '$desc',ext_mapa = '$ext',imagem_mapa = '$imagem',outros_mapa = '$outros',nome_mapa = '$nome', linkdireto_mapa = '$linkdireto',temas_mapa = '$temas',ligados_mapa = '$ligados',perfil_mapa = '$perfil' WHERE id_mapa = $id_mapa"); | |
| 80 | + else | |
| 81 | + $dbh->query("INSERT INTO i3geoadmin_mapas (perfil_mapa,desc_mapa,ext_mapa,imagem_mapa,linkdireto_mapa,nome_mapa,outros_mapa,temas_mapa,ligados_mapa) VALUES ('','','','','','','','','')"); | |
| 82 | + $dbh = null; | |
| 83 | + return "ok"; | |
| 84 | + } | |
| 85 | + catch (PDOException $e) | |
| 86 | + { | |
| 87 | + return "Error!: " . $e->getMessage(); | |
| 88 | + } | |
| 89 | +} | |
| 90 | +function excluirMapa() | |
| 91 | +{ | |
| 92 | + global $id; | |
| 93 | + try | |
| 94 | + { | |
| 95 | + include("conexao.php"); | |
| 96 | + $dbh->query("DELETE from i3geoadmin_mapas WHERE id_mapa = $id"); | |
| 97 | + $dbh = null; | |
| 98 | + return "ok"; | |
| 99 | + } | |
| 100 | + catch (PDOException $e) | |
| 101 | + { | |
| 102 | + return "Error!: " . $e->getMessage(); | |
| 103 | + } | |
| 104 | +} | |
| 105 | +function importarXmlMapas() | |
| 106 | +{ | |
| 107 | + global $xml; | |
| 108 | + if(!file_exists($xml)) | |
| 109 | + {return "<br><b>Arquivo $xml não encontrado";} | |
| 110 | + include_once("../../classesphp/funcoes_gerais.php"); | |
| 111 | + include("conexao.php"); | |
| 112 | + $xml = simplexml_load_file($xml); | |
| 113 | + // | |
| 114 | + //importa os grupos | |
| 115 | + // | |
| 116 | + $mapasExistentes = array(); | |
| 117 | + $q = $dbh->query("select * from i3geoadmin_mapas"); | |
| 118 | + $resultado = $q->fetchAll(); | |
| 119 | + foreach($resultado as $r) | |
| 120 | + {$mapasExistentes[$r["nome_mapa"]] = 0;} | |
| 121 | + foreach($xml->MAPA as $mapa) | |
| 122 | + { | |
| 123 | + $perfil = ixml($mapa,"PERFIL"); | |
| 124 | + $descricao = ixml($mapa,"DESCRICAO"); | |
| 125 | + //$descricao = mb_convert_encoding($descricao,"UTF-8","ISO-8859-1"); | |
| 126 | + $nome = ixml($mapa,"NOME"); | |
| 127 | + //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 128 | + $imagem = ixml($mapa,"IMAGEM"); | |
| 129 | + $temas = ixml($mapa,"TEMAS"); | |
| 130 | + $ligados = ixml($mapa,"LIGADOS"); | |
| 131 | + $extensao = ixml($mapa,"EXTENSAO"); | |
| 132 | + $outros = ixml($mapa,"OUTROS"); | |
| 133 | + $linkdireto = ixml($mapa,"LINKDIRETO"); | |
| 134 | + if(!isset($mapasExistentes[$nome])) | |
| 135 | + $dbh->query("INSERT INTO i3geoadmin_mapas (perfil_mapa,desc_mapa,ext_mapa,imagem_mapa,linkdireto_mapa,nome_mapa,outros_mapa,temas_mapa,ligados_mapa) VALUES ('$perfil','$descricao','$extensao','$imagem','$linkdireto','$nome','$outros','$temas','$ligados')"); | |
| 136 | + $mapasExistentes[$nome] = 0; | |
| 137 | + } | |
| 138 | + $dbh = null; | |
| 139 | + return "Dados importados."; | |
| 140 | +} | |
| 141 | +?> | |
| 0 | 142 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,135 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração dos mapfiles principais | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/mapfiles.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +require_once("admin.php"); | |
| 31 | +$cp = new cpaint(); | |
| 32 | +//faz a busca da função que deve ser executada | |
| 33 | +switch ($funcao) | |
| 34 | +{ | |
| 35 | + //verifica os editores | |
| 36 | + case "verificaEditores": | |
| 37 | + $cp->set_data(verificaEditores($editores)); | |
| 38 | + $cp->return_data(); | |
| 39 | + break; | |
| 40 | + //pega os parâmetros do ms_configura | |
| 41 | + case "pegaParametrosConfigura": | |
| 42 | + $vs = array( | |
| 43 | + "FONTSET ", | |
| 44 | + "SYMBOLSET ", | |
| 45 | + "SHAPEPATH ", | |
| 46 | + "EXTENT ", | |
| 47 | + "IMAGE ", | |
| 48 | + "IMAGEPATH ", | |
| 49 | + "IMAGEURL " | |
| 50 | + ); | |
| 51 | + $par = array(); | |
| 52 | + foreach ($vs as $v) | |
| 53 | + { | |
| 54 | + $handle = fopen ($temasaplic."/".$mapfile.".map", "r"); | |
| 55 | + while (!feof ($handle)) { | |
| 56 | + $buffer = fgets($handle); | |
| 57 | + if(!(stristr($buffer, $v) === FALSE)) | |
| 58 | + { | |
| 59 | + $temp = explode(trim($v),$buffer); | |
| 60 | + if(trim($temp[0]) != "#") | |
| 61 | + { | |
| 62 | + $temp = trim($temp[1]); | |
| 63 | + $par[trim($v)] = $temp; | |
| 64 | + fclose ($handle); | |
| 65 | + break; | |
| 66 | + } | |
| 67 | + } | |
| 68 | + } | |
| 69 | + } | |
| 70 | + $cp->set_data($par); | |
| 71 | + $cp->return_data(); | |
| 72 | + break; | |
| 73 | + | |
| 74 | + //retorna o mapfile atual como texto | |
| 75 | + case "restauraConfigura": | |
| 76 | + $cp->register('restauraConfigura'); | |
| 77 | + unlink($temasaplic."/".$mapfile.".map"); | |
| 78 | + copy ($temasaplic."/".$mapfile.".default",$temasaplic."/".$mapfile.".map"); | |
| 79 | + $cp->set_data("ok"); | |
| 80 | + $cp->return_data(); | |
| 81 | + break; | |
| 82 | + | |
| 83 | + //salva um novo valor para uma variável do ms_configura | |
| 84 | + case "salvaConfigura": | |
| 85 | + $cp->register('salvaConfigura'); | |
| 86 | + salvaConfigura($variavel,$valor,$mapfile,$temasaplic); | |
| 87 | + $cp->set_data("ok"); | |
| 88 | + $cp->return_data(); | |
| 89 | + break; | |
| 90 | +} | |
| 91 | +/* | |
| 92 | +Function: salvaConfigura | |
| 93 | + | |
| 94 | +Salva um novo valor de uma variável no ms_configura.php | |
| 95 | + | |
| 96 | +Parameters: | |
| 97 | + | |
| 98 | +variavel - nome da variável | |
| 99 | + | |
| 100 | +valor - novo valor | |
| 101 | +*/ | |
| 102 | +function salvaConfigura($variavel,$valor,$mapfile,$temasaplic) | |
| 103 | +{ | |
| 104 | + $handle = fopen ($temasaplic."/".$mapfile.".map", "r"); | |
| 105 | + $linhas = array(); | |
| 106 | + $valor = str_replace("\\\"",'"',$valor); | |
| 107 | + while (!feof ($handle)) { | |
| 108 | + | |
| 109 | + $buffer = fgets($handle); | |
| 110 | + if(!(stristr($buffer, $variavel) === FALSE)) | |
| 111 | + { | |
| 112 | + $temp = explode(trim($variavel),$buffer); | |
| 113 | + if(trim($temp[0]) != "#") | |
| 114 | + { | |
| 115 | + $temp = trim($temp[1]); | |
| 116 | + $par[trim($variavel)] = $temp; | |
| 117 | + $linhas[] = $variavel." ".$valor."\n"; | |
| 118 | + $variavel = "______________"; | |
| 119 | + } | |
| 120 | + else{$linhas[] = $buffer;} | |
| 121 | + } | |
| 122 | + else | |
| 123 | + $linhas[] = $buffer; | |
| 124 | + } | |
| 125 | + fclose ($handle); | |
| 126 | + unlink($temasaplic."/".$mapfile.".map"); | |
| 127 | + $handle = fopen ($temasaplic."/".$mapfile.".map", "w"); | |
| 128 | + foreach ($linhas as $linha) | |
| 129 | + { | |
| 130 | + fwrite($handle, $linha); | |
| 131 | + } | |
| 132 | + fclose($handle); | |
| 133 | +} | |
| 134 | + | |
| 135 | +?> | |
| 0 | 136 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,572 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração dos mapfiles principais | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/mapfiles.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +include_once("admin.php"); | |
| 31 | +$cp = new cpaint(); | |
| 32 | +//faz a busca da função que deve ser executada | |
| 33 | +switch ($funcao) | |
| 34 | +{ | |
| 35 | + //verifica os editores | |
| 36 | + case "verificaEditores": | |
| 37 | + $cp->set_data(verificaEditores($editores)); | |
| 38 | + $cp->return_data(); | |
| 39 | + break; | |
| 40 | + | |
| 41 | + case "importarXmlMenu": | |
| 42 | + $cp->set_data(importarXmlMenu()); | |
| 43 | + $cp->return_data(); | |
| 44 | + break; | |
| 45 | + | |
| 46 | + case "pegaMenus": | |
| 47 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_menus order by nome_menu')); | |
| 48 | + $cp->return_data(); | |
| 49 | + break; | |
| 50 | + | |
| 51 | + case "pegaTags": | |
| 52 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_tags order by nome')); | |
| 53 | + $cp->return_data(); | |
| 54 | + break; | |
| 55 | + | |
| 56 | + case "alteraMenus": | |
| 57 | + $cp->set_data(alteraMenus()); | |
| 58 | + $cp->return_data(); | |
| 59 | + break; | |
| 60 | + | |
| 61 | + case "pegaGrupos": | |
| 62 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_grupos order by nome_grupo')); | |
| 63 | + $cp->return_data(); | |
| 64 | + break; | |
| 65 | + | |
| 66 | + case "alteraGrupos": | |
| 67 | + $cp->set_data(alteraGrupos()); | |
| 68 | + $cp->return_data(); | |
| 69 | + break; | |
| 70 | + | |
| 71 | + case "pegaSubGrupos": | |
| 72 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_subgrupos order by nome_subgrupo')); | |
| 73 | + $cp->return_data(); | |
| 74 | + break; | |
| 75 | + | |
| 76 | + case "alteraSubGrupos": | |
| 77 | + $cp->set_data(alteraSubGrupos()); | |
| 78 | + $cp->return_data(); | |
| 79 | + break; | |
| 80 | + | |
| 81 | + case "pegaTemas": | |
| 82 | + $cp->set_data(pegaTemas()); | |
| 83 | + $cp->return_data(); | |
| 84 | + break; | |
| 85 | + | |
| 86 | + case "alteraTemas": | |
| 87 | + $cp->set_data(alteraTemas()); | |
| 88 | + $cp->return_data(); | |
| 89 | + break; | |
| 90 | + | |
| 91 | + case "alteraTags": | |
| 92 | + $cp->set_data(alteraTags()); | |
| 93 | + $cp->return_data(); | |
| 94 | + break; | |
| 95 | + | |
| 96 | + case "pegaSubXGrupos": | |
| 97 | + $cp->set_data(pegaSubXGrupos()); | |
| 98 | + $cp->return_data(); | |
| 99 | + break; | |
| 100 | + | |
| 101 | + case "excluirRegistro": | |
| 102 | + if($tabela == "grupos") | |
| 103 | + {$tabela = "i3geoadmin_grupos";$coluna = "id_grupo";} | |
| 104 | + if($tabela == "tags") | |
| 105 | + {excluiTagTemas($id);$tabela = "i3geoadmin_tags";$coluna = "id_tag";} | |
| 106 | + if($tabela == "subgrupos") | |
| 107 | + {$tabela = "i3geoadmin_subgrupos";$coluna = "id_subgrupo";} | |
| 108 | + if($tabela == "temas") | |
| 109 | + {$tabela = "i3geoadmin_temas";$coluna = "id_tema";} | |
| 110 | + if($tabela == "menus") | |
| 111 | + {$tabela = "i3geoadmin_menus";$coluna = "id_menu";} | |
| 112 | + $cp->set_data(exclui()); | |
| 113 | + $cp->return_data(); | |
| 114 | + break; | |
| 115 | + | |
| 116 | + case "listaMapsTemas": | |
| 117 | + $cp->set_data(listaMapsTemas()); | |
| 118 | + $cp->return_data(); | |
| 119 | + break; | |
| 120 | +} | |
| 121 | +function excluiTagTemas($id) | |
| 122 | +{ | |
| 123 | + require_once("conexao.php"); | |
| 124 | + foreach($dbh->query("select * from i3geoadmin_tags where id_tag = $id") as $row) | |
| 125 | + {$nometag = $row["nome"];} | |
| 126 | + foreach($dbh->query("select * from i3geoadmin_temas") as $row) | |
| 127 | + { | |
| 128 | + $ts = $row['tags_tema']; | |
| 129 | + $i = $row['id_tema']; | |
| 130 | + $ts = str_replace($nometag,"",$ts); | |
| 131 | + $dbh->query("UPDATE i3geoadmin_temas SET tags_tema = '$ts' WHERE id_tema = $i"); | |
| 132 | + } | |
| 133 | +} | |
| 134 | +/* | |
| 135 | +Function: pegaTemas | |
| 136 | + | |
| 137 | +Pega a lista de temas | |
| 138 | + | |
| 139 | +Parameters: | |
| 140 | + | |
| 141 | +filtro - texto para filtrar os dados | |
| 142 | +*/ | |
| 143 | +function pegaTemas() | |
| 144 | +{ | |
| 145 | + global $filtro; | |
| 146 | + try | |
| 147 | + { | |
| 148 | + $resultado = array(); | |
| 149 | + require_once("conexao.php"); | |
| 150 | + foreach($dbh->query('SELECT * from i3geoadmin_temas order by nome_tema') as $row) | |
| 151 | + { | |
| 152 | + $continua = true; | |
| 153 | + if(isset($filtro) && $filtro != "") | |
| 154 | + { | |
| 155 | + $continua = false; | |
| 156 | + if ($row['codigo_tema'] == $filtro) | |
| 157 | + {$continua = true;} | |
| 158 | + $testanome = mb_convert_encoding($filtro,"UTF-8","ISO-8859-1"); | |
| 159 | + if (!stristr($row['nome_tema'],$testanome) === FALSE) | |
| 160 | + {$continua = true;} | |
| 161 | + if (!stristr($row['tags_tema'],$testanome) === FALSE) | |
| 162 | + {$continua = true;} | |
| 163 | + } | |
| 164 | + if($row['codigo_tema'] == ""){$continua = true;} | |
| 165 | + if ($continua) | |
| 166 | + $resultado[] = array( | |
| 167 | + "nome_tema"=>$row['nome_tema'], | |
| 168 | + "codigo_tema"=>$row['codigo_tema'], | |
| 169 | + "id_tema"=>$row['id_tema'], | |
| 170 | + "desc_tema"=>$row['desc_tema'], | |
| 171 | + "link_tema"=>$row['link_tema'], | |
| 172 | + "tipoa_tema"=>$row['tipoa_tema'], | |
| 173 | + "download_tema"=>$row['download_tema'], | |
| 174 | + "ogc_tema"=>$row['ogc_tema'], | |
| 175 | + "kml_tema"=>$row['kml_tema'], | |
| 176 | + "tags_tema"=>$row['tags_tema'] | |
| 177 | + ); | |
| 178 | + } | |
| 179 | + $dbh = null; | |
| 180 | + return $resultado; | |
| 181 | + } | |
| 182 | + catch (PDOException $e) | |
| 183 | + { | |
| 184 | + return "Error!: " . $e->getMessage(); | |
| 185 | + } | |
| 186 | +} | |
| 187 | + | |
| 188 | +/* | |
| 189 | +Function: pegaSubXGrupos | |
| 190 | + | |
| 191 | +Pega a lista de sub-grupos por grupos | |
| 192 | +*/ | |
| 193 | +function pegaSubXGrupos() | |
| 194 | +{ | |
| 195 | +/* | |
| 196 | +select i3geoadmin_subxgrupos.id_subxgrupo,i3geoadmin_grupos.nome_grupo,i3geoadmin_subgrupos.nome_subgrupo | |
| 197 | +from | |
| 198 | +i3geoadmin_grupos,i3geoadmin_subgrupos,i3geoadmin_subxgrupos | |
| 199 | +where | |
| 200 | +i3geoadmin_grupos.id_grupo = i3geoadmin_subxgrupos.id_grupo | |
| 201 | +and | |
| 202 | +i3geoadmin_subgrupos.id_subgrupo = i3geoadmin_subxgrupos.id_subgrupo | |
| 203 | +order by nome_grupo,nome_subgrupo | |
| 204 | +*/ | |
| 205 | + | |
| 206 | +} | |
| 207 | +/* | |
| 208 | +Function: alteraMenus | |
| 209 | + | |
| 210 | +Altera o registro de um menu. Se id for vazio acrescenta o registro | |
| 211 | +*/ | |
| 212 | +function alteraMenus() | |
| 213 | +{ | |
| 214 | + global $nome,$desc,$id,$aberto; | |
| 215 | + try | |
| 216 | + { | |
| 217 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 218 | + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | |
| 219 | + include("conexao.php"); | |
| 220 | + if($id != "") | |
| 221 | + { | |
| 222 | + $dbh->query("UPDATE i3geoadmin_menus SET aberto = '$aberto', nome_menu = '$nome', desc_menu = '$desc' WHERE id_menu = $id"); | |
| 223 | + } | |
| 224 | + else | |
| 225 | + $dbh->query("INSERT INTO i3geoadmin_menus (nome_menu, desc_menu, aberto) VALUES ('', '','sim')"); | |
| 226 | + $dbh = null; | |
| 227 | + return "ok"; | |
| 228 | + } | |
| 229 | + catch (PDOException $e) | |
| 230 | + { | |
| 231 | + return "Error!: " . $e->getMessage(); | |
| 232 | + } | |
| 233 | +} | |
| 234 | +function alteraTags() | |
| 235 | +{ | |
| 236 | + global $nome,$id; | |
| 237 | + try | |
| 238 | + { | |
| 239 | + $dbh = ""; | |
| 240 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 241 | + include("conexao.php"); | |
| 242 | + if($id != "") | |
| 243 | + { | |
| 244 | + if(!verificaDuplicados("select * from i3geoadmin_tags where nome = '$nome'",$dbh)) | |
| 245 | + { | |
| 246 | + $original = ""; | |
| 247 | + foreach($dbh->query("select * from i3geoadmin_tags where id_tag = $id") as $row) | |
| 248 | + {$original = $row["nome"];} | |
| 249 | + $dbh->query("UPDATE i3geoadmin_tags SET nome = '$nome' WHERE id_tag = $id"); | |
| 250 | + //exclui os registros do tag alterado nos temas | |
| 251 | + foreach($dbh->query("select * from i3geoadmin_temas") as $row) | |
| 252 | + { | |
| 253 | + $ts = $row['tags_tema']; | |
| 254 | + $i = $row['id_tema']; | |
| 255 | + $ts = str_replace($original,$nome,$ts); | |
| 256 | + $dbh->query("UPDATE i3geoadmin_temas SET tags_tema = '$ts' WHERE id_tema = $i"); | |
| 257 | + } | |
| 258 | + } | |
| 259 | + } | |
| 260 | + else | |
| 261 | + $dbh->query("INSERT INTO i3geoadmin_tags (nome) VALUES ('$nome')"); | |
| 262 | + $dbh = null; | |
| 263 | + return "ok"; | |
| 264 | + } | |
| 265 | + catch (PDOException $e) | |
| 266 | + { | |
| 267 | + return "Error!: " . $e->getMessage(); | |
| 268 | + } | |
| 269 | +} | |
| 270 | +/* | |
| 271 | +Function: alteraGrupos | |
| 272 | + | |
| 273 | +Altera o registro de um grupo. Se id for vazio acrescenta o registro | |
| 274 | +*/ | |
| 275 | +function alteraGrupos() | |
| 276 | +{ | |
| 277 | + global $nome,$desc,$id; | |
| 278 | + try | |
| 279 | + { | |
| 280 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 281 | + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | |
| 282 | + include("conexao.php"); | |
| 283 | + if($id != "") | |
| 284 | + { | |
| 285 | + $dbh->query("UPDATE i3geoadmin_grupos SET nome_grupo = '$nome', desc_grupo = '$desc' WHERE id_grupo = $id"); | |
| 286 | + } | |
| 287 | + else | |
| 288 | + $dbh->query("INSERT INTO i3geoadmin_grupos (nome_grupo, desc_grupo) VALUES ('', '')"); | |
| 289 | + $dbh = null; | |
| 290 | + return "ok"; | |
| 291 | + } | |
| 292 | + catch (PDOException $e) | |
| 293 | + { | |
| 294 | + return "Error!: " . $e->getMessage(); | |
| 295 | + } | |
| 296 | +} | |
| 297 | +/* | |
| 298 | +Function: alteraSubGrupos | |
| 299 | + | |
| 300 | +Altera o registro de um sub-grupo. Se id for vazio acrescenta o registro | |
| 301 | +*/ | |
| 302 | +function alteraSubGrupos() | |
| 303 | +{ | |
| 304 | + global $nome,$desc,$id; | |
| 305 | + try | |
| 306 | + { | |
| 307 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 308 | + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | |
| 309 | + require_once("conexao.php"); | |
| 310 | + if($id != "") | |
| 311 | + { | |
| 312 | + $dbh->query("UPDATE i3geoadmin_subgrupos SET nome_subgrupo = '$nome', desc_subgrupo = '$desc' WHERE id_subgrupo = $id"); | |
| 313 | + } | |
| 314 | + else | |
| 315 | + $dbh->query("INSERT INTO i3geoadmin_subgrupos (nome_subgrupo, desc_subgrupo) VALUES ('', '')"); | |
| 316 | + $dbh = null; | |
| 317 | + return "ok"; | |
| 318 | + } | |
| 319 | + catch (PDOException $e) | |
| 320 | + { | |
| 321 | + return "Error!: " . $e->getMessage(); | |
| 322 | + } | |
| 323 | +} | |
| 324 | +/* | |
| 325 | +Function: alteraTemas | |
| 326 | + | |
| 327 | +Altera o registro de um tema. Se id for vazio acrescenta o registro | |
| 328 | +*/ | |
| 329 | +function alteraTemas() | |
| 330 | +{ | |
| 331 | + global $nome,$desc,$id,$codigo,$tipoa,$download,$ogc,$kml,$link,$tags; | |
| 332 | + try | |
| 333 | + { | |
| 334 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 335 | + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | |
| 336 | + $tags = mb_convert_encoding($tags,"UTF-8","ISO-8859-1"); | |
| 337 | + require_once("conexao.php"); | |
| 338 | + if($id != "") | |
| 339 | + { | |
| 340 | + $dbh->query("UPDATE i3geoadmin_temas SET tags_tema='$tags', link_tema='$link', nome_tema ='$nome',desc_tema='$desc',codigo_tema='$codigo',tipoa_tema='$tipoa',download_tema='$download',ogc_tema='$ogc',kml_tema='$kml' WHERE id_tema = $id"); | |
| 341 | + } | |
| 342 | + else | |
| 343 | + $dbh->query("INSERT INTO i3geoadmin_temas (link_tema,kml_tema,ogc_tema,download_tema,nome_tema,desc_tema,codigo_tema,tipoa_tema,tags_tema) VALUES ('','', '','','','','','','')"); | |
| 344 | + //verifica se é necessário adicionar algum tag novo | |
| 345 | + $tags = explode(" ",$tags); | |
| 346 | + foreach($tags as $tag) | |
| 347 | + { | |
| 348 | + if(!(verificaDuplicados("select * from i3geoadmin_tags where nome = '$tag'",$dbh))) | |
| 349 | + { | |
| 350 | + $dbh->query("INSERT INTO i3geoadmin_tags (nome) VALUES ('$tag')"); | |
| 351 | + } | |
| 352 | + } | |
| 353 | + $dbh = null; | |
| 354 | + return "ok"; | |
| 355 | + } | |
| 356 | + catch (PDOException $e) | |
| 357 | + { | |
| 358 | + return "Error!: " . $e->getMessage(); | |
| 359 | + } | |
| 360 | +} | |
| 361 | +/* | |
| 362 | +Function: listaMapsTemas | |
| 363 | + | |
| 364 | +Retorna a lista de mapfiles do diretorio i3geo/temas | |
| 365 | + | |
| 366 | +Parameters: | |
| 367 | + | |
| 368 | +cp - objeto CPAINT | |
| 369 | + | |
| 370 | +locaplic - localização da instalação do I3Geo | |
| 371 | +*/ | |
| 372 | +function listaMapsTemas() | |
| 373 | +{ | |
| 374 | + global $cp,$locaplic; | |
| 375 | + $arquivos = array(); | |
| 376 | + if (is_dir($locaplic."/temas")) | |
| 377 | + { | |
| 378 | + if ($dh = opendir($locaplic."/temas")) | |
| 379 | + { | |
| 380 | + while (($file = readdir($dh)) !== false) | |
| 381 | + { | |
| 382 | + if(!stristr($file, '.map') === FALSE || !stristr($file, ".php")===FALSE) | |
| 383 | + { | |
| 384 | + $file = str_replace(".map","",$file); | |
| 385 | + $file = str_replace(".php","",$file); | |
| 386 | + $arquivos[] = $file; | |
| 387 | + } | |
| 388 | + } | |
| 389 | + } | |
| 390 | + closedir($dh); | |
| 391 | + } | |
| 392 | + sort($arquivos); | |
| 393 | + return $arquivos; | |
| 394 | +} | |
| 395 | +/* | |
| 396 | +/* | |
| 397 | +Function importarXmlMenu | |
| 398 | + | |
| 399 | +Importa um arquivo xml do tipo "menutemas" para o banco de dados | |
| 400 | +*/ | |
| 401 | +function importarXmlMenu() | |
| 402 | +{ | |
| 403 | + global $nomemenu,$xml; | |
| 404 | + $listaDeTags = array(); | |
| 405 | + if(!file_exists($xml)) | |
| 406 | + {return "<br><b>Arquivo $xml não encontrado";} | |
| 407 | + include_once("../../classesphp/funcoes_gerais.php"); | |
| 408 | + include("conexao.php"); | |
| 409 | + $dbh->query("INSERT INTO i3geoadmin_menus (desc_menu,nome_menu) VALUES ('','$nomemenu')"); | |
| 410 | + $id_menu = $dbh->lastInsertId("id_menu"); | |
| 411 | + | |
| 412 | + $xml = simplexml_load_file($xml); | |
| 413 | + // | |
| 414 | + //importa os grupos | |
| 415 | + // | |
| 416 | + $gruposExistentes = array(); | |
| 417 | + $q = $dbh->query("select * from i3geoadmin_grupos"); | |
| 418 | + $resultado = $q->fetchAll(); | |
| 419 | + foreach($resultado as $r) | |
| 420 | + {$gruposExistentes[$r["nome_grupo"]] = 0;} | |
| 421 | + foreach($xml->GRUPO as $grupo) | |
| 422 | + { | |
| 423 | + $nome = ixml($grupo,"GTIPO"); | |
| 424 | + $descricao = ixml($grupo,"DTIPO"); | |
| 425 | + if(!isset($gruposExistentes[$nome])) | |
| 426 | + $dbh->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')"); | |
| 427 | + $gruposExistentes[$nome] = 0; | |
| 428 | + } | |
| 429 | + // | |
| 430 | + //importa os sub-grupos | |
| 431 | + // | |
| 432 | + $subgruposExistentes = array(); | |
| 433 | + $q = $dbh->query("select * from i3geoadmin_subgrupos"); | |
| 434 | + $resultado = $q->fetchAll(); | |
| 435 | + foreach($resultado as $r) | |
| 436 | + {$subgruposExistentes[$r["nome_subgrupo"]] = 0;} | |
| 437 | + foreach($xml->GRUPO as $grupo) | |
| 438 | + { | |
| 439 | + foreach($grupo->SGRUPO as $sgrupo) | |
| 440 | + { | |
| 441 | + $nome = ixml($sgrupo,"SDTIPO"); | |
| 442 | + $descricao = ""; | |
| 443 | + if(!isset($subgruposExistentes[$nome])) | |
| 444 | + $dbh->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')"); | |
| 445 | + $subgruposExistentes[$nome] = 0; | |
| 446 | + } | |
| 447 | + } | |
| 448 | + // | |
| 449 | + //importa os temas | |
| 450 | + // | |
| 451 | + $temasExistentes = array(); | |
| 452 | + $q = $dbh->query("select * from i3geoadmin_subgrupos"); | |
| 453 | + $resultado = $q->fetchAll(); | |
| 454 | + foreach($resultado as $r) | |
| 455 | + {$temasExistentes[$r["codigo_tema"]] = 0;} | |
| 456 | + foreach($xml->TEMA as $tema) | |
| 457 | + { | |
| 458 | + $nome = ixml($tema,"TNOME"); | |
| 459 | + $descricao = ixml($tema,"TDESC"); | |
| 460 | + $codigo = ixml($tema,"TID"); | |
| 461 | + $link = ixml($tema,"TLINK"); | |
| 462 | + $tipo = ixml($tema,"TIPOA"); | |
| 463 | + $tags = ixml($tema,"TAGS"); | |
| 464 | + $down = ixml($tema,"DOWNLOAD"); | |
| 465 | + $kml = ixml($tema,"KML"); | |
| 466 | + $ogc = ixml($tema,"OGC"); | |
| 467 | + $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); | |
| 468 | + if(!isset($temasExistentes[$codigo])) | |
| 469 | + $dbh->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | |
| 470 | + $temasExistentes[$codigo] = 0; | |
| 471 | + } | |
| 472 | + foreach($xml->GRUPO as $grupo) | |
| 473 | + { | |
| 474 | + foreach($grupo->TEMA as $tema) | |
| 475 | + { | |
| 476 | + $nome = ixml($tema,"TNOME"); | |
| 477 | + $descricao = ixml($tema,"TDESC"); | |
| 478 | + $codigo = ixml($tema,"TID"); | |
| 479 | + $link = ixml($tema,"TLINK"); | |
| 480 | + $tipo = ixml($tema,"TIPOA"); | |
| 481 | + $tags = ixml($tema,"TAGS"); | |
| 482 | + $down = ixml($tema,"DOWNLOAD"); | |
| 483 | + $kml = ixml($tema,"KML"); | |
| 484 | + $ogc = ixml($tema,"OGC"); | |
| 485 | + $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); | |
| 486 | + if(!isset($temasExistentes[$codigo])) | |
| 487 | + $dbh->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | |
| 488 | + $temasExistentes[$codigo] = 0; | |
| 489 | + } | |
| 490 | + foreach($grupo->SGRUPO as $sgrupo) | |
| 491 | + { | |
| 492 | + foreach($sgrupo->TEMA as $tema) | |
| 493 | + { | |
| 494 | + $nome = ixml($tema,"TNOME"); | |
| 495 | + $descricao = ixml($tema,"TDESC"); | |
| 496 | + $codigo = ixml($tema,"TID"); | |
| 497 | + $link = ixml($tema,"TLINK"); | |
| 498 | + $tipo = ixml($tema,"TIPOA"); | |
| 499 | + $tags = ixml($tema,"TAGS"); | |
| 500 | + $down = ixml($tema,"DOWNLOAD"); | |
| 501 | + $kml = ixml($tema,"KML"); | |
| 502 | + $ogc = ixml($tema,"OGC"); | |
| 503 | + $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); | |
| 504 | + if(!isset($temasExistentes[$codigo])) | |
| 505 | + $dbh->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); | |
| 506 | + $temasExistentes[$codigo] = 0; | |
| 507 | + } | |
| 508 | + } | |
| 509 | + } | |
| 510 | + // | |
| 511 | + //monta árvore | |
| 512 | + // | |
| 513 | + // | |
| 514 | + //registra os temas no nível da raiz | |
| 515 | + // | |
| 516 | + foreach($xml->TEMA as $tema) | |
| 517 | + { | |
| 518 | + $codigo = ixml($tema,"TID"); | |
| 519 | + $perfil = ixml($tema,"PERFIL"); | |
| 520 | + $r = $dbh->query("select id_tema from i3geoadmin_temas where codigo_tema = '$codigo'"); | |
| 521 | + $id_tema = $r->fetchColumn(); | |
| 522 | + $dbh->query("INSERT INTO i3geoadmin_raiz (id_tema,id_menu,id_nivel,nivel,perfil) VALUES ('$id_tema','$id_menu','0','0','$perfil')"); | |
| 523 | + } | |
| 524 | + // | |
| 525 | + //registra o restante | |
| 526 | + // | |
| 527 | + foreach($xml->GRUPO as $grupo) | |
| 528 | + { | |
| 529 | + $gtipo = ixml($grupo,"GTIPO"); | |
| 530 | + $n1_perfil = ixml($grupo,"PERFIL"); | |
| 531 | + $r = $dbh->query("select id_grupo from i3geoadmin_grupos where nome_grupo = '$gtipo'"); | |
| 532 | + $id_grupo = $r->fetchColumn(); | |
| 533 | + $dbh->query("INSERT INTO i3geoadmin_n1 (id_menu,id_grupo,n1_perfil) VALUES ('$id_menu','$id_grupo','$n1_perfil')"); | |
| 534 | + $id_n1 = $dbh->lastInsertId("id_n1"); | |
| 535 | + foreach($grupo->TEMA as $tema) | |
| 536 | + { | |
| 537 | + $codigo = ixml($tema,"TID"); | |
| 538 | + $perfil = ixml($tema,"PERFIL"); | |
| 539 | + $r = $dbh->query("select id_tema from i3geoadmin_temas where codigo_tema = '$codigo'"); | |
| 540 | + $id_tema = $r->fetchColumn(); | |
| 541 | + $dbh->query("INSERT INTO i3geoadmin_raiz (id_tema,id_menu,id_nivel,nivel,perfil) VALUES ('$id_tema','$id_menu','$id_n1','1','$perfil')"); | |
| 542 | + } | |
| 543 | + foreach($grupo->SGRUPO as $subgrupo) | |
| 544 | + { | |
| 545 | + $sdtipo = ixml($subgrupo,"SDTIPO"); | |
| 546 | + $n2_perfil = ixml($subgrupo,"PERFIL"); | |
| 547 | + $r = $dbh->query("select id_subgrupo from i3geoadmin_subgrupos where nome_subgrupo = '$sdtipo'"); | |
| 548 | + $id_subgrupo = $r->fetchColumn(); | |
| 549 | + | |
| 550 | + $dbh->query("INSERT INTO i3geoadmin_n2 (id_n1,id_subgrupo,n2_perfil) VALUES ('$id_n1','$id_subgrupo','$n2_perfil')"); | |
| 551 | + $id_n2 = $dbh->lastInsertId("id_n2"); | |
| 552 | + foreach($subgrupo->TEMA as $tema) | |
| 553 | + { | |
| 554 | + $codigo = ixml($tema,"TID"); | |
| 555 | + $perfil = ixml($tema,"PERFIL"); | |
| 556 | + $r = $dbh->query("select id_tema from i3geoadmin_temas where codigo_tema = '$codigo'"); | |
| 557 | + $id_tema = $r->fetchColumn(); | |
| 558 | + $dbh->query("INSERT INTO i3geoadmin_n3 (id_n2,id_tema,n3_perfil) VALUES ('$id_n2','$id_tema','$perfil')"); | |
| 559 | + } | |
| 560 | + } | |
| 561 | + } | |
| 562 | + //registra os tags | |
| 563 | + $listaDeTags = array_unique($listaDeTags); | |
| 564 | + foreach ($listaDeTags as $t) | |
| 565 | + { | |
| 566 | + if(!(verificaDuplicados("select * from i3geoadmin_tags where nome = '$t'",$dbh))) | |
| 567 | + $dbh->query("INSERT INTO i3geoadmin_tags (nome) VALUES ('$t')"); | |
| 568 | + } | |
| 569 | + $dbh = null; | |
| 570 | + return "Dados importados."; | |
| 571 | +} | |
| 572 | +?> | |
| 0 | 573 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,128 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração do ms_configura.php | |
| 4 | + | |
| 5 | +Utilizado no sistema de administração do arquivo ms_configura.php | |
| 6 | + | |
| 7 | +About: Licença | |
| 8 | + | |
| 9 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 10 | + | |
| 11 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 12 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 13 | + | |
| 14 | +Este programa é software livre; você pode redistribuí-lo | |
| 15 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 16 | +GNU conforme publicada pela Free Software Foundation; | |
| 17 | +tanto a versão 2 da Licença. | |
| 18 | +Este programa é distribuído na expectativa de que seja útil, | |
| 19 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 20 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 21 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 22 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 23 | +GNU junto com este programa; se não, escreva para a | |
| 24 | +Free Software Foundation, Inc., no endereço | |
| 25 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 26 | + | |
| 27 | +File: i3geo/admin/ms_configura.php | |
| 28 | + | |
| 29 | +19/6/2007 | |
| 30 | + | |
| 31 | +*/ | |
| 32 | +include_once("admin.php"); | |
| 33 | +$cp = new cpaint(); | |
| 34 | +//faz a busca da função que deve ser executada | |
| 35 | +switch ($funcao) | |
| 36 | +{ | |
| 37 | + //verifica os editores | |
| 38 | + case "verificaEditores": | |
| 39 | + $cp->set_data(verificaEditores($editores)); | |
| 40 | + $cp->return_data(); | |
| 41 | + break; | |
| 42 | + //pega os parâmetros do ms_configura | |
| 43 | + case "pegaParametrosConfigura": | |
| 44 | + $vs = array( | |
| 45 | + "\$dir_tmp", | |
| 46 | + "\$mensagemInicia", | |
| 47 | + "\$tituloInstituicao", | |
| 48 | + "\$locaplic", | |
| 49 | + "\$temasdir", | |
| 50 | + "\$temasaplic", | |
| 51 | + "\$locmapserv", | |
| 52 | + "\$locsistemas", | |
| 53 | + "\$locidentifica", | |
| 54 | + "\$locmapas", | |
| 55 | + "\$R_path", | |
| 56 | + "\$postgis_con", | |
| 57 | + "\$srid_area", | |
| 58 | + "\$postgis_mapa", | |
| 59 | + "\$utilizacgi", | |
| 60 | + "\$atlasxml", | |
| 61 | + "\$expoeMapfile", | |
| 62 | + "\$menutemas", | |
| 63 | + "\$conexaoadmin" | |
| 64 | + ); | |
| 65 | + $par = array(); | |
| 66 | + foreach ($vs as $v) | |
| 67 | + { | |
| 68 | + eval("\$s = $v;"); | |
| 69 | + if(is_array($s)) | |
| 70 | + { | |
| 71 | + $par[$v] = $s; | |
| 72 | + } | |
| 73 | + else | |
| 74 | + $par[$v] = mb_convert_encoding($s,"UTF-8","ISO-8859-1"); | |
| 75 | + } | |
| 76 | + $cp->set_data($par); | |
| 77 | + $cp->return_data(); | |
| 78 | + break; | |
| 79 | + //retorna o mapfile atual como texto | |
| 80 | + case "restauraConfigura": | |
| 81 | + $cp->register('restauraConfigura'); | |
| 82 | + unlink("../../ms_configura.php"); | |
| 83 | + copy ("../../ms_configura.default","../../ms_configura.php"); | |
| 84 | + $cp->set_data("ok"); | |
| 85 | + $cp->return_data(); | |
| 86 | + break; | |
| 87 | + //salva um novo valor para uma variável do ms_configura | |
| 88 | + case "salvaConfigura": | |
| 89 | + $cp->register('salvaConfigura'); | |
| 90 | + salvaConfigura($variavel,mb_convert_encoding($valor,"ISO-8859-1","UTF-8")); | |
| 91 | + $cp->set_data("ok"); | |
| 92 | + $cp->return_data(); | |
| 93 | + break; | |
| 94 | +} | |
| 95 | +/* | |
| 96 | +Function: salvaConfigura | |
| 97 | + | |
| 98 | +Salva um novo valor de uma variável no ms_configura.php | |
| 99 | + | |
| 100 | +Parameters: | |
| 101 | + | |
| 102 | +variavel - nome da variável | |
| 103 | + | |
| 104 | +valor - novo valor | |
| 105 | +*/ | |
| 106 | +function salvaConfigura($variavel,$valor) | |
| 107 | +{ | |
| 108 | + $handle = fopen ("../../ms_configura.php", "r"); | |
| 109 | + $linhas = array(); | |
| 110 | + while (!feof ($handle)) { | |
| 111 | + $buffer = fgets($handle); | |
| 112 | + $temp = explode("=",$buffer); | |
| 113 | + $temp = trim($temp[0]); | |
| 114 | + if ($temp == $variavel) | |
| 115 | + $linhas[] = $variavel." = '".$valor."';\n"; | |
| 116 | + else | |
| 117 | + $linhas[] = $buffer; | |
| 118 | + } | |
| 119 | + fclose ($handle); | |
| 120 | + unlink("../../ms_configura.php"); | |
| 121 | + $handle = fopen ("../../ms_configura.php", "w"); | |
| 122 | + foreach ($linhas as $linha) | |
| 123 | + { | |
| 124 | + fwrite($handle, $linha); | |
| 125 | + } | |
| 126 | + fclose($handle); | |
| 127 | +} | |
| 128 | +?> | |
| 0 | 129 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,229 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração do cadastro de sistemas | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/sistemas.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +include_once("admin.php"); | |
| 31 | +$cp = new cpaint(); | |
| 32 | +//faz a busca da função que deve ser executada | |
| 33 | +switch ($funcao) | |
| 34 | +{ | |
| 35 | + //verifica os editores | |
| 36 | + case "verificaEditores": | |
| 37 | + $cp->set_data(verificaEditores($editores)); | |
| 38 | + $cp->return_data(); | |
| 39 | + break; | |
| 40 | + | |
| 41 | + case "pegaSistemas": | |
| 42 | + $sis = pegaDados('SELECT * from i3geoadmin_sistemas order by nome_sistema'); | |
| 43 | + for($i=0;$i<count($sis);++$i) | |
| 44 | + { | |
| 45 | + $funcoes = pegaDados('SELECT * from i3geoadmin_sistemasf where id_sistema ='.($sis[$i]["id_sistema"])); | |
| 46 | + $sis[$i]["funcoes"] = $funcoes; | |
| 47 | + } | |
| 48 | + $cp->set_data($sis); | |
| 49 | + $cp->return_data(); | |
| 50 | + break; | |
| 51 | + | |
| 52 | + case "alterarSistemas": | |
| 53 | + alterarSistemas(); | |
| 54 | + if($id_sistema == "") | |
| 55 | + $sis = pegaDados('SELECT * from i3geoadmin_sistemas'); | |
| 56 | + else | |
| 57 | + $sis = pegaDados('SELECT * from i3geoadmin_sistemas where id_sistema ='.$id_sistema); | |
| 58 | + for($i=0;$i<count($sis);++$i) | |
| 59 | + { | |
| 60 | + $funcoes = pegaDados('SELECT * from i3geoadmin_sistemasf where id_sistema ='.($sis[$i]["id_sistema"])); | |
| 61 | + $sis[$i]["funcoes"] = $funcoes; | |
| 62 | + } | |
| 63 | + $cp->set_data($sis); | |
| 64 | + $cp->return_data(); | |
| 65 | + break; | |
| 66 | + | |
| 67 | + case "alterarFuncoes": | |
| 68 | + alterarFuncoes(); | |
| 69 | + if($id_funcao == "") | |
| 70 | + $sis = pegaDados('SELECT * from i3geoadmin_sistemas'); | |
| 71 | + else | |
| 72 | + $sis = pegaDados('SELECT * from i3geoadmin_sistemas where id_sistema ='.$id_sistema); | |
| 73 | + for($i=0;$i<count($sis);++$i) | |
| 74 | + { | |
| 75 | + $funcoes = pegaDados('SELECT * from i3geoadmin_sistemasf where id_sistema ='.($sis[$i]["id_sistema"])); | |
| 76 | + $sis[$i]["funcoes"] = $funcoes; | |
| 77 | + } | |
| 78 | + $cp->set_data($sis); | |
| 79 | + $cp->return_data(); | |
| 80 | + break; | |
| 81 | + | |
| 82 | + | |
| 83 | + case "excluir": | |
| 84 | + $f = verificaFilhos(); | |
| 85 | + if(!$f) | |
| 86 | + $cp->set_data(excluirSistemas()); | |
| 87 | + else | |
| 88 | + $cp->set_data("erro"); | |
| 89 | + $cp->return_data(); | |
| 90 | + break; | |
| 91 | + | |
| 92 | + case "excluirFuncoes": | |
| 93 | + $cp->set_data(excluirFuncoes()); | |
| 94 | + $cp->return_data(); | |
| 95 | + break; | |
| 96 | + | |
| 97 | + case "importarXmlSistemas": | |
| 98 | + $cp->set_data(importarXmlSistemas()); | |
| 99 | + $cp->return_data(); | |
| 100 | + break; | |
| 101 | +} | |
| 102 | +/* | |
| 103 | +Function: alterarSistemas | |
| 104 | + | |
| 105 | +Altera o registro de um WS | |
| 106 | +*/ | |
| 107 | +function alterarSistemas() | |
| 108 | +{ | |
| 109 | + global $id_sistema,$perfil,$nome; | |
| 110 | + try | |
| 111 | + { | |
| 112 | + require_once("conexao.php"); | |
| 113 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 114 | + if($id_sistema != "") | |
| 115 | + $dbh->query("UPDATE i3geoadmin_sistemas SET nome_sistema = '$nome',perfil_sistema = '$perfil' WHERE id_sistema = $id_sistema"); | |
| 116 | + else | |
| 117 | + $dbh->query("INSERT INTO i3geoadmin_sistemas (nome_sistema,perfil_sistema) VALUES ('','')"); | |
| 118 | + $dbh = null; | |
| 119 | + return "ok"; | |
| 120 | + } | |
| 121 | + catch (PDOException $e) | |
| 122 | + { | |
| 123 | + return "Error!: " . $e->getMessage(); | |
| 124 | + } | |
| 125 | +} | |
| 126 | +function alterarFuncoes() | |
| 127 | +{ | |
| 128 | + global $id_sistema,$id_funcao,$perfil,$nomefuncao,$w,$h,$abrir; | |
| 129 | + try | |
| 130 | + { | |
| 131 | + require_once("conexao.php"); | |
| 132 | + $nomefuncao = mb_convert_encoding($nomefuncao,"UTF-8","ISO-8859-1"); | |
| 133 | + if($id_funcao != "") | |
| 134 | + $dbh->query("UPDATE i3geoadmin_sistemasf SET nome_funcao = '$nomefuncao',perfil_funcao = '$perfil', w_funcao = '$w',h_funcao = '$h', abrir_funcao = '$abrir' WHERE id_sistema = $id_sistema and id_funcao = $id_funcao"); | |
| 135 | + else | |
| 136 | + $dbh->query("INSERT INTO i3geoadmin_sistemasf (id_sistema,nome_funcao,perfil_funcao,w_funcao,h_funcao,abrir_funcao) VALUES ('$id_sistema','','','$w','$h','')"); | |
| 137 | + $dbh = null; | |
| 138 | + return "ok"; | |
| 139 | + } | |
| 140 | + catch (PDOException $e) | |
| 141 | + { | |
| 142 | + return "Error!: " . $e->getMessage(); | |
| 143 | + } | |
| 144 | +} | |
| 145 | +function excluirFuncoes() | |
| 146 | +{ | |
| 147 | + global $id; | |
| 148 | + try | |
| 149 | + { | |
| 150 | + include("conexao.php"); | |
| 151 | + $dbh->query("DELETE from i3geoadmin_sistemasf WHERE id_sistema = $id"); | |
| 152 | + $dbh = null; | |
| 153 | + return "ok"; | |
| 154 | + } | |
| 155 | + catch (PDOException $e) | |
| 156 | + { | |
| 157 | + return "Error!: " . $e->getMessage(); | |
| 158 | + } | |
| 159 | +} | |
| 160 | +function excluirSistemas() | |
| 161 | +{ | |
| 162 | + global $id; | |
| 163 | + try | |
| 164 | + { | |
| 165 | + include("conexao.php"); | |
| 166 | + $dbh->query("DELETE from i3geoadmin_sistemas WHERE id_sistema = $id"); | |
| 167 | + $dbh = null; | |
| 168 | + return "ok"; | |
| 169 | + } | |
| 170 | + catch (PDOException $e) | |
| 171 | + { | |
| 172 | + return "Error!: " . $e->getMessage(); | |
| 173 | + } | |
| 174 | +} | |
| 175 | +function importarXmlSistemas() | |
| 176 | +{ | |
| 177 | + global $xml,$tipo; | |
| 178 | + if(!file_exists($xml)) | |
| 179 | + {return "<br><b>Arquivo $xml não encontrado";} | |
| 180 | + include_once("../../classesphp/funcoes_gerais.php"); | |
| 181 | + include("conexao.php"); | |
| 182 | + $xml = simplexml_load_file($xml); | |
| 183 | + // | |
| 184 | + //importa os grupos | |
| 185 | + // | |
| 186 | + $sistemasExistentes = array(); | |
| 187 | + $q = $dbh->query("select * from i3geoadmin_sistemas"); | |
| 188 | + $resultado = $q->fetchAll(); | |
| 189 | + foreach($resultado as $r) | |
| 190 | + {$sistemasExistentes[$r["nome_sistema"]] = 0;} | |
| 191 | + foreach($xml->SISTEMA as $item) | |
| 192 | + { | |
| 193 | + $nome = ixml($item,"NOMESIS"); | |
| 194 | + $perfil = ixml($item,"PERFIL"); | |
| 195 | + if(!isset($sistemasExistentes[$nome])) | |
| 196 | + $dbh->query("INSERT INTO i3geoadmin_sistemas (nome_sistema,perfil_sistema) VALUES ('$nome','$perfil')"); | |
| 197 | + $sistemasExistentes[$nome] = 0; | |
| 198 | + $id_sistema = $dbh->lastInsertId("id_sistema"); | |
| 199 | + foreach ($item->FUNCAO as $funcao) | |
| 200 | + { | |
| 201 | + $abrir_funcao = ixml($funcao,"ABRIR"); | |
| 202 | + $nome_funcao = ixml($funcao,"NOMEFUNCAO"); | |
| 203 | + $w_funcao = ixml($funcao,"JANELAW"); | |
| 204 | + $h_funcao = ixml($funcao,"JANELAH"); | |
| 205 | + $perfil_funcao = ixml($funcao,"PERFIL"); | |
| 206 | + $dbh->query("INSERT INTO i3geoadmin_sistemasf (nome_funcao,abrir_funcao,perfil_funcao,w_funcao,h_funcao,id_sistema) VALUES ('$nome_funcao','$abrir_funcao','$perfil_funcao','$w_funcao','$h_funcao','$id_sistema')"); | |
| 207 | + } | |
| 208 | + } | |
| 209 | + $dbh = null; | |
| 210 | + return "Dados importados."; | |
| 211 | +} | |
| 212 | +function verificaFilhos() | |
| 213 | +{ | |
| 214 | + try | |
| 215 | + { | |
| 216 | + global $id; | |
| 217 | + $res = false; | |
| 218 | + $r = pegaDados("select * from i3geoadmin_sistemasf where id_sistema=$id"); | |
| 219 | + if(count($r) > 0) | |
| 220 | + $res = true; | |
| 221 | + return $res; | |
| 222 | + } | |
| 223 | + catch (PDOException $e) | |
| 224 | + { | |
| 225 | + return "Error!: " . $e->getMessage(); | |
| 226 | + } | |
| 227 | +} | |
| 228 | + | |
| 229 | +?> | |
| 0 | 230 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +<?php | |
| 2 | +echo "<pre>"; | |
| 3 | +$dbh = new PDO('sqlite:../menutemas/admin.db'); | |
| 4 | +echo "<br><br><span style=color:red >Lista de tabelas</span><br><br>"; | |
| 5 | +$q = $dbh->query("SELECT name FROM (SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type='table' ORDER BY name",PDO::FETCH_ASSOC); | |
| 6 | +$resultado = $q->fetchAll(); | |
| 7 | +foreach ($resultado as $r) | |
| 8 | +echo $r["name"]."<br>"; | |
| 9 | + | |
| 10 | + | |
| 11 | +$q = $dbh->query("select * from sqlite_master",PDO::FETCH_ASSOC); | |
| 12 | +$resultado = $q->fetchAll(); | |
| 13 | +echo "<br><br><span style=color:red >SQL no padrão SQLITE</span><br><br>"; | |
| 14 | +foreach($resultado as $r) | |
| 15 | +{ | |
| 16 | + echo $r["sql"]."<br>"; | |
| 17 | +} | |
| 18 | +echo "<br><br><span style=color:red >SQL no padrão POSTGRES</span><br><br>"; | |
| 19 | +foreach($resultado as $r) | |
| 20 | +{ | |
| 21 | + echo str_ireplace("INTEGER PRIMARY KEY","SERIAL",$r["sql"])."<br>"; | |
| 22 | +} | |
| 23 | +echo "<br><br><span style=color:red >Listagem completa</span><br><br>"; | |
| 24 | + | |
| 25 | +var_dump($resultado); | |
| 26 | +$dbh = null; | |
| 27 | +?> | |
| 0 | 28 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,577 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração do cadastro de sistemas | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/sistemas.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +include_once("admin.php"); | |
| 31 | +include_once("../../ms_configura.php"); | |
| 32 | +include_once("../../classesphp/funcoes_gerais.php"); | |
| 33 | +$cp = new cpaint(); | |
| 34 | +//faz a busca da função que deve ser executada | |
| 35 | +switch ($funcao) | |
| 36 | +{ | |
| 37 | + //verifica os editores | |
| 38 | + case "criarNovoMap": | |
| 39 | + $cp->set_data(criarNovoMap()); | |
| 40 | + $cp->return_data(); | |
| 41 | + break; | |
| 42 | + case "pegaLayers": | |
| 43 | + $cp->set_data(pegaLayers()); | |
| 44 | + $cp->return_data(); | |
| 45 | + break; | |
| 46 | + case "pegaCaracteristicasGerais": | |
| 47 | + $cp->set_data(pegaCaracteristicasGerais()); | |
| 48 | + $cp->return_data(); | |
| 49 | + break; | |
| 50 | + case "pegaMetadados": | |
| 51 | + $cp->set_data(pegaMetadados()); | |
| 52 | + $cp->return_data(); | |
| 53 | + break; | |
| 54 | + case "pegaClasses": | |
| 55 | + $cp->set_data(pegaClasses()); | |
| 56 | + $cp->return_data(); | |
| 57 | + break; | |
| 58 | + case "pegaEstilos": | |
| 59 | + $cp->set_data(pegaEstilos()); | |
| 60 | + $cp->return_data(); | |
| 61 | + break; | |
| 62 | + case "alteraLayer": | |
| 63 | + substituiCon($map_file,$postgis_mapa); | |
| 64 | + $cp->set_data(alteraLayer()); | |
| 65 | + $cp->return_data(); | |
| 66 | + break; | |
| 67 | + case "alteraMetadados": | |
| 68 | + $cp->set_data(alteraMetadados()); | |
| 69 | + $cp->return_data(); | |
| 70 | + break; | |
| 71 | + case "alteraClasse": | |
| 72 | + substituiCon($map_file,$postgis_mapa); | |
| 73 | + $cp->set_data(alteraClasse()); | |
| 74 | + $cp->return_data(); | |
| 75 | + break; | |
| 76 | + case "alteraClasseLabel": | |
| 77 | + substituiCon($map_file,$postgis_mapa); | |
| 78 | + $cp->set_data(alteraClasseLabel()); | |
| 79 | + $cp->return_data(); | |
| 80 | + break; | |
| 81 | + case "alteraEstilo": | |
| 82 | + substituiCon($map_file,$postgis_mapa); | |
| 83 | + $cp->set_data(alteraEstilo()); | |
| 84 | + $cp->return_data(); | |
| 85 | + break; | |
| 86 | + case "pegaFontes": | |
| 87 | + $cp->set_data(pegaFontes()); | |
| 88 | + $cp->return_data(); | |
| 89 | + break; | |
| 90 | + case "criarNovoLayer": | |
| 91 | + $cp->set_data(criarNovoLayer()); | |
| 92 | + $cp->return_data(); | |
| 93 | + break; | |
| 94 | + case "excluirLayer": | |
| 95 | + $cp->set_data(excluirLayer()); | |
| 96 | + $cp->return_data(); | |
| 97 | + break; | |
| 98 | + case "adicionarClasse": | |
| 99 | + substituiCon($map_file,$postgis_mapa); | |
| 100 | + $cp->set_data(adicionarClasse()); | |
| 101 | + $cp->return_data(); | |
| 102 | + break; | |
| 103 | + case "excluirClasse": | |
| 104 | + substituiCon($map_file,$postgis_mapa); | |
| 105 | + $cp->set_data(excluirClasse()); | |
| 106 | + $cp->return_data(); | |
| 107 | + break; | |
| 108 | + case "adicionarEstilo": | |
| 109 | + substituiCon($map_file,$postgis_mapa); | |
| 110 | + $cp->set_data(adicionarEstilo()); | |
| 111 | + $cp->return_data(); | |
| 112 | + break; | |
| 113 | +} | |
| 114 | +function adicionarEstilo() | |
| 115 | +{ | |
| 116 | + global $codigoMap,$codigoLayer,$codigoClasse; | |
| 117 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 118 | + $mapa = ms_newMapObj($mapfile); | |
| 119 | + $nl = $mapa->getlayerbyname($codigoLayer); | |
| 120 | + $classObj = $nl->getclass($codigoClasse); | |
| 121 | + $nestilo = ms_newStyleObj($classObj); | |
| 122 | + $mapa->save($mapfile); | |
| 123 | + removeCabecalho($mapfile); | |
| 124 | + return "ok"; | |
| 125 | +} | |
| 126 | +function excluirClasse() | |
| 127 | +{ | |
| 128 | + global $codigoMap,$codigoLayer,$codigoClasse; | |
| 129 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 130 | + $mapa = ms_newMapObj($mapfile); | |
| 131 | + $nl = $mapa->getlayerbyname($codigoLayer); | |
| 132 | + $classObj = $nl->getclass($codigoClasse); | |
| 133 | + $classObj->set("status",MS_DELETE); | |
| 134 | + $mapa->save($mapfile); | |
| 135 | + removeCabecalho($mapfile); | |
| 136 | + return "ok"; | |
| 137 | +} | |
| 138 | +function adicionarClasse() | |
| 139 | +{ | |
| 140 | + global $codigoMap,$codigoLayer; | |
| 141 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 142 | + $mapa = ms_newMapObj($mapfile); | |
| 143 | + $nl = $mapa->getlayerbyname($codigoLayer); | |
| 144 | + $classObj = ms_newClassObj($nl); | |
| 145 | + $classObj->set("name"," "); | |
| 146 | + $mapa->save($mapfile); | |
| 147 | + removeCabecalho($mapfile); | |
| 148 | + return "ok"; | |
| 149 | +} | |
| 150 | +function excluirLayer() | |
| 151 | +{ | |
| 152 | + global $codigoMap,$codigoLayer; | |
| 153 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 154 | + $mapa = ms_newMapObj($mapfile); | |
| 155 | + $nl = $mapa->getlayerbyname($codigoLayer); | |
| 156 | + $nl->set("status",MS_DELETE); | |
| 157 | + $mapa->save($mapfile); | |
| 158 | + removeCabecalho($mapfile); | |
| 159 | + return "ok"; | |
| 160 | +} | |
| 161 | +function criarNovoLayer() | |
| 162 | +{ | |
| 163 | + global $codigoMap; | |
| 164 | + include_once("../../classesphp/funcoes_gerais.php"); | |
| 165 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 166 | + $mapat = ms_newMapObj("base.map"); | |
| 167 | + $layer = $mapat->getlayerbyname("base"); | |
| 168 | + $mapa = ms_newMapObj($mapfile); | |
| 169 | + $nl = ms_newLayerObj($mapa,$layer); | |
| 170 | + $nl->set("name",nomeRandomico()); | |
| 171 | + $mapa->save($mapfile); | |
| 172 | + removeCabecalho($mapfile); | |
| 173 | + return "ok"; | |
| 174 | +} | |
| 175 | +function pegaFontes() | |
| 176 | +{ | |
| 177 | + $arq = "../symbols/fontes.txt"; | |
| 178 | + $h = fopen ($arq,"r"); | |
| 179 | + while ($i = fscanf ($h, "%s\t%s\t")) | |
| 180 | + { | |
| 181 | + list ($f,$g) = $i; | |
| 182 | + $nome[] = $f; | |
| 183 | + } | |
| 184 | + return $nome; | |
| 185 | +} | |
| 186 | +function alteraEstilo() | |
| 187 | +{ | |
| 188 | + global $codigoMap,$codigoLayer,$classe,$estilo,$parametro,$valor; | |
| 189 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 190 | + $mapa = ms_newMapObj($mapfile); | |
| 191 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 192 | + $classe = $layer->getclass($classe); | |
| 193 | + $estilo = $classe->getstyle($estilo); | |
| 194 | + $ok = false; | |
| 195 | + $cor = ""; | |
| 196 | + switch ($parametro) | |
| 197 | + { | |
| 198 | + case "backgroundcolor": | |
| 199 | + $cor = $estilo->backgroundcolor; | |
| 200 | + $ok = true; | |
| 201 | + break; | |
| 202 | + case "color": | |
| 203 | + $cor = $estilo->color; | |
| 204 | + $ok = true; | |
| 205 | + break; | |
| 206 | + case "outlinecolor": | |
| 207 | + $cor = $estilo->outlinecolor; | |
| 208 | + $ok = true; | |
| 209 | + break; | |
| 210 | + default: | |
| 211 | + if(!$ok)$estilo->set($parametro,$valor); | |
| 212 | + } | |
| 213 | + if ($cor != "") | |
| 214 | + { | |
| 215 | + $c = explode(",",$valor); | |
| 216 | + if(count($c) < 3) | |
| 217 | + $c = explode(" ",$valor); | |
| 218 | + $cor->setrgb($c[0],$c[1],$c[2]); | |
| 219 | + } | |
| 220 | + $mapa->save($mapfile); | |
| 221 | + removeCabecalho($mapfile); | |
| 222 | + return "ok"; | |
| 223 | +} | |
| 224 | +function alteraClasse() | |
| 225 | +{ | |
| 226 | + global $codigoMap,$codigoLayer,$classe,$parametro,$valor; | |
| 227 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 228 | + $mapa = ms_newMapObj($mapfile); | |
| 229 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 230 | + $classe = $layer->getclass($classe); | |
| 231 | + if($parametro == "text") | |
| 232 | + {$classe->settext($valor);} | |
| 233 | + elseif | |
| 234 | + ($parametro == "expression") | |
| 235 | + {$classe->setexpression($valor);} | |
| 236 | + else | |
| 237 | + $classe->set($parametro,$valor); | |
| 238 | + $mapa->save($mapfile); | |
| 239 | + removeCabecalho($mapfile); | |
| 240 | + return "ok"; | |
| 241 | +} | |
| 242 | +function alteraClasseLabel() | |
| 243 | +{ | |
| 244 | + global $codigoMap,$codigoLayer,$classe,$parametro,$valor; | |
| 245 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 246 | + $mapa = ms_newMapObj($mapfile); | |
| 247 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 248 | + $classe = $layer->getclass($classe); | |
| 249 | + $label = $classe->label; | |
| 250 | + $ok = false; | |
| 251 | + $cor = ""; | |
| 252 | + switch ($parametro) | |
| 253 | + { | |
| 254 | + case "backgroundcolor": | |
| 255 | + $cor = $label->backgroundcolor; | |
| 256 | + $ok = true; | |
| 257 | + break; | |
| 258 | + case "backgroundshadowcolor": | |
| 259 | + $cor = $label->backgroundshadowcolor; | |
| 260 | + $ok = true; | |
| 261 | + break; | |
| 262 | + case "color": | |
| 263 | + $cor = $label->color; | |
| 264 | + $ok = true; | |
| 265 | + break; | |
| 266 | + case "outlinecolor": | |
| 267 | + $cor = $label->outlinecolor; | |
| 268 | + $ok = true; | |
| 269 | + break; | |
| 270 | + case "shadowcolor": | |
| 271 | + $cor = $label->shadowcolor; | |
| 272 | + $ok = true; | |
| 273 | + break; | |
| 274 | + case "shadowsizex": | |
| 275 | + $cor = $label->shadowsizex; | |
| 276 | + $ok = true; | |
| 277 | + break; | |
| 278 | + case "shadowsizey": | |
| 279 | + $cor = $label->shadowsizey; | |
| 280 | + $ok = true; | |
| 281 | + break; | |
| 282 | + case "backgroundshadowsizex": | |
| 283 | + $cor = $label->backgroundshadowsizex; | |
| 284 | + $ok = true; | |
| 285 | + break; | |
| 286 | + case "backgroundshadowsizey": | |
| 287 | + $cor = $label->backgroundshadowsizey; | |
| 288 | + $ok = true; | |
| 289 | + break; | |
| 290 | + default: | |
| 291 | + if(!$ok)$label->set($parametro,$valor); | |
| 292 | + } | |
| 293 | + if ($cor != "") | |
| 294 | + { | |
| 295 | + $c = explode(",",$valor); | |
| 296 | + if(count($c) < 3) | |
| 297 | + $c = explode(" ",$valor); | |
| 298 | + $cor->setrgb($c[0],$c[1],$c[2]); | |
| 299 | + } | |
| 300 | + $mapa->save($mapfile); | |
| 301 | + removeCabecalho($mapfile); | |
| 302 | + return "ok"; | |
| 303 | +} | |
| 304 | + | |
| 305 | +function alteraMetadados() | |
| 306 | +{ | |
| 307 | + global $codigoMap,$codigoLayer,$parametro,$valor; | |
| 308 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 309 | + $mapa = ms_newMapObj($mapfile); | |
| 310 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 311 | + $layer->setmetadata(strtoupper($parametro),$valor); | |
| 312 | + if($valor == "") | |
| 313 | + $layer->removemetadata(strtoupper($parametro)); | |
| 314 | + $mapa->save($mapfile); | |
| 315 | + removeCabecalho($mapfile); | |
| 316 | + return "ok"; | |
| 317 | +} | |
| 318 | + | |
| 319 | +function alteraLayer() | |
| 320 | +{ | |
| 321 | + global $codigoMap,$codigoLayer,$parametro,$valor; | |
| 322 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 323 | + $mapa = ms_newMapObj($mapfile); | |
| 324 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 325 | + $ok = false; | |
| 326 | + switch ($parametro) | |
| 327 | + { | |
| 328 | + case "offsite": | |
| 329 | + $cor = $layer->offsite; | |
| 330 | + $c = explode(",",$valor); | |
| 331 | + if(count($c) < 3) | |
| 332 | + $c = explode(" ",$valor); | |
| 333 | + $cor->setrgb($c[0],$c[1],$c[2]); | |
| 334 | + $ok = true; | |
| 335 | + break; | |
| 336 | + case "filter": | |
| 337 | + $layer->setfilter($valor); | |
| 338 | + $ok = true; | |
| 339 | + break; | |
| 340 | + default: | |
| 341 | + if(!$ok)$layer->set($parametro,$valor); | |
| 342 | + } | |
| 343 | + $mapa->save($mapfile); | |
| 344 | + removeCabecalho($mapfile); | |
| 345 | + return "ok"; | |
| 346 | +} | |
| 347 | +function removeCabecalho($arq) | |
| 348 | +{ | |
| 349 | + global $postgis_mapa; | |
| 350 | + restauraCon($arq,$postgis_mapa); | |
| 351 | + $handle = fopen($arq, "r"); | |
| 352 | + if ($handle) | |
| 353 | + { | |
| 354 | + $final[] = "SYMBOLSET ../symbols/simbolos.sym\n"; | |
| 355 | + $final[] = "FONTSET ".'"'."../symbols/fontes.txt".'"'."\n"; | |
| 356 | + $grava = false; | |
| 357 | + while (!feof($handle)) | |
| 358 | + { | |
| 359 | + $linha = fgets($handle); | |
| 360 | + if(strtoupper(trim($linha)) == "LAYER") | |
| 361 | + {$grava = true;} | |
| 362 | + if($grava) | |
| 363 | + {$final[] = $linha."\n";} | |
| 364 | + } | |
| 365 | + fclose($handle); | |
| 366 | + } | |
| 367 | + $handle = fopen($arq, "w+"); | |
| 368 | + foreach ($final as $f) | |
| 369 | + { | |
| 370 | + if(($f != "") && ($f != 'FILTERITEM ""') && ($f != 'LABELITEM ""')) | |
| 371 | + fwrite($handle,$f); | |
| 372 | + } | |
| 373 | + fclose($handle); | |
| 374 | +} | |
| 375 | +function pegaLayers() | |
| 376 | +{ | |
| 377 | + global $codigoMap; | |
| 378 | + $dados = array(); | |
| 379 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 380 | + $mapa = ms_newMapObj($mapfile); | |
| 381 | + $layers = $mapa->getalllayernames(); | |
| 382 | + $dados["layers"] = $layers; | |
| 383 | + return $dados; | |
| 384 | +} | |
| 385 | +function pegaCaracteristicasGerais() | |
| 386 | +{ | |
| 387 | + global $codigoMap,$codigoLayer; | |
| 388 | + $dados = array(); | |
| 389 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 390 | + $mapa = ms_newMapObj($mapfile); | |
| 391 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 392 | + $dados["connection"] = $layer->connection; | |
| 393 | + $dados["connectiontype"] = $layer->connectiontype; | |
| 394 | + $dados["data"] = $layer->data; | |
| 395 | + $dados["type"] = $layer->type; | |
| 396 | + $dados["filter"] = $layer->getfilter(); | |
| 397 | + if($dados["filter"]== ""){$dados["filter"] = "";} | |
| 398 | + $dados["filteritem"] = $layer->filteritem; | |
| 399 | + $dados["group"] = $layer->group; | |
| 400 | + $dados["labelangleitem"] = $layer->labelangleitem; | |
| 401 | + $dados["labelitem"] = $layer->labelitem; | |
| 402 | + $dados["labelmaxscale"] = $layer->labelmaxscale; | |
| 403 | + $dados["labelmaxscale"] = $layer->labelmaxscale; | |
| 404 | + $dados["labelminscale"] = $layer->labelminscale; | |
| 405 | + $dados["labelsizeitem"] = $layer->labelsizeitem; | |
| 406 | + $dados["maxscale"] = $layer->maxscale; | |
| 407 | + $dados["minscale"] = $layer->minscale; | |
| 408 | + $dados["offsite"] = $layer->offsite->red.",".$layer->offsite->green.",".$layer->offsite->blue; | |
| 409 | + $dados["opacity"] = $layer->opacity; | |
| 410 | + $dados["symbolscale"] = $layer->symbolscale; | |
| 411 | + $dados["tileindex"] = $layer->tileindex; | |
| 412 | + $dados["tileitem"] = $layer->tileitem; | |
| 413 | + $dados["tolerance"] = $layer->tolerance; | |
| 414 | + $dados["toleranceunits"] = $layer->toleranceunits; | |
| 415 | + $dados["status"] = $layer->status; | |
| 416 | + $dados["sizeunits"] = $layer->sizeunits; | |
| 417 | + $dados["projection"] = $layer->getProjection; | |
| 418 | + $dados["name"] = $layer->name; | |
| 419 | + if($dados["type"] < 3) | |
| 420 | + { | |
| 421 | + $layer->open(); | |
| 422 | + $colunas = implode(", ",$layer->getitems()); | |
| 423 | + $layer->close(); | |
| 424 | + } | |
| 425 | + $dados["colunas"] = $colunas; | |
| 426 | + return $dados; | |
| 427 | +} | |
| 428 | +function pegaMetadados() | |
| 429 | +{ | |
| 430 | + global $codigoMap,$codigoLayer; | |
| 431 | + $dados = array(); | |
| 432 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 433 | + $mapa = ms_newMapObj($mapfile); | |
| 434 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 435 | + $dados["itens"] = $layer->getmetadata("itens"); | |
| 436 | + $dados["itensdesc"] = $layer->getmetadata("itensdesc"); | |
| 437 | + $dados["itenslink"] = $layer->getmetadata("itenslink"); | |
| 438 | + $dados["tip"] = $layer->getmetadata("tip"); | |
| 439 | + $dados["tema"] = mb_convert_encoding(($layer->getmetadata("tema")),"UTF-8","ISO-8859-1"); | |
| 440 | + $dados["classe"] = $layer->getmetadata("classe"); | |
| 441 | + $dados["escala"] = $layer->getmetadata("escala"); | |
| 442 | + $dados["download"] = $layer->getmetadata("download"); | |
| 443 | + $dados["escondido"] = $layer->getmetadata("escondido"); | |
| 444 | + $dados["extensao"] = $layer->getmetadata("extensao"); | |
| 445 | + $dados["identifica"] = $layer->getmetadata("identifica"); | |
| 446 | + $dados["mensagem"] = mb_convert_encoding(($layer->getmetadata("mensagem")),"UTF-8","ISO-8859-1"); | |
| 447 | + $dados["classesitem"] = $layer->getmetadata("classesitem"); | |
| 448 | + $dados["classesnome"] = $layer->getmetadata("classesnome"); | |
| 449 | + $dados["classescor"] = $layer->getmetadata("classescor"); | |
| 450 | + $dados["classessimbolo"] = $layer->getmetadata("classessimbolo"); | |
| 451 | + $dados["classestamanho"] = $layer->getmetadata("classestamanho"); | |
| 452 | + $dados["aplicaextensao"] = $layer->getmetadata("aplicaextensao"); | |
| 453 | + return $dados; | |
| 454 | +} | |
| 455 | +function pegaClasses() | |
| 456 | +{ | |
| 457 | + global $codigoMap,$codigoLayer; | |
| 458 | + $dados = array(); | |
| 459 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 460 | + $mapa = ms_newMapObj($mapfile); | |
| 461 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 462 | + $nclasses = $layer->numclasses; | |
| 463 | + for($i=0;$i<$nclasses;++$i) | |
| 464 | + { | |
| 465 | + $classe = $layer->getclass($i); | |
| 466 | + $temp["name"] = mb_convert_encoding(($classe->name),"UTF-8","ISO-8859-1"); | |
| 467 | + $temp["expression"] = $classe->getExpression(); | |
| 468 | + $temp["keyimage"] = $classe->keyimage; | |
| 469 | + $temp["maxscale"] = $classe->maxscale; | |
| 470 | + $temp["minscale"] = $classe->minscale; | |
| 471 | + $temp["maxsize"] = $classe->maxsize; | |
| 472 | + $temp["minsize"] = $classe->minsize; | |
| 473 | + $temp["size"] = $classe->size; | |
| 474 | + $temp["status"] = $classe->status; | |
| 475 | + $temp["symbolname"] = $classe->symbolname; | |
| 476 | + $temp["text"] = mb_convert_encoding(($classe->getTextString()),"UTF-8","ISO-8859-1"); | |
| 477 | + $temp["type"] = $classe->type; | |
| 478 | + $label = $classe->label; | |
| 479 | + if ($label != "") | |
| 480 | + { | |
| 481 | + $t["font"] = $label->font; | |
| 482 | + $t["type"] = $label->type; | |
| 483 | + $t["backgroundcolor"] = $label->backgroundcolor->red.",".$label->backgroundcolor->green.",".$label->backgroundcolor->blue; | |
| 484 | + $t["backgroundshadowcolor"] = $label->backgroundshadowcolor->red.",".$label->backgroundshadowcolor->green.",".$label->backgroundshadowcolor->blue; | |
| 485 | + $t["color"] = $label->color->red.",".$label->color->green.",".$label->color->blue; | |
| 486 | + $t["outlinecolor"] = $label->outlinecolor->red.",".$label->outlinecolor->green.",".$label->outlinecolor->blue; | |
| 487 | + $t["shadowcolor"] = $label->shadowcolor->red.",".$label->shadowcolor->green.",".$label->shadowcolor->blue; | |
| 488 | + $t["shadowsizex"] = $label->shadowsizex; | |
| 489 | + $t["shadowsizey"] = $label->shadowsizey; | |
| 490 | + $t["backgroundshadowsizex"] = $label->backgroundshadowsizex; | |
| 491 | + $t["backgroundshadowsizey"] = $label->backgroundshadowsizey; | |
| 492 | + $t["size"] = $label->size; | |
| 493 | + $t["minsize"] = $label->minsize; | |
| 494 | + $t["maxsize"] = $label->maxsize; | |
| 495 | + $t["position"] = $label->position; | |
| 496 | + $t["offsetx"] = $label->offsetx; | |
| 497 | + $t["offsety"] = $label->offsety; | |
| 498 | + $t["angle"] = $label->angle; | |
| 499 | + $t["autoangle"] = $label->autoangle; | |
| 500 | + $t["buffer"] = $label->buffer; | |
| 501 | + $t["antialias"] = $label->antialias; | |
| 502 | + $t["wrap"] = $label->wrap; | |
| 503 | + $t["minfeaturesize"] = $label->minfeaturesize; | |
| 504 | + $t["autominfeaturesize"] = $label->autominfeaturesize; | |
| 505 | + $t["mindistance"] = $label->mindistance; | |
| 506 | + $t["partials"] = $label->partials; | |
| 507 | + $t["force"] = $label->force; | |
| 508 | + $t["encoding"] = $label->encoding; | |
| 509 | + $temp["label"] = $t; | |
| 510 | + } | |
| 511 | + else | |
| 512 | + $temp["label"] = array(); | |
| 513 | + $dados[] = array("id"=>$i,"dados"=>$temp); | |
| 514 | + } | |
| 515 | + return $dados; | |
| 516 | +} | |
| 517 | +function pegaEstilos() | |
| 518 | +{ | |
| 519 | + global $codigoMap,$codigoLayer; | |
| 520 | + $dados = array(); | |
| 521 | + $mapfile = "../temas/".$codigoMap.".map"; | |
| 522 | + $mapa = ms_newMapObj($mapfile); | |
| 523 | + $layer = $mapa->getlayerbyname($codigoLayer); | |
| 524 | + $nclasses = $layer->numclasses; | |
| 525 | + for($i=0;$i<$nclasses;++$i) | |
| 526 | + { | |
| 527 | + $classe = $layer->getclass($i); | |
| 528 | + $numestilos = $classe->numstyles; | |
| 529 | + $estilos = array(); | |
| 530 | + for($j=0;$j<$numestilos;++$j) | |
| 531 | + { | |
| 532 | + $estilo = $classe->getstyle($j); | |
| 533 | + $temp["symbolname"] = $estilo->symbolname; | |
| 534 | + $temp["color"] = $estilo->color->red.",".$estilo->color->green.",".$estilo->color->blue; | |
| 535 | + $temp["size"] = $estilo->size; | |
| 536 | + $temp["minsize"] = $estilo->minsize; | |
| 537 | + $temp["maxsize"] = $estilo->maxsize; | |
| 538 | + $temp["offsetx"] = $estilo->offsetx; | |
| 539 | + $temp["offsety"] = $estilo->offsety; | |
| 540 | + $temp["antialias"] = $estilo->antialias; | |
| 541 | + $temp["backgroundcolor"] = $estilo->backgroundcolor->red.",".$estilo->backgroundcolor->green.",".$estilo->backgroundcolor->blue; | |
| 542 | + $temp["outlinecolor"] = $estilo->outlinecolor->red.",".$estilo->outlinecolor->green.",".$estilo->outlinecolor->blue; | |
| 543 | + $temp["width"] = $estilo->width; | |
| 544 | + $temp["minwidth"] = $estilo->minwidth; | |
| 545 | + $temp["maxwidth"] = $estilo->maxwidth; | |
| 546 | + $temp["angle"] = $estilo->angle; | |
| 547 | + $temp["angleitem"] = $estilo->angleitem; | |
| 548 | + $temp["sizeitem"] = $estilo->sizeitem; | |
| 549 | + $temp["minvalue"] = $estilo->minvalue; | |
| 550 | + $temp["maxvalue"] = $estilo->maxvalue; | |
| 551 | + $estilos[] = array("estilo"=>$j,"dados"=>$temp); | |
| 552 | + } | |
| 553 | + $dados[] = array("classe"=>$i,"estilos"=>$estilos); | |
| 554 | + } | |
| 555 | + return $dados; | |
| 556 | +} | |
| 557 | +function criarNovoMap() | |
| 558 | +{ | |
| 559 | + global $nome,$codigo; | |
| 560 | + if(!file_exists("../temas/".$codigo.".map")) | |
| 561 | + { | |
| 562 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 563 | + copy("base.map","../temas/".$codigo.".map"); | |
| 564 | + $mapfile = "../temas/".$codigo.".map"; | |
| 565 | + $mapa = ms_newMapObj($mapfile); | |
| 566 | + $layer = $mapa->getlayerbyname("base"); | |
| 567 | + $layer->set("name",$codigo); | |
| 568 | + $mapa->save($mapfile); | |
| 569 | + require_once("conexao.php"); | |
| 570 | + $dbh->query("INSERT INTO i3geoadmin_temas (link_tema,kml_tema,ogc_tema,download_tema,desc_tema,tipoa_tema,tags_tema,nome_tema,codigo_tema) VALUES ('','', '','','','','','$nome','$codigo')"); | |
| 571 | + $dbh = null; | |
| 572 | + | |
| 573 | + return "ok"; | |
| 574 | + } | |
| 575 | + return "erro"; | |
| 576 | +} | |
| 577 | +?> | |
| 0 | 578 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,138 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +Title: Administração do cadastro de web services | |
| 4 | + | |
| 5 | +About: Licença | |
| 6 | + | |
| 7 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 8 | + | |
| 9 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 10 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 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 | +tanto a versão 2 da Licença. | |
| 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 cópia 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 | +File: i3geo/admin/webservices.php | |
| 26 | + | |
| 27 | +19/6/2007 | |
| 28 | + | |
| 29 | +*/ | |
| 30 | +include_once("admin.php"); | |
| 31 | +$cp = new cpaint(); | |
| 32 | +//faz a busca da função que deve ser executada | |
| 33 | +switch ($funcao) | |
| 34 | +{ | |
| 35 | + //verifica os editores | |
| 36 | + case "verificaEditores": | |
| 37 | + $cp->set_data(verificaEditores($editores)); | |
| 38 | + $cp->return_data(); | |
| 39 | + break; | |
| 40 | + | |
| 41 | + case "pegaWS": | |
| 42 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_ws order by tipo_ws')); | |
| 43 | + $cp->return_data(); | |
| 44 | + break; | |
| 45 | + | |
| 46 | + case "alterarWS": | |
| 47 | + alterarWS(); | |
| 48 | + if($id_ws == "") | |
| 49 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_ws')); | |
| 50 | + else | |
| 51 | + $cp->set_data(pegaDados('SELECT * from i3geoadmin_ws where id_ws = '.$id_ws)); | |
| 52 | + $cp->return_data(); | |
| 53 | + break; | |
| 54 | + | |
| 55 | + case "excluir": | |
| 56 | + $cp->set_data(excluirWS()); | |
| 57 | + $cp->return_data(); | |
| 58 | + break; | |
| 59 | + | |
| 60 | + case "importarXmlWS": | |
| 61 | + $cp->set_data(importarXmlWS()); | |
| 62 | + $cp->return_data(); | |
| 63 | + break; | |
| 64 | +} | |
| 65 | +/* | |
| 66 | +Function: alterarWS | |
| 67 | + | |
| 68 | +Altera o registro de um WS | |
| 69 | +*/ | |
| 70 | +function alterarWS() | |
| 71 | +{ | |
| 72 | + global $id_ws,$desc,$nome,$link,$autor,$tipo; | |
| 73 | + try | |
| 74 | + { | |
| 75 | + require_once("conexao.php"); | |
| 76 | + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
| 77 | + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); | |
| 78 | + $autor = mb_convert_encoding($autor,"UTF-8","ISO-8859-1"); | |
| 79 | + if($id_ws != "") | |
| 80 | + $dbh->query("UPDATE i3geoadmin_ws SET desc_ws = '$desc',nome_ws = '$nome', link_ws = '$link', autor_ws = '$autor', tipo_ws = '$tipo' WHERE id_ws = $id_ws"); | |
| 81 | + else | |
| 82 | + $dbh->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,tipo_ws,link_ws) VALUES ('','','','','')"); | |
| 83 | + $dbh = null; | |
| 84 | + return "ok"; | |
| 85 | + } | |
| 86 | + catch (PDOException $e) | |
| 87 | + { | |
| 88 | + return "Error!: " . $e->getMessage(); | |
| 89 | + } | |
| 90 | +} | |
| 91 | +function excluirWS() | |
| 92 | +{ | |
| 93 | + global $id; | |
| 94 | + try | |
| 95 | + { | |
| 96 | + include("conexao.php"); | |
| 97 | + $dbh->query("DELETE from i3geoadmin_ws WHERE id_ws = $id"); | |
| 98 | + $dbh = null; | |
| 99 | + return "ok"; | |
| 100 | + } | |
| 101 | + catch (PDOException $e) | |
| 102 | + { | |
| 103 | + return "Error!: " . $e->getMessage(); | |
| 104 | + } | |
| 105 | +} | |
| 106 | +function importarXmlWS() | |
| 107 | +{ | |
| 108 | + global $xml,$tipo; | |
| 109 | + if(!file_exists($xml)) | |
| 110 | + {return "<br><b>Arquivo $xml não encontrado";} | |
| 111 | + include_once("../../classesphp/funcoes_gerais.php"); | |
| 112 | + include("conexao.php"); | |
| 113 | + $xml = simplexml_load_file($xml); | |
| 114 | + // | |
| 115 | + //importa os grupos | |
| 116 | + // | |
| 117 | + $wsExistentes = array(); | |
| 118 | + $q = $dbh->query("select * from i3geoadmin_ws"); | |
| 119 | + $resultado = $q->fetchAll(); | |
| 120 | + foreach($resultado as $r) | |
| 121 | + {$wsExistentes[$r["nome_ws"]] = 0;} | |
| 122 | + foreach($xml->channel as $c) | |
| 123 | + { | |
| 124 | + foreach($c->item as $item) | |
| 125 | + { | |
| 126 | + $descricao = ixml($item,"description"); | |
| 127 | + $nome = ixml($item,"title"); | |
| 128 | + $autor = ixml($item,"author"); | |
| 129 | + $link = ixml($item,"link"); | |
| 130 | + if(!isset($wsExistentes[$nome])) | |
| 131 | + $dbh->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,link_ws,tipo_ws) VALUES ('$nome','$desc','$autor','$link','$tipo')"); | |
| 132 | + $wsExistentes[$nome] = 0; | |
| 133 | + } | |
| 134 | + } | |
| 135 | + $dbh = null; | |
| 136 | + return "Dados importados."; | |
| 137 | +} | |
| 138 | +?> | |
| 0 | 139 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,72 @@ |
| 1 | +<?php | |
| 2 | +// | |
| 3 | +//$id_menu = id do menu que será montado | |
| 4 | +//$perfil = perfis | |
| 5 | +include_once("php/admin.php"); | |
| 6 | +include_once("php/conexao.php"); | |
| 7 | +echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | |
| 8 | +//echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">"; | |
| 9 | +echo "\n<RAIZ>\n"; | |
| 10 | +if (!isset($perfil)){$perfil = "";} | |
| 11 | + | |
| 12 | +$q = "select * from i3geoadmin_atlas "; | |
| 13 | +$qatlas = $dbh->query($q); | |
| 14 | +foreach($qatlas as $row) | |
| 15 | +{ | |
| 16 | + echo "<ATLAS>\n"; | |
| 17 | + echo " <ID>".$row["id_atlas"]."</ID>\n"; | |
| 18 | + echo " <TITULO>".xmlmenu_prepara($row["titulo_atlas"])."</TITULO>\n"; | |
| 19 | + echo " <DESCRICAO>".xmlmenu_prepara($row["desc_atlas"])."</DESCRICAO>\n"; | |
| 20 | + echo " <ICONE>".$row["icone_atlas"]."</ICONE>\n"; | |
| 21 | + echo " <LINKMAISINFO>".xmlmenu_prepara($row["link_atlas"])."</LINKMAISINFO>\n"; | |
| 22 | + echo " <TEMPLATEHTML>".xmlmenu_prepara($row["template_atlas"])."</TEMPLATEHTML>\n"; | |
| 23 | + echo " <WABERTURA>".$row["w_atlas"]."</WABERTURA>\n"; | |
| 24 | + echo " <HABERTURA>".$row["h_atlas"]."</HABERTURA>\n"; | |
| 25 | + echo " <PRANCHADEFAULT>".$row["pranchadefault_atlas"]."</PRANCHADEFAULT>\n"; | |
| 26 | + echo " <TIPOGUIAS>".$row["tipoguias_atlas"]."</TIPOGUIAS>\n"; | |
| 27 | + echo " <BASEMAPFILE>".$row["basemapfile_atlas"]."</BASEMAPFILE>\n"; | |
| 28 | + echo " <PRANCHAS>\n"; | |
| 29 | + xmlmenu_pegapranchas($row["id_atlas"]); | |
| 30 | + echo " </PRANCHAS>\n"; | |
| 31 | + echo " </ATLAS>\n"; | |
| 32 | +} | |
| 33 | +echo "</RAIZ>\n"; | |
| 34 | +$dbh = null; | |
| 35 | +function xmlmenu_pegapranchas($id_atlas) | |
| 36 | +{ | |
| 37 | + global $dbh; | |
| 38 | + $q = "select * from i3geoadmin_atlasp as p where p.id_atlas = $id_atlas "; | |
| 39 | + $qpranchas = $dbh->query($q); | |
| 40 | + foreach($qpranchas as $row) | |
| 41 | + { | |
| 42 | + echo " <PRANCHA>\n"; | |
| 43 | + echo " <ID>".$row["id_prancha"]."</ID>\n"; | |
| 44 | + echo " <TITULO>".xmlmenu_prepara($row["titulo_prancha"])."</TITULO>\n"; | |
| 45 | + echo " <DESCRICAO>".xmlmenu_prepara($row["desc_prancha"])."</DESCRICAO>\n"; | |
| 46 | + echo " <ICONE>".$row["icone_prancha"]."</ICONE>\n"; | |
| 47 | + echo " <LINKMAISINFO>".xmlmenu_prepara($row["link_prancha"])."</LINKMAISINFO>\n"; | |
| 48 | + echo " <WABERTURA>".$row["w_prancha"]."</WABERTURA>\n"; | |
| 49 | + echo " <HABERTURA>".$row["h_prancha"]."</HABERTURA>\n"; | |
| 50 | + echo " <MAPEXT>".$row["mapext_prancha"]."</MAPEXT>\n"; | |
| 51 | + echo " <TEMAS>\n"; | |
| 52 | + xmlmenu_pegatemas($row["id_prancha"]); | |
| 53 | + echo " </TEMAS>\n"; | |
| 54 | + echo " </PRANCHA>\n"; | |
| 55 | + } | |
| 56 | +} | |
| 57 | +function xmlmenu_pegatemas($id_prancha) | |
| 58 | +{ | |
| 59 | + global $dbh; | |
| 60 | + $q = "select * from i3geoadmin_atlast as t where t.id_prancha = $id_prancha "; | |
| 61 | + $qpranchas = $dbh->query($q); | |
| 62 | + foreach($qpranchas as $row) | |
| 63 | + { | |
| 64 | + echo "<TEMA>\n"; | |
| 65 | + echo "</TEMA>\n"; | |
| 66 | + } | |
| 67 | +} | |
| 68 | +function xmlmenu_prepara($texto) | |
| 69 | +{ | |
| 70 | + return str_replace("&","&",$texto); | |
| 71 | +} | |
| 72 | +?> | ... | ... |
| ... | ... | @@ -0,0 +1,126 @@ |
| 1 | +<?php | |
| 2 | +// | |
| 3 | +//$id_menu = id do menu que será montado | |
| 4 | +//$perfil = perfis | |
| 5 | +//$tipo = subgrupos|temas | |
| 6 | +include_once("php/admin.php"); | |
| 7 | +include_once("php/conexao.php"); | |
| 8 | +echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | |
| 9 | +//echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">"; | |
| 10 | +echo "\n<TEMASGEO>\n"; | |
| 11 | +echo "<CABECALHO></CABECALHO>\n"; | |
| 12 | +if (!isset($perfil)){$perfil = "";} | |
| 13 | +// | |
| 14 | +//pega os temas na raiz | |
| 15 | +// | |
| 16 | +$q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema from i3geoadmin_raiz as r,i3geoadmin_temas as temas where r.id_nivel = 0 and r.id_tema = temas.id_tema and r.id_menu = $id_menu "; | |
| 17 | +if($perfil == "") | |
| 18 | +$q .= "and r.perfil = ''"; | |
| 19 | +else | |
| 20 | +{ | |
| 21 | + $perfis = explode(" ",$perfil); | |
| 22 | + foreach ($perfis as $p) | |
| 23 | + {$q .= "and r.perfil = '$p' ";} | |
| 24 | +} | |
| 25 | +$qtemasraiz = $dbh->query($q); | |
| 26 | +xmlmenu_notema($qtemasraiz); | |
| 27 | + | |
| 28 | + | |
| 29 | +$q = "select nome_grupo,desc_grupo,n1.id_grupo,n1.id_n1 from i3geoadmin_n1 as n1,i3geoadmin_grupos as grupos where n1.id_menu = $id_menu and n1.id_grupo = grupos.id_grupo "; | |
| 30 | +if($perfil == "") | |
| 31 | +$q .= "and n1_perfil = ''"; | |
| 32 | +else | |
| 33 | +{ | |
| 34 | + $perfis = explode(" ",$perfil); | |
| 35 | + foreach ($perfis as $p) | |
| 36 | + { | |
| 37 | + $q .= "and n1_perfil = '$p' "; | |
| 38 | + } | |
| 39 | +} | |
| 40 | +$qgrupos = $dbh->query($q); | |
| 41 | +foreach($qgrupos as $row) | |
| 42 | +{ | |
| 43 | + echo "<GRUPO>\n"; | |
| 44 | + echo " <GTIPO>".xmlmenu_prepara($row["nome_grupo"])."</GTIPO>\n"; | |
| 45 | + // | |
| 46 | + //pega temas na raiz | |
| 47 | + // | |
| 48 | + $q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema from i3geoadmin_raiz as r,i3geoadmin_temas as temas where r.nivel = 1 and r.id_nivel = ".$row["id_n1"]." and r.id_tema = temas.id_tema and r.id_menu = $id_menu "; | |
| 49 | + if($perfil == "") | |
| 50 | + $q .= "and r.perfil = ''"; | |
| 51 | + else | |
| 52 | + { | |
| 53 | + $perfis = explode(" ",$perfil); | |
| 54 | + foreach ($perfis as $p) | |
| 55 | + {$q .= "and r.perfil = '$p' ";} | |
| 56 | + } | |
| 57 | + $qtemasraiz = $dbh->query($q); | |
| 58 | + xmlmenu_notema($qtemasraiz); | |
| 59 | + if(isset($tipo) && ($tipo == "subgrupos") || ($tipo == "")) | |
| 60 | + xmlmenu_pegasubgrupos($row["id_n1"]); | |
| 61 | + echo " <DTIPO>".xmlmenu_prepara($row["desc_grupo"])."</DTIPO>\n"; | |
| 62 | + echo "</GRUPO>\n"; | |
| 63 | +} | |
| 64 | +echo "</TEMASGEO>\n"; | |
| 65 | +$dbh = null; | |
| 66 | +function xmlmenu_pegasubgrupos($id_n1) | |
| 67 | +{ | |
| 68 | + global $dbh,$perfis,$tipo; | |
| 69 | + $q = "select subgrupos.id_subgrupo,nome_subgrupo,id_n2 from i3geoadmin_n2 as n2,i3geoadmin_subgrupos as subgrupos where n2.id_n2 = $id_n1 and n2.id_subgrupo = subgrupos.id_subgrupo "; | |
| 70 | + if(count($perfis) == 0) | |
| 71 | + $q .= "and n2_perfil = ''"; | |
| 72 | + else | |
| 73 | + { | |
| 74 | + foreach ($perfis as $p) | |
| 75 | + { | |
| 76 | + $q .= "and n2_perfil = '$p' "; | |
| 77 | + } | |
| 78 | + } | |
| 79 | + $qsgrupos = $dbh->query($q); | |
| 80 | + foreach($qsgrupos as $row) | |
| 81 | + { | |
| 82 | + echo "<SGRUPO>\n"; | |
| 83 | + echo "<SDTIPO>".xmlmenu_prepara($row["nome_subgrupo"])."</SDTIPO>\n"; | |
| 84 | + if(isset($tipo) && ($tipo == "temas") || ($tipo == "")) | |
| 85 | + xmlmenu_pegatemas($row["id_n2"]); | |
| 86 | + echo "</SGRUPO>\n"; | |
| 87 | + } | |
| 88 | +} | |
| 89 | +function xmlmenu_pegatemas($id_n2) | |
| 90 | +{ | |
| 91 | + global $dbh,$perfis; | |
| 92 | + $q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema from i3geoadmin_n3 as n3,i3geoadmin_temas as temas where n3.id_n2 = $id_n2 and n3.id_tema = temas.id_tema "; | |
| 93 | + if(count($perfis) == 0) | |
| 94 | + $q .= "and n3_perfil = ''"; | |
| 95 | + else | |
| 96 | + { | |
| 97 | + foreach ($perfis as $p) | |
| 98 | + { | |
| 99 | + $q .= "and n3_perfil = '$p' "; | |
| 100 | + } | |
| 101 | + } | |
| 102 | + $qtemas = $dbh->query($q); | |
| 103 | + xmlmenu_notema($qtemas); | |
| 104 | +} | |
| 105 | +function xmlmenu_notema($qtemas) | |
| 106 | +{ | |
| 107 | + foreach($qtemas as $row) | |
| 108 | + { | |
| 109 | + echo "<TEMA>\n"; | |
| 110 | + echo "<TID>".$row["codigo_tema"]."</TID>\n"; | |
| 111 | + echo "<TNOME>".xmlmenu_prepara($row["nome_tema"])."</TNOME>\n"; | |
| 112 | + echo "<TDESC>".xmlmenu_prepara($row["desc_tema"])."</TDESC>\n"; | |
| 113 | + echo "<TLINK>".xmlmenu_prepara($row["link_tema"])."</TLINK>\n"; | |
| 114 | + echo "<TIPOA>".$row["tipoa_tema"]."</TIPOA>\n"; | |
| 115 | + echo "<TAGS>".xmlmenu_prepara($row["tags_tema"])."</TAGS>\n"; | |
| 116 | + echo "<KML>".$row["kml_tema"]."</KML>\n"; | |
| 117 | + echo "<OGC>".$row["ogc_tema"]."</OGC>\n"; | |
| 118 | + echo "<DOWNLOAD>".$row["download_tema"]."</DOWNLOAD>\n"; | |
| 119 | + echo "</TEMA>\n"; | |
| 120 | + } | |
| 121 | +} | |
| 122 | +function xmlmenu_prepara($texto) | |
| 123 | +{ | |
| 124 | + return str_replace("&","&",$texto); | |
| 125 | +} | |
| 126 | +?> | ... | ... |