Commit e9167786937ced068ae261752c79d885a2e382b5
1 parent
b31ec4fe
Exists in
master
and in
7 other branches
--no commit message
Showing
25 changed files
with
2874 additions
and
19 deletions
Show diff stats
admin/hiperbolica.php
1 | <?php | 1 | <?php |
2 | error_reporting(0); | 2 | error_reporting(0); |
3 | -$xml = "<capa>"; | ||
4 | include("../ms_configura.php"); | 3 | include("../ms_configura.php"); |
5 | include("$locaplic/admin/php/admin.php"); | 4 | include("$locaplic/admin/php/admin.php"); |
5 | +include("$locaplic/admin/php/conexao.php"); | ||
6 | +if($convUTF) | ||
7 | +$xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | ||
8 | +else$xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; | ||
9 | + | ||
10 | + | ||
11 | +$xml .= "<capa>"; | ||
6 | $menus = pegaDados("SELECT * from i3geoadmin_menus order by nome_menu ",$locaplic); | 12 | $menus = pegaDados("SELECT * from i3geoadmin_menus order by nome_menu ",$locaplic); |
7 | $xml .= '<termo id="00" nome="Dados geo">'; | 13 | $xml .= '<termo id="00" nome="Dados geo">'; |
8 | $contador = 0; | 14 | $contador = 0; |
@@ -73,7 +79,7 @@ for($i=0;$i < count($grupos);++$i) | @@ -73,7 +79,7 @@ for($i=0;$i < count($grupos);++$i) | ||
73 | $nome = html_entity_decode($grupos[$i]["nome_grupo"]); | 79 | $nome = html_entity_decode($grupos[$i]["nome_grupo"]); |
74 | $idgrupo = $grupos[$i]["id_n1"]; | 80 | $idgrupo = $grupos[$i]["id_n1"]; |
75 | $xml .= '<item id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; | 81 | $xml .= '<item id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; |
76 | - $temastag = pegaDados("select d.tags_tema as tags,d.id_tema as tema from i3geoadmin_n2 as b,i3geoadmin_n1 as a,i3geoadmin_n3 as c,i3geoadmin_temas as d where a.id_grupo = '$idgrupo' and a.id_n1 = b.id_n1 and c.id_n2 = b.id_n2 and c.id_tema = d.id_tema group by tema",$locaplic); | 82 | + $temastag = pegaDados("select d.tags_tema as tags,d.id_tema as tema from i3geoadmin_n2 as b,i3geoadmin_n1 as a,i3geoadmin_n3 as c,i3geoadmin_temas as d where a.id_grupo = '$idgrupo' and a.id_n1 = b.id_n1 and c.id_n2 = b.id_n2 and c.id_tema = d.id_tema group by tema,d.tags_tema",$locaplic); |
77 | $arrayTag = array(); | 83 | $arrayTag = array(); |
78 | foreach($temastag as $tematag) | 84 | foreach($temastag as $tematag) |
79 | { | 85 | { |
@@ -119,9 +125,6 @@ $xml .= "</capa>"; | @@ -119,9 +125,6 @@ $xml .= "</capa>"; | ||
119 | //header('Cache-Control: no-cache, must-revalidate'); | 125 | //header('Cache-Control: no-cache, must-revalidate'); |
120 | //header('Pragma: no-cache'); | 126 | //header('Pragma: no-cache'); |
121 | header("Content-type: application/xml"); | 127 | header("Content-type: application/xml"); |
122 | -if($convUTF) | ||
123 | -header("Content-type: text/xml; charset=UTF-8"); | ||
124 | -else | ||
125 | -header("Content-type: text/xml; charset=ISO-8859-1"); | 128 | + |
126 | echo $xml; | 129 | echo $xml; |
127 | ?> | 130 | ?> |
@@ -0,0 +1,92 @@ | @@ -0,0 +1,92 @@ | ||
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 <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
12 | +<p><a href="../index.html">Voltar</a></p> | ||
13 | +<div id=ajuda style="display:none"> | ||
14 | +<p>Este programa permite editar as árvores de cada menu</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>Utilize as opções abaixo para relacionar os temas a grupos e sub-grupos. Escolha primeiro um menu e depois edite | ||
20 | +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. | ||
21 | +<p>Os grupos, sub-grupos e temas já devem ter sido criados para que se possa montar a árvore de associações. | ||
22 | +</div></div> | ||
23 | +<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | ||
24 | +</body> | ||
25 | +<script> | ||
26 | +/* | ||
27 | +Title: Administração da árvore de menus | ||
28 | + | ||
29 | +File: i3geo/admin/i3geoadmin_arvore.htm | ||
30 | +*/ | ||
31 | +$parametros = { | ||
32 | + "simples": [ | ||
33 | + { mensagem: "Edição das árvores dos menus",cabeca: "Raiz",variavel:"arvores"} | ||
34 | + ]}; | ||
35 | + | ||
36 | +var iniciaMenu = function(retorno) | ||
37 | +{ | ||
38 | + pegaParametros() | ||
39 | + iniciaAdmin() | ||
40 | + if(retorno.data == "" || retorno.data.length == 0) | ||
41 | + {document.body.innerHTML += "Nenhum menu cadastrado."} | ||
42 | + else | ||
43 | + { | ||
44 | + var ins = "<p><b>Selecione o menu:</b> " | ||
45 | + ins += "<select id=menusel onchange='pegaParametros();listaRaiz()' >" | ||
46 | + ins += "<option value='' >---</option>" | ||
47 | + for(var i = 0;i < retorno.data.length;i++) | ||
48 | + { | ||
49 | + ins += "<option value='"+retorno.data[i].id_menu+"' >"+retorno.data[i].nome_menu+"</option>" | ||
50 | + } | ||
51 | + ins += "</select><hr>" | ||
52 | + document.body.innerHTML += ins; | ||
53 | + } | ||
54 | +} | ||
55 | +var cp = new cpaint(); | ||
56 | +//cp.set_async(false); | ||
57 | +cp.set_response_type("JSON"); | ||
58 | +//pega os menus | ||
59 | +var p = "../php/menutemas.php?funcao=pegaMenus"; | ||
60 | +cp.call(p,"pegaMenus",iniciaMenu); | ||
61 | +//pega os grupos e subgrupos | ||
62 | + | ||
63 | +grupos = function(retorno){$grupos = retorno.data;} | ||
64 | +subGrupos = function(retorno){$subGrupos = retorno.data;}; | ||
65 | +temas = function(retorno){$temas = retorno.data;} | ||
66 | +temasRaiz = function(retorno){$temasRaiz = retorno.data;} | ||
67 | +listaPerfis = function(retorno){$perfis = retorno.data;} | ||
68 | +function pegaParametros() | ||
69 | +{ | ||
70 | + var cp = new cpaint(); | ||
71 | + //cp.set_async(false); | ||
72 | + cp.set_response_type("JSON"); | ||
73 | + | ||
74 | + var p = "../php/menutemas.php?funcao=pegaGrupos"; | ||
75 | + cp.call(p,"pegaMenus",grupos); | ||
76 | + | ||
77 | + var p = "../php/menutemas.php?funcao=pegaSubGrupos"; | ||
78 | + cp.call(p,"pegaMenus",subGrupos); | ||
79 | + | ||
80 | + var p = "../php/menutemas.php?funcao=pegaTemas"; | ||
81 | + cp.call(p,"pegaMenus",temas); | ||
82 | + | ||
83 | + var p = "../php/arvore.php?funcao=pegaTemasRaiz"; | ||
84 | + cp.call(p,"pegaMenus",temasRaiz); | ||
85 | + | ||
86 | + var p = "../php/menutemas.php?funcao=pegaPerfis"; | ||
87 | + cp.call(p,"pegaMenus",listaPerfis); | ||
88 | +} | ||
89 | + | ||
90 | +document.getElementById("aguarde").style.display="none" | ||
91 | +</script> | ||
92 | +</html> | ||
0 | \ No newline at end of file | 93 | \ No newline at end of file |
@@ -0,0 +1,35 @@ | @@ -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 | +</head> | ||
9 | +<body> | ||
10 | +<div style=width:80%;text-align:center;> | ||
11 | +<h1>Administração do i3geo - menu de temas <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
12 | +<p><a href="../index.html">Voltar</a></p> | ||
13 | +<div id=ajuda style="display:none"> | ||
14 | +<p>Este programa permite editar a lista de 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></div> | ||
20 | +<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | ||
21 | +</body> | ||
22 | +<script> | ||
23 | +/* | ||
24 | +Title: Administração da lista de grupos do menu de temas | ||
25 | + | ||
26 | +File: i3geo/admin/i3geoadmin_grupos.htm | ||
27 | +*/ | ||
28 | +$parametros = { | ||
29 | + "simples": [ | ||
30 | + { mensagem: "Adicione, altere ou elimine grupos cadastrados",cabeca: "Grupos",variavel:"grupos"} | ||
31 | + ]}; | ||
32 | +iniciaAdmin() | ||
33 | +document.getElementById("aguarde").style.display="none" | ||
34 | +</script> | ||
35 | +</html> | ||
0 | \ No newline at end of file | 36 | \ No newline at end of file |
@@ -0,0 +1,24 @@ | @@ -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 | \ No newline at end of file | 25 | \ No newline at end of file |
@@ -0,0 +1,48 @@ | @@ -0,0 +1,48 @@ | ||
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 <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
13 | +<p><a href="../index.html">Voltar</a></p> | ||
14 | +<div id=ajuda style="display:none"> | ||
15 | +<p>Este programa permite editar a lista de menus</p> | ||
16 | +<p>Você pode criar vários menus e depois acrescentar grupos, subgrupos e temas em cada um. | ||
17 | +A lista de menus que serão utilizados no i3geo é definida no arquivo ms_configura.php. | ||
18 | +<p>O menu é baseado no banco admin.db.</p> | ||
19 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | ||
20 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | ||
21 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | ||
22 | +</div></div> | ||
23 | +<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | ||
24 | +</body> | ||
25 | +<script> | ||
26 | +/* | ||
27 | +Title: Administração da lista de menus do menu de temas | ||
28 | + | ||
29 | +File: i3geo/admin/i3geoadmin_menus.htm | ||
30 | +*/ | ||
31 | +$parametros = { | ||
32 | + "simples": [ | ||
33 | + { mensagem: "Adicione, altere ou elimine menus cadastrados",cabeca: "Menus",variavel:"menus"} | ||
34 | + ]}; | ||
35 | +document.getElementById("aguarde").style.display="none" | ||
36 | +var cp = new cpaint(); | ||
37 | +//cp.set_async(false); | ||
38 | +cp.set_response_type("JSON"); | ||
39 | +listaPerfis = function(retorno){$perfis = retorno.data;iniciaAdmin()} | ||
40 | +var p = "../php/menutemas.php?funcao=pegaPerfis"; | ||
41 | +cp.call(p,"pegaMenus",listaPerfis); | ||
42 | +document.getElementById("aguarde").style.display="none" | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | +</script> | ||
48 | +</html> | ||
0 | \ No newline at end of file | 49 | \ No newline at end of file |
@@ -0,0 +1,35 @@ | @@ -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 - perfis <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
13 | +<p><a href="../index.html">Voltar</a></p> | ||
14 | +<div id=ajuda style="display:none"> | ||
15 | +<p>Este programa permite editar a lista de perfis</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></div> | ||
20 | +<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | ||
21 | +</body> | ||
22 | +<script> | ||
23 | +/* | ||
24 | +Title: Administração da lista de perfis | ||
25 | + | ||
26 | +File: i3geo/admin/i3geoadmin_perfis.htm | ||
27 | +*/ | ||
28 | +$parametros = { | ||
29 | + "simples": [ | ||
30 | + { mensagem: "Adicione, altere ou elimine perfis cadastrados",cabeca: "Perfis",variavel:"perfis"} | ||
31 | + ]}; | ||
32 | +iniciaAdmin() | ||
33 | +document.getElementById("aguarde").style.display="none" | ||
34 | +</script> | ||
35 | +</html> | ||
0 | \ No newline at end of file | 36 | \ No newline at end of file |
@@ -0,0 +1,36 @@ | @@ -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/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 <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
13 | +<p><a href="../index.html">Voltar</a></p> | ||
14 | +<div id=ajuda style="display:none"> | ||
15 | +<p>Este programa permite editar a lista de sub-grupos</p> | ||
16 | +<p>O menu é baseado no banco admin.db.</p> | ||
17 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | ||
18 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | ||
19 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | ||
20 | +</div></div> | ||
21 | +<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | ||
22 | +</body> | ||
23 | +<script> | ||
24 | +/* | ||
25 | +Title: Administração da lista de sub-grupos do menu de temas | ||
26 | + | ||
27 | +File: i3geo/admin/i3geoadmin_subgrupos.htm | ||
28 | +*/ | ||
29 | +$parametros = { | ||
30 | + "simples": [ | ||
31 | + { mensagem: "Adicione, altere ou elimine sub-grupos cadastrados",cabeca: "Sub-grupos",variavel:"subgrupos"} | ||
32 | + ]}; | ||
33 | +iniciaAdmin() | ||
34 | +document.getElementById("aguarde").style.display="none" | ||
35 | +</script> | ||
36 | +</html> | ||
0 | \ No newline at end of file | 37 | \ No newline at end of file |
@@ -0,0 +1,35 @@ | @@ -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 <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
13 | +<p><a href="../index.html">Voltar</a></p> | ||
14 | +<div id=ajuda style="display:none"> | ||
15 | +<p>Este programa permite editar a lista de tags (palavras-chave)</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></div> | ||
20 | +<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | ||
21 | +</body> | ||
22 | +<script> | ||
23 | +/* | ||
24 | +Title: Administração da lista de menus do menu de temas | ||
25 | + | ||
26 | +File: i3geo/admin/i3geoadmin_tags.htm | ||
27 | +*/ | ||
28 | +$parametros = { | ||
29 | + "simples": [ | ||
30 | + { mensagem: "Adicione, altere ou elimine tags cadastrados",cabeca: "Tags",variavel:"tags"} | ||
31 | + ]}; | ||
32 | +iniciaAdmin() | ||
33 | +document.getElementById("aguarde").style.display="none" | ||
34 | +</script> | ||
35 | +</html> | ||
0 | \ No newline at end of file | 36 | \ No newline at end of file |
@@ -0,0 +1,52 @@ | @@ -0,0 +1,52 @@ | ||
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 <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
13 | +<p><a href="../index.html">Voltar</a></p> | ||
14 | +<div id=ajuda style="display:none"> | ||
15 | +<p>Este programa permite editar a lista de temas</p> | ||
16 | +<p>O menu é baseado no banco admin.db.</p> | ||
17 | +<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | ||
18 | +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | ||
19 | +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | ||
20 | +<p>Os temas são relacionados aos mapfiles existentes no diretório i3geo/temas. Cada tema recebe um nome que será mostrado | ||
21 | +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. | ||
22 | +</div></div> | ||
23 | +<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | ||
24 | +</body> | ||
25 | +<script> | ||
26 | +/* | ||
27 | +Title: Administração da lista de temas do menu de temas | ||
28 | + | ||
29 | +File: i3geo/admin/i3geoadmin_temas.htm | ||
30 | +*/ | ||
31 | +$parametros = { | ||
32 | + "simples": [ | ||
33 | + { mensagem: "Adicione, altere ou elimine temas cadastrados",cabeca: "Temas",variavel:"temas"} | ||
34 | + ]}; | ||
35 | +var inicia = function(retorno) | ||
36 | +{ | ||
37 | + $listaTags = retorno.data; | ||
38 | + iniciaAdmin() | ||
39 | +} | ||
40 | +var listaTags = function(retorno) | ||
41 | +{ | ||
42 | + $listaDeMapfiles = retorno.data; | ||
43 | + var cPaint = new cpaint(); | ||
44 | + //cPaint.set_async("true"); | ||
45 | + cPaint.set_response_type("JSON"); | ||
46 | + var p = "../php/menutemas.php?funcao=pegaTags"; | ||
47 | + cPaint.call(p,"pegaTags",inicia); | ||
48 | +} | ||
49 | +pegaMapfiles(listaTags) | ||
50 | +document.getElementById("aguarde").style.display="none" | ||
51 | +</script> | ||
52 | +</html> | ||
0 | \ No newline at end of file | 53 | \ No newline at end of file |
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
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 <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | ||
12 | +<p><a href="../index.html">Voltar</a></p> | ||
13 | +<div id=ajuda style="display:none"> | ||
14 | +<p>Este programa permite criar ou editar os arquivos mapfile que compõem temas no i3geo.</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>A lista de arquivos editáveis é baseada no banco de dados administrativo. Para que um arquivo apareça na | ||
20 | +listagem, ele deve ter sido incluído no banco por meio da opção "Editar a lista de temas"</p> | ||
21 | + | ||
22 | +</div></div> | ||
23 | +<fieldset> | ||
24 | + <legend>Arquivo em edição</legend> | ||
25 | + <p>Escolha o arquivo para editar (a lista de arquivos é baseada no banco de dados administrativo)</p> | ||
26 | + <div id=arquivoAtivo ><p style=color:red >Aguarde...</p></div> | ||
27 | + <p><input onclick=testarMap() type=button value="Testar" /></p> | ||
28 | + | ||
29 | + <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> | ||
30 | + <p>Código:</p> | ||
31 | + <p><input type=text size=20 value="" id=codigoNovoMap /></p> | ||
32 | + <p>Nome:</p> | ||
33 | + <p><input type=text size=20 value="" id=nomeNovoMap /></p> | ||
34 | + <p><input onclick=criarNovoMap() type=button value="Criar" id=nomeNovoMap /></p> | ||
35 | +</fieldset> | ||
36 | +<p><input onclick=adicionarLayer() type=button value="Adicionar um novo layer" /></p> | ||
37 | +<div id=forms style=display:none ></div> | ||
38 | + | ||
39 | + | ||
40 | +</body> | ||
41 | +<script> | ||
42 | +iniciaAdmin() | ||
43 | +</script> | ||
44 | +</html> | ||
0 | \ No newline at end of file | 45 | \ No newline at end of file |
@@ -0,0 +1,493 @@ | @@ -0,0 +1,493 @@ | ||
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 | + $i("aguarde").style.display="none" | ||
75 | + //pegaParametros() | ||
76 | +} | ||
77 | +/* | ||
78 | +Function: pegaParametros | ||
79 | + | ||
80 | +Pega os parâmetros do mapfiles.php | ||
81 | + | ||
82 | +*/ | ||
83 | +function pegaParametros(tipo) | ||
84 | +{ | ||
85 | + if(tipo == "perfis" || arguments.length == 0 && $i("perfis")) | ||
86 | + { | ||
87 | + var retornaPerfis = function(retorno) | ||
88 | + { | ||
89 | + var r = retorno.data | ||
90 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td></td><td></td></tr>"; | ||
91 | + for (i=0;i<r.length;i++) | ||
92 | + { | ||
93 | + ins += "<tr>" | ||
94 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"perfis\",\""+r[i].id_perfil+"\")'/></td>" | ||
95 | + ins += "<td>" | ||
96 | + ins += "<div class=aplicar title='Aplicar' onclick='alterar(\"perfis\",\""+r[i].id_perfil+"\")'/>" | ||
97 | + ins += "</td>" | ||
98 | + ins += "<td><input onchange=this.style.color='blue' id='nomeperfil_"+r[i].id_perfil+"' type=text size=40 value='"+r[i].perfil+"'/></td>" | ||
99 | + ins += "</tr>" | ||
100 | + } | ||
101 | + ins += "</table>" | ||
102 | + $i("perfis").innerHTML = ins; | ||
103 | + } | ||
104 | + var p = "../php/menutemas.php?funcao=pegaPerfis"; | ||
105 | + cPaint.call(p,"pegaPerfis",retornaPerfis); | ||
106 | + } | ||
107 | + if(tipo == "tags" || arguments.length == 0 && $i("tags")) | ||
108 | + { | ||
109 | + var retornaTags = function(retorno) | ||
110 | + { | ||
111 | + var r = retorno.data | ||
112 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td></td><td></td></tr>"; | ||
113 | + for (i=0;i<r.length;i++) | ||
114 | + { | ||
115 | + ins += "<tr>" | ||
116 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"tags\",\""+r[i].id_tag+"\")'/></td>" | ||
117 | + ins += "<td>" | ||
118 | + ins += "<div class=aplicar title='Aplicar' onclick='alterar(\"tags\",\""+r[i].id_tag+"\")'/>" | ||
119 | + ins += "</td>" | ||
120 | + ins += "<td><input onchange=this.style.color='blue' id='nometag_"+r[i].id_tag+"' type=text size=40 value='"+r[i].nome+"'/></td>" | ||
121 | + ins += "</tr>" | ||
122 | + } | ||
123 | + ins += "</table>" | ||
124 | + $i("tags").innerHTML = ins; | ||
125 | + } | ||
126 | + var p = "../php/menutemas.php?funcao=pegaTags"; | ||
127 | + cPaint.call(p,"pegaTags",retornaTags); | ||
128 | + } | ||
129 | + if(tipo == "menus" || arguments.length == 0 && $i("menus")) | ||
130 | + { | ||
131 | + var retornaMenus = function(retorno) | ||
132 | + { | ||
133 | + var r = retorno.data | ||
134 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Publicado</td><td><b>Nome</td><td><b>Descrição</td><td><b>Aberto</td><td><b>Perfil</td><td></td></tr>"; | ||
135 | + for (i=0;i<r.length;i++) | ||
136 | + { | ||
137 | + ins += "<tr>" | ||
138 | + ins += "<td>id= "+r[i].id_menu+"<div class=excluir title='Excluir' onclick='excluir(\"menus\",\""+r[i].id_menu+"\")'/></td>" | ||
139 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\"menus\",\""+r[i].id_menu+"\")'/></td>" | ||
140 | + ins += "<td><select onchange=this.style.color='blue' id='publicadomenu_"+r[i].id_menu+"' >" | ||
141 | + ins += combosimnao(r[i].publicado_menu) | ||
142 | + ins += "</td>" | ||
143 | + ins += "<td><input onchange=this.style.color='blue' id='nomemenu_"+r[i].id_menu+"' type=text size=40 value='"+r[i].nome_menu+"'/></td>" | ||
144 | + ins += "<td><input onchange=this.style.color='blue' id='descmenu_"+r[i].id_menu+"' type=text size=20 value='"+r[i].desc_menu+"' /></td>" | ||
145 | + ins += "<td><select onchange=this.style.color='blue' id='abertomenu_"+r[i].id_menu+"' >" | ||
146 | + ins += combosimnao(r[i].aberto) | ||
147 | + ins += "</td>" | ||
148 | + ins += "<td><input onchange=this.style.color='blue' id='perfilmenu_"+r[i].id_menu+"' type=text size=20 value='"+r[i].perfil_menu+"' /></td>" | ||
149 | + var idtemp = 'perfilmenu_'+r[i].id_menu | ||
150 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" id='escolhePerfilMenu_"+r[i].id_menu+"' >" | ||
151 | + ins += comboObjeto($perfis,"perfil","perfil","") | ||
152 | + ins += "</select>" | ||
153 | + ins += "</td>" | ||
154 | + ins += "</tr>" | ||
155 | + } | ||
156 | + ins += "</table>" | ||
157 | + $i("menus").innerHTML = ins; | ||
158 | + } | ||
159 | + var p = "../php/menutemas.php?funcao=pegaMenus"; | ||
160 | + cPaint.call(p,"pegaMenus",retornaMenus); | ||
161 | + } | ||
162 | + if(tipo == "grupos" || arguments.length == 0 && $i("grupos")) | ||
163 | + { | ||
164 | + var retornaGrupos = function(retorno) | ||
165 | + { | ||
166 | + var r = retorno.data | ||
167 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td></tr>"; | ||
168 | + for (i=0;i<r.length;i++) | ||
169 | + { | ||
170 | + ins += montaOpcoes("grupo",r[i].id_grupo,r[i].nome_grupo,r[i].desc_grupo) | ||
171 | + } | ||
172 | + | ||
173 | + ins += "</table>" | ||
174 | + $i("grupos").innerHTML = ins; | ||
175 | + } | ||
176 | + var p = "../php/menutemas.php?funcao=pegaGrupos"; | ||
177 | + cPaint.call(p,"pegaGrupos",retornaGrupos); | ||
178 | + } | ||
179 | + if(tipo == "subgrupos" || arguments.length == 0 && $i("subgrupos")) | ||
180 | + { | ||
181 | + var retornaSubGrupos = function(retorno) | ||
182 | + { | ||
183 | + var r = retorno.data | ||
184 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td></tr>"; | ||
185 | + for (i=0;i<r.length;i++) | ||
186 | + { | ||
187 | + ins += montaOpcoes("subgrupo",r[i].id_subgrupo,r[i].nome_subgrupo,r[i].desc_subgrupo) | ||
188 | + } | ||
189 | + ins += "</table>" | ||
190 | + $i("subgrupos").innerHTML = ins; | ||
191 | + } | ||
192 | + var p = "../php/menutemas.php?funcao=pegaSubGrupos"; | ||
193 | + cPaint.call(p,"pegaSubGrupos",retornaSubGrupos); | ||
194 | + } | ||
195 | + if(tipo == "temas" || arguments.length == 0 && $i("temas")) | ||
196 | + { | ||
197 | + var retornaTemas = function(retorno) | ||
198 | + { | ||
199 | + var r = retorno.data | ||
200 | + ins = "" | ||
201 | + for (var j=0;j<r.length;j++) | ||
202 | + { | ||
203 | + ins += "<div id=div_"+r[j].id_tema+" >" | ||
204 | + var temp = montaDivTemas(r[j]) | ||
205 | + ins += temp+"</div>" | ||
206 | + } | ||
207 | + $i("temas").innerHTML = ins; | ||
208 | + ativaLegenda() | ||
209 | + } | ||
210 | + var p = "../php/menutemas.php?funcao=pegaTemas&filtro="+$i("filtro").value; | ||
211 | + cPaint.call(p,"pegaTemas",retornaTemas); | ||
212 | + } | ||
213 | + | ||
214 | + if(tipo == "arvore" || arguments.length == 0 && $i("arvore")) | ||
215 | + { | ||
216 | + var retornaArvore = function(retorno) | ||
217 | + { | ||
218 | + var r = retorno.data | ||
219 | + var ins = "<table class=lista ><tr><td></td><td></td><td><b>Nome</td><td><b>Descrição</td></tr>"; | ||
220 | + for (i=0;i<r.length;i++) | ||
221 | + { | ||
222 | + ins += "<tr>" | ||
223 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"subgrupos\",\""+r[i].id_subgrupo+"\")'/></td>" | ||
224 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\"subgrupos\",\""+r[i].id_subgrupo+"\")'/></td>" | ||
225 | + ins += "<td><input onchange=this.style.color='blue' id='nomesubgrupo_"+r[i].id_subgrupo+"' type=text size=40 value='"+r[i].nome_subgrupo+"'/></td>" | ||
226 | + 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>" | ||
227 | + } | ||
228 | + ins += "</table>" | ||
229 | + $i("subgrupos").innerHTML = ins; | ||
230 | + } | ||
231 | + var p = "../php/menutemas.php?funcao=pegaSubXGrupos"; | ||
232 | + cPaint.call(p,"pegaSubXGrupos",retornaSubXGrupos); | ||
233 | + } | ||
234 | +} | ||
235 | +/* | ||
236 | +Function: montaOpcoes | ||
237 | +*/ | ||
238 | +function montaOpcoes(prefixo,id,nome,desc,opc) | ||
239 | +{ | ||
240 | + var ins = "<tr>" | ||
241 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\""+prefixo+"s\",\""+id+"\")'/></td>" | ||
242 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\""+prefixo+"s\",\""+id+"\")'/></td>" | ||
243 | + ins += "<td><input onchange=this.style.color='blue' id='nome"+prefixo+"_"+id+"' type=text size=40 value='"+nome+"'/></td>" | ||
244 | + ins += "<td><input onchange=this.style.color='blue' id='desc"+prefixo+"_"+id+"' type=text size=20 value='"+desc+"' /></td></tr>" | ||
245 | + return (ins) | ||
246 | +} | ||
247 | +/* | ||
248 | +Function: montaDivTemas | ||
249 | + | ||
250 | +Preenche a div com os dados de um tema específico na edição da lista de temas | ||
251 | + | ||
252 | +Parameters: | ||
253 | + | ||
254 | +i - objeto json com os dados para montar o formulário | ||
255 | +*/ | ||
256 | +function montaDivTemas(i) | ||
257 | +{ | ||
258 | + var ins = "<br><fieldset><legend>+- "+i.nome_tema+"</legend>" | ||
259 | + ins += "<div style=display:none > <table class=lista ><tr><td></td></tr>"; | ||
260 | + var param = { | ||
261 | + "linhas":[ | ||
262 | + {titulo:"Nome do tema",prefixoid:"nometema_",id:"id_tema",valor:"nome_tema"}, | ||
263 | + {titulo:"Descrição",prefixoid:"desctema_",id:"id_tema",valor:"desc_tema"}, | ||
264 | + {titulo:"Link para a fonte",prefixoid:"linktema_",id:"id_tema",valor:"link_tema"} | ||
265 | + ] | ||
266 | + } | ||
267 | + ins += (geraLinhas(i,param,2)); | ||
268 | + | ||
269 | + ins += "<tr><td>Tags (separe com espaço):</td><td>" | ||
270 | + ins += "<input type=text size=40 value='"+i.tags_tema+"' id='tagstema_"+i.id_tema+"' >" | ||
271 | + ins += "<select onchange='registraTag(\"tagstema_"+i.id_tema+"\",this.value)'>" | ||
272 | + ins += comboObjeto($listaTags,"nome","nome","") | ||
273 | + ins += "</select></td></tr>" | ||
274 | + | ||
275 | + ins += "<tr><td>Tipo:</td><td>" | ||
276 | + ins += "<select id='tipoatema_"+i.id_tema+"' />" | ||
277 | + ins += "<option value='' " | ||
278 | + if (i.tipoa_tema == ""){ins += "selected";} | ||
279 | + ins += ">---</option>" | ||
280 | + ins += "<option value='WMS' " | ||
281 | + if (i.tipoa_tema == "WMS"){ins += "selected";} | ||
282 | + ins += " >WMS<option>" | ||
283 | + | ||
284 | + ins += "<tr><td>Mapfile:</td><td>" | ||
285 | + ins += "<select id='codigotema_"+i.id_tema+"' >" | ||
286 | + ins += combolista($listaDeMapfiles,i.codigo_tema) | ||
287 | + ins += "</select></td></tr>" | ||
288 | + | ||
289 | + ins += "<tr><td>Permite acesso via WMS/WFS?</td><td>" | ||
290 | + ins += "<select id='ogctema_"+i.id_tema+"' >" | ||
291 | + ins += combosimnao(i.ogc_tema) | ||
292 | + ins += "</select></td></tr>" | ||
293 | + | ||
294 | + ins += "<tr><td>Permite o download na aplicação datadownload.htm?</td><td>" | ||
295 | + ins += "<select id='downloadtema_"+i.id_tema+"' >" | ||
296 | + ins += combosimnao(i.download_tema) | ||
297 | + ins += "</select></td></tr>" | ||
298 | + | ||
299 | + ins += "<tr><td>Permite acesso via kml?</td><td>" | ||
300 | + ins += "<select id='kmltema_"+i.id_tema+"' >" | ||
301 | + ins += combosimnao(i.kml_tema) | ||
302 | + ins += "</select></td></tr>" | ||
303 | + | ||
304 | + ins += "</table>" | ||
305 | + ins += "<table><tr>"; | ||
306 | + ins += "<td><div class=excluir title='Excluir' onclick='excluir(\"temas\",\""+i.id_tema+"\")'/></td>" | ||
307 | + ins += "<td><div class=aplicar title='Aplicar' onclick='alterar(\"temas\",\""+i.id_tema+"\")'/></td></table>" | ||
308 | + | ||
309 | + ins += "</div></fieldset>" | ||
310 | + return(ins) | ||
311 | +} | ||
312 | +function registraTag(id,tag) | ||
313 | +{ | ||
314 | + var tags = $i(id).value | ||
315 | + if(tag == "") | ||
316 | + $i(id).value = tag | ||
317 | + else | ||
318 | + $i(id).value = $i(id).value+" "+tag | ||
319 | +} | ||
320 | + | ||
321 | +/* | ||
322 | +Function: alterar | ||
323 | + | ||
324 | +Altera o valor de uma variável | ||
325 | +*/ | ||
326 | +function alterar(prefixo,id) | ||
327 | +{ | ||
328 | + //if(confirm("Você realmente quer fazer isso?")) | ||
329 | + //{ | ||
330 | + var retorna = function() | ||
331 | + {pegaParametros(prefixo);} | ||
332 | + if(prefixo == "perfis") | ||
333 | + { | ||
334 | + if (id != "") | ||
335 | + { | ||
336 | + var nome = $i("nomeperfil_"+id).value | ||
337 | + } | ||
338 | + else | ||
339 | + { | ||
340 | + var nome = ""; | ||
341 | + } | ||
342 | + $i(prefixo).innerHTML =$mensagemAguarde | ||
343 | + var p = "../php/menutemas.php?funcao=alteraPerfis&perfil="+nome+"&id="+id; | ||
344 | + } | ||
345 | + if(prefixo == "tags") | ||
346 | + { | ||
347 | + if (id != "") | ||
348 | + { | ||
349 | + var nome = $i("nometag_"+id).value | ||
350 | + } | ||
351 | + else | ||
352 | + { | ||
353 | + var nome = ""; | ||
354 | + } | ||
355 | + $i(prefixo).innerHTML =$mensagemAguarde | ||
356 | + var p = "../php/menutemas.php?funcao=alteraTags&nome="+nome+"&id="+id; | ||
357 | + //window.open(p) | ||
358 | + } | ||
359 | + if(prefixo == "menus") | ||
360 | + { | ||
361 | + if (id != "") | ||
362 | + { | ||
363 | + var nome = $i("nomemenu_"+id).value | ||
364 | + var desc = $i("descmenu_"+id).value | ||
365 | + var aberto = $i("abertomenu_"+id).value | ||
366 | + var perfil = $i("perfilmenu_"+id).value | ||
367 | + var publicado_menu = $i("publicadomenu_"+id).value | ||
368 | + if(nome == "null"){var nome = "";} | ||
369 | + if(desc == "null"){var desc = "";} | ||
370 | + if(aberto == "null"){var aberto = "";} | ||
371 | + if(perfil == "null"){var perfil = "";} | ||
372 | + } | ||
373 | + else | ||
374 | + { | ||
375 | + var nome = ""; | ||
376 | + var desc = ""; | ||
377 | + var aberto = ""; | ||
378 | + var perfil = ""; | ||
379 | + var publicado_menu = ""; | ||
380 | + } | ||
381 | + $i(prefixo).innerHTML =$mensagemAguarde | ||
382 | + var p = "../php/menutemas.php?funcao=alteraMenus&publicado_menu="+publicado_menu+"&perfil="+perfil+"&nome="+nome+"&desc="+desc+"&id="+id+"&aberto="+aberto; | ||
383 | + } | ||
384 | + if(prefixo == "grupos") | ||
385 | + { | ||
386 | + if (id != "") | ||
387 | + { | ||
388 | + var nome = $i("nomegrupo_"+id).value | ||
389 | + var desc = $i("descgrupo_"+id).value | ||
390 | + if(nome == "null"){var nome = "";} | ||
391 | + if(desc == "null"){var desc = "";} | ||
392 | + } | ||
393 | + else | ||
394 | + { | ||
395 | + var nome = ""; | ||
396 | + var desc = ""; | ||
397 | + } | ||
398 | + $i(prefixo).innerHTML =$mensagemAguarde | ||
399 | + var p = "../php/menutemas.php?funcao=alteraGrupos&nome="+nome+"&desc="+desc+"&id="+id; | ||
400 | + } | ||
401 | + if(prefixo == "subgrupos") | ||
402 | + { | ||
403 | + if (id != "") | ||
404 | + { | ||
405 | + var nome = $i("nomesubgrupo_"+id).value | ||
406 | + var desc = $i("descsubgrupo_"+id).value | ||
407 | + if(nome == "null"){var nome = "";} | ||
408 | + if(desc == "null"){var desc = "";} | ||
409 | + } | ||
410 | + else | ||
411 | + { | ||
412 | + var nome = ""; | ||
413 | + var desc = ""; | ||
414 | + } | ||
415 | + $i(prefixo).innerHTML =$mensagemAguarde | ||
416 | + var p = "../php/menutemas.php?funcao=alteraSubGrupos&nome="+nome+"&desc="+desc+"&id="+id; | ||
417 | + } | ||
418 | + if(prefixo == "temas") | ||
419 | + { | ||
420 | + if (id != "") | ||
421 | + { | ||
422 | + var nome = $i("nometema_"+id).value | ||
423 | + var codigo = $i("codigotema_"+id).value | ||
424 | + var desc = $i("desctema_"+id).value | ||
425 | + var tipoa = $i("tipoatema_"+id).value | ||
426 | + var link = $i("linktema_"+id).value | ||
427 | + var ogc = $i("ogctema_"+id).value | ||
428 | + var kml = $i("kmltema_"+id).value | ||
429 | + var download = $i("downloadtema_"+id).value | ||
430 | + var tags = $i("tagstema_"+id).value | ||
431 | + if(nome == "null"){var nome = "";} | ||
432 | + if(codigo == "null"){var codigo = "";} | ||
433 | + if(desc == "null"){var desc = "";} | ||
434 | + if(tipoa == "null"){var tipoa = "";} | ||
435 | + if(link == "null"){var link = "";} | ||
436 | + if(ogc == "null"){var ogc = "";} | ||
437 | + if(kml == "null"){var kml = "";} | ||
438 | + if(download == "null"){var download = "";} | ||
439 | + if(tags == "null"){var tags = "";} | ||
440 | + } | ||
441 | + else | ||
442 | + { | ||
443 | + var nome = ""; | ||
444 | + var codigo = ""; | ||
445 | + var desc = ""; | ||
446 | + var link = ""; | ||
447 | + var tipoa = ""; | ||
448 | + var ogc = ""; | ||
449 | + var kml = ""; | ||
450 | + var download = ""; | ||
451 | + var tags = ""; | ||
452 | + } | ||
453 | + $i(prefixo).innerHTML =$mensagemAguarde | ||
454 | + 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; | ||
455 | + } | ||
456 | + | ||
457 | + cPaint.call(p,"",retorna); | ||
458 | + //} | ||
459 | +} | ||
460 | +/* | ||
461 | +Function: excluir | ||
462 | + | ||
463 | +Exclui um registro | ||
464 | +*/ | ||
465 | +function excluir(prefixo,id) | ||
466 | +{ | ||
467 | + if(confirm("Você realmente quer fazer isso?")) | ||
468 | + { | ||
469 | + var retorna = function() | ||
470 | + {pegaParametros(prefixo);} | ||
471 | + $i(prefixo).innerHTML = $mensagemAguarde | ||
472 | + var p = "../php/menutemas.php?funcao=excluirRegistro&id="+id+"&tabela="+prefixo; | ||
473 | + cPaint.call(p,"",retorna); | ||
474 | + } | ||
475 | +} | ||
476 | + | ||
477 | +/* | ||
478 | +Function: pegaMapfiles | ||
479 | + | ||
480 | +Pega a lista de mapfiles existentes no i3geo | ||
481 | + | ||
482 | +Parameters: | ||
483 | + | ||
484 | +retorna - nome da função que processará o resultado | ||
485 | +*/ | ||
486 | +function pegaMapfiles(retorna) | ||
487 | +{ | ||
488 | + var cPaint = new cpaint(); | ||
489 | + //cPaint.set_async("true"); | ||
490 | + cPaint.set_response_type("JSON"); | ||
491 | + var p = "../php/menutemas.php?funcao=listaMapsTemas"; | ||
492 | + cPaint.call(p,"listaMapsTemas",retorna); | ||
493 | +} |
@@ -0,0 +1,237 @@ | @@ -0,0 +1,237 @@ | ||
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><td></td></tr>"; | ||
67 | + var param = { | ||
68 | + "linhas":[ | ||
69 | + {titulo:"Nome",prefixoid:"nome_",id:"id_sistema",valor:"nome_sistema"}, | ||
70 | + ] | ||
71 | + } | ||
72 | + ins += (geraLinhas(d[i],param,3)); | ||
73 | + ins += "<tr>" | ||
74 | + ins += "<td>Perfis: </td>" | ||
75 | + ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='perfil_"+d[i].id_sistema+"' value='"+d[i].perfil_sistema+"' /></td>" | ||
76 | + | ||
77 | + var idtemp = "perfil_"+d[i].id_sistema | ||
78 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | ||
79 | + ins += comboObjeto($perfis,"perfil","perfil","") | ||
80 | + ins += "</select></td></tr>" | ||
81 | + | ||
82 | + ins += "<tr>" | ||
83 | + ins += "<td>Publicado: </td>" | ||
84 | + ins += "<td><select onchange=this.style.color='blue' id='publicado_"+d[i].id_sistema+"' >" | ||
85 | + ins += combosimnao(d[i].publicado_sistema) | ||
86 | + ins += "</td><td></td></tr>" | ||
87 | + | ||
88 | + ins += "</table>" | ||
89 | + | ||
90 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluir(\""+d[i].id_sistema+"\")'/></td>" | ||
91 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarSistemas(\""+d[i].id_sistema+"\",\""+d[i].id_sistema+"\")'/></td>" | ||
92 | + ins += "<td></td></tr></table>" | ||
93 | + | ||
94 | + | ||
95 | + | ||
96 | + ins += "<fieldset><legend>+- Funções</legend>" | ||
97 | + 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>" | ||
98 | + var nf = d[i].funcoes.length | ||
99 | + for (j=0;j<nf;j++) | ||
100 | + { | ||
101 | + ins += "<fieldset><legend>+- "+d[i].funcoes[j].nome_funcao+"</legend>" | ||
102 | + var func = d[i].funcoes[j] | ||
103 | + ins += "<div style=display:none ><table class=lista ><tr><td></td><td></td><td></td></tr>"; | ||
104 | + var param = { | ||
105 | + "linhas":[ | ||
106 | + {titulo:"Nome da função",prefixoid:"nomefuncao_",id:"id_funcao",valor:"nome_funcao"}, | ||
107 | + {titulo:"Abrir programa",prefixoid:"abrir_",id:"id_funcao",valor:"abrir_funcao"}, | ||
108 | + {titulo:"Largura da janela",prefixoid:"w_",id:"id_funcao",valor:"w_funcao"}, | ||
109 | + {titulo:"Altura",prefixoid:"h_",id:"id_funcao",valor:"h_funcao"} | ||
110 | + ] | ||
111 | + } | ||
112 | + ins += (geraLinhas(func,param,3)); | ||
113 | + | ||
114 | + ins += "<tr>" | ||
115 | + ins += "<td>Perfis: </td>" | ||
116 | + ins += "<td><input size=30 onchange='this.style.color=\"blue\"' type=text id='perfilfuncao_"+d[i].funcoes[j].id_funcao+"' value='"+d[i].funcoes[j].perfil_funcao+"' /></td>" | ||
117 | + var idtemp = "perfilfuncao_"+d[i].funcoes[j].id_funcao | ||
118 | + ins += "<td><select onchange=\"registraPerfil('"+idtemp+"',this.value);this.style.color='blue'\" >" | ||
119 | + ins += comboObjeto($perfis,"perfil","perfil","") | ||
120 | + ins += "</select></td></tr>" | ||
121 | + | ||
122 | + | ||
123 | + ins += "</table>" | ||
124 | + ins += "<table><tr><td><div class=excluir title='Excluir' onclick='excluirFuncoes(\""+d[i].funcoes[j].id_funcao+"\")'/></td>" | ||
125 | + ins += "<td><div class=aplicar title='Aplicar alterações' onclick='alterarFuncoes(\""+d[i].funcoes[j].id_funcao+"\",\""+d[i].id_sistema+"\")'/></td>" | ||
126 | + ins += "</tr></table>" | ||
127 | + ins += "</div></fieldset><br>" | ||
128 | + ins += "</div></fieldset>" | ||
129 | + } | ||
130 | + ins += "</div></fieldset>" | ||
131 | + ins += "</fieldset><br>" | ||
132 | + if(!$i(d[i].id_sistema)) | ||
133 | + ins += "</div>" | ||
134 | + } | ||
135 | + $i(onde).innerHTML = ins | ||
136 | + ativaLegenda() | ||
137 | +} | ||
138 | +function alterarFuncoes(id_funcao,id_sistema) | ||
139 | +{ | ||
140 | + //if(confirm("Você realmente quer fazer isso?")) | ||
141 | + //{ | ||
142 | + var retorna = function(retorno) | ||
143 | + { | ||
144 | + if(id_funcao == "") | ||
145 | + listaSistemas(retorno); | ||
146 | + else | ||
147 | + {ins = "";montaSistemas(retorno,id_sistema)} | ||
148 | + } | ||
149 | + if (id_funcao != "") | ||
150 | + { | ||
151 | + var nomefuncao = $i("nomefuncao_"+id_funcao).value | ||
152 | + var perfil = $i("perfilfuncao_"+id_funcao).value | ||
153 | + var abrir = $i("abrir_"+id_funcao).value | ||
154 | + var w = $i("w_"+id_funcao).value | ||
155 | + var h = $i("h_"+id_funcao).value | ||
156 | + } | ||
157 | + else | ||
158 | + { | ||
159 | + //var id_sistema = ""; | ||
160 | + var id_funcao = "" | ||
161 | + var nomefuncao = "" | ||
162 | + var perfil = "" | ||
163 | + var abrir = "" | ||
164 | + var w = 200 | ||
165 | + var h = 200 | ||
166 | + } | ||
167 | + 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 | ||
168 | + cPaint.call(p,"",retorna); | ||
169 | + //} | ||
170 | +} | ||
171 | +function alterarSistemas(id_sistema,onde) | ||
172 | +{ | ||
173 | + //if(confirm("Você realmente quer fazer isso?")) | ||
174 | + //{ | ||
175 | + var retorna = function(retorno) | ||
176 | + { | ||
177 | + if(id_sistema == "") | ||
178 | + listaSistemas(retorno); | ||
179 | + else | ||
180 | + {ins = "";montaSistemas(retorno,onde)} | ||
181 | + } | ||
182 | + if (id_sistema != "") | ||
183 | + { | ||
184 | + var nome = $i("nome_"+id_sistema).value; | ||
185 | + var perfil = $i("perfil_"+id_sistema).value; | ||
186 | + var publicado = $i("publicado_"+id_sistema).value; | ||
187 | + } | ||
188 | + else | ||
189 | + { | ||
190 | + var id_sistema = ""; | ||
191 | + var nome = ""; | ||
192 | + var perfil = ""; | ||
193 | + var publicado = ""; | ||
194 | + } | ||
195 | + var p = "../php/sistemas.php?funcao=alterarSistemas&publicado_sistema="+publicado+"&id_sistema="+id_sistema+"&nome="+nome+"&perfil="+perfil | ||
196 | + cPaint.call(p,"",retorna); | ||
197 | + //} | ||
198 | +} | ||
199 | +function excluir(id) | ||
200 | +{ | ||
201 | + if(confirm("Você realmente quer fazer isso?")) | ||
202 | + { | ||
203 | + var retorna = function(retorno) | ||
204 | + { | ||
205 | + if(retorno.data=="erro") | ||
206 | + {alert("Não foi possivel excluir. Exclua as funcoes primeiro");} | ||
207 | + else | ||
208 | + { | ||
209 | + $i("resultado").innerHTML = $mensagemAguarde; | ||
210 | + montaParametros() | ||
211 | + } | ||
212 | + } | ||
213 | + var p = "../php/sistemas.php?funcao=excluir&id="+id; | ||
214 | + cPaint.call(p,"",retorna); | ||
215 | + } | ||
216 | +} | ||
217 | +function excluirFuncoes(id) | ||
218 | +{ | ||
219 | + if(confirm("Você realmente quer fazer isso?")) | ||
220 | + { | ||
221 | + $i("resultado").innerHTML = $mensagemAguarde; | ||
222 | + var retorna = function() | ||
223 | + { | ||
224 | + montaParametros() | ||
225 | + } | ||
226 | + var p = "../php/sistemas.php?funcao=excluirFuncoes&id="+id; | ||
227 | + cPaint.call(p,"",retorna); | ||
228 | + } | ||
229 | +} | ||
230 | +function importarXmlSistemas() | ||
231 | +{ | ||
232 | + $i("resultado").innerHTML = $mensagemAguarde | ||
233 | + var retorna = function(retorno) | ||
234 | + {$i("resultado").innerHTML = retorno.data} | ||
235 | + var p = "../php/sistemas.php?funcao=importarXmlSistemas&xml="+$i("arquivo").value; | ||
236 | + cPaint.call(p,"",retorna); | ||
237 | +} | ||
0 | \ No newline at end of file | 238 | \ No newline at end of file |
@@ -0,0 +1,791 @@ | @@ -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 | \ No newline at end of file | 792 | \ No newline at end of file |
@@ -0,0 +1,244 @@ | @@ -0,0 +1,244 @@ | ||
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 | +$i = function(i) | ||
30 | +{return document.getElementById(i);}; | ||
31 | + | ||
32 | +YAHOO.namespace("example.container"); | ||
33 | + | ||
34 | +function pegaClasses(codigoMap,codigoLayer) | ||
35 | +{ | ||
36 | + var ins = "<br><fieldset style='background-color:beige'><legend>+- Classes</legend><div style=display:none >" | ||
37 | + ins += "<p><input onclick=adicionarClasse('"+codigoLayer+"',this) type=button value='Adicionar classe' /></p>" | ||
38 | + ins += "<br><fieldset><legend>+- Legenda (amostra)</legend><div style=display:none >" | ||
39 | + ins += "<img id='legenda_"+codigoLayer+"' src='../ogc.php?tema=bioma&service=wms&request=getlegendgraphic&layer="+codigoLayer+"&format=image/png' />" | ||
40 | + ins += "</div></fieldset>" | ||
41 | + var retorna = function(retorna) | ||
42 | + { | ||
43 | + var nc = retorna.data.length | ||
44 | + for(c=0;c<nc;c++) | ||
45 | + { | ||
46 | + d = retorna.data[c] | ||
47 | + | ||
48 | + ins += (geraLinhas2(d.dados,param,"salvarClasse")); | ||
49 | + | ||
50 | + var param = { | ||
51 | + "linhas":[ | ||
52 | + ] | ||
53 | + } | ||
54 | + | ||
55 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | ||
56 | + ins += (geraLinhas2(d.dados,param,"salvarClasse")); | ||
57 | + ins += "</fieldset>" | ||
58 | + //labels | ||
59 | + ins += "<br><fieldset><legend style=color:brown >+- Label (para ativar, defina LABELITEM em caract. gerais)</legend><div style=display:none >" | ||
60 | + var param = { | ||
61 | + "linhas":[ | ||
62 | + ] | ||
63 | + } | ||
64 | + | ||
65 | + | ||
66 | + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | ||
67 | + var param = { | ||
68 | + "linhas":[ | ||
69 | + ] | ||
70 | + } | ||
71 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | ||
72 | + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | ||
73 | + ins += "</fieldset>" | ||
74 | + | ||
75 | + ins += "</div></fieldset>" | ||
76 | + | ||
77 | + ins += "<br><fieldset><legend style=color:brown >+- Estilos</legend><div style=display:none >" | ||
78 | + ins += "<p><input onclick=adicionarEstilo('"+codigoLayer+"','"+d.id+"',this) type=button value='Adicionar estilo' /></p>" | ||
79 | + ins += "<div id='estilos_"+codigoLayer+"_"+d.id+"' ></div>" | ||
80 | + ins += "</div></fieldset>" | ||
81 | + ins += "</div></fieldset>" | ||
82 | + } | ||
83 | + ins += "</div></fieldset>" | ||
84 | + $i("classes_"+codigoLayer+"_"+codigoMap).innerHTML = ins | ||
85 | + pegaEstilos(codigoMap,codigoLayer) | ||
86 | + } | ||
87 | + var p = "../php/temas.php?funcao=pegaClasses&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
88 | + cPaint.call(p,"",retorna); | ||
89 | + | ||
90 | +} | ||
91 | +function pegaEstilos(codigoMap,codigoLayer) | ||
92 | +{ | ||
93 | + | ||
94 | + } | ||
95 | + var p = "../php/temas.php?funcao=pegaEstilos&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
96 | + cPaint.call(p,"",retorna); | ||
97 | +} | ||
98 | + | ||
99 | +function testarMap() | ||
100 | +{ | ||
101 | + var codigo = $i("temaAtivo").value | ||
102 | + window.open("../testamapfile.php?map="+codigo+".map") | ||
103 | +} | ||
104 | +function salvarLayer(layer,parametro,icone) | ||
105 | +{ | ||
106 | + icone.src="../imagens/aguarde.gif" | ||
107 | + var retorna = function(retorno) | ||
108 | + {icone.src="../imagens/02.png";} | ||
109 | + var valor = $i(parametro+"_"+layer).value | ||
110 | + $i(parametro+"_"+layer).style.color="black" | ||
111 | + var p = "../php/temas.php?funcao=alteraLayer&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | ||
112 | + cPaint.call(p,"",retorna); | ||
113 | +} | ||
114 | +function salvarMetadados(layer,parametro,icone) | ||
115 | +{ | ||
116 | + icone.src="../imagens/aguarde.gif" | ||
117 | + var retorna = function(retorno) | ||
118 | + {icone.src="../imagens/02.png";} | ||
119 | + var valor = $i(parametro+"_"+layer).value | ||
120 | + $i(parametro+"_"+layer).style.color="black" | ||
121 | + var p = "../php/temas.php?funcao=alteraMetadados&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | ||
122 | + cPaint.call(p,"",retorna); | ||
123 | +} | ||
124 | +function salvarClasse(layer,parametro,icone) | ||
125 | +{ | ||
126 | + icone.src="../imagens/aguarde.gif" | ||
127 | + var temp = layer.split("_") | ||
128 | + var layer = temp[0] | ||
129 | + var classe = temp[1] | ||
130 | + var retorna = function(retorno) | ||
131 | + { | ||
132 | + icone.src="../imagens/02.png"; | ||
133 | + contaN++ | ||
134 | + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | ||
135 | + } | ||
136 | + var valor = $i(parametro+"_"+layer+"_"+classe).value | ||
137 | + $i(parametro+"_"+layer+"_"+classe).style.color="black" | ||
138 | + var p = "../php/temas.php?funcao=alteraClasse&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | ||
139 | + cPaint.call(p,"",retorna); | ||
140 | +} | ||
141 | +function salvarClasseLabel(layer,parametro,icone) | ||
142 | +{ | ||
143 | + icone.src="../imagens/aguarde.gif" | ||
144 | + var temp = layer.split("_") | ||
145 | + var layer = temp[0] | ||
146 | + var classe = temp[1] | ||
147 | + var parametro = parametro.split("."); | ||
148 | + var parametro = parametro[1] | ||
149 | + var retorna = function(retorno) | ||
150 | + {icone.src="../imagens/02.png";} | ||
151 | + var valor = $i("label_"+parametro+"_"+layer+"_"+classe).value | ||
152 | + $i("label_"+parametro+"_"+layer+"_"+classe).style.color="black" | ||
153 | + var p = "../php/temas.php?funcao=alteraClasseLabel&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | ||
154 | + cPaint.call(p,"",retorna); | ||
155 | +} | ||
156 | +function salvarEstilo(estilo,parametro,icone) | ||
157 | +{ | ||
158 | + icone.src="../imagens/aguarde.gif" | ||
159 | + var temp = estilo.split("_") | ||
160 | + var layer = temp[1] | ||
161 | + var classe = temp[2] | ||
162 | + var estilo = temp[3] | ||
163 | + var retorna = function(retorno) | ||
164 | + { | ||
165 | + icone.src="../imagens/02.png"; | ||
166 | + contaN++ | ||
167 | + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | ||
168 | + } | ||
169 | + var valor = $i(parametro+"_"+layer+"_"+classe+"_"+estilo).value | ||
170 | + $i(parametro+"_"+layer+"_"+classe+"_"+estilo).style.color="black" | ||
171 | + var p = "../php/temas.php?funcao=alteraEstilo&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"&estilo="+estilo+"¶metro="+parametro+"&valor="+valor; | ||
172 | + cPaint.call(p,"",retorna); | ||
173 | +} | ||
174 | +function adicionarClasse(codigoLayer,botao) | ||
175 | +{ | ||
176 | + botao.style.color="red" | ||
177 | + var o = botao.value | ||
178 | + botao.value = "Aguarde..." | ||
179 | + var codigoMap = $i("temaAtivo").value | ||
180 | + if(codigoMap != "") | ||
181 | + { | ||
182 | + var retorna = function(retorno) | ||
183 | + { | ||
184 | + pegaClasses(codigoMap,codigoLayer) | ||
185 | + } | ||
186 | + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
187 | + cPaint.call(p,"",retorna); | ||
188 | + } | ||
189 | +} | ||
190 | +function adicionarEstilo(codigoLayer,codigoClasse,botao) | ||
191 | +{ | ||
192 | + botao.style.color="red" | ||
193 | + var o = botao.value | ||
194 | + botao.value = "Aguarde..." | ||
195 | + var codigoMap = $i("temaAtivo").value | ||
196 | + if(codigoMap != "") | ||
197 | + { | ||
198 | + var retorna = function(retorno) | ||
199 | + { | ||
200 | + pegaEstilos(codigoMap,codigoLayer) | ||
201 | + } | ||
202 | + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | ||
203 | + cPaint.call(p,"",retorna); | ||
204 | + } | ||
205 | +} | ||
206 | +function excluirClasse(codigoLayer,codigoClasse,botao) | ||
207 | +{ | ||
208 | + if(confirm("Você realmente quer fazer isso?")) | ||
209 | + { | ||
210 | + botao.style.color="red" | ||
211 | + var o = botao.value | ||
212 | + botao.value = "Aguarde..." | ||
213 | + var codigoMap = $i("temaAtivo").value | ||
214 | + if(codigoMap != "") | ||
215 | + { | ||
216 | + var retorna = function(retorno) | ||
217 | + { | ||
218 | + pegaClasses(codigoMap,codigoLayer) | ||
219 | + } | ||
220 | + var p = "../php/temas.php?funcao=excluirClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | ||
221 | + cPaint.call(p,"",retorna); | ||
222 | + } | ||
223 | + } | ||
224 | +} | ||
225 | +function excluirLayer(codigoLayer,botao) | ||
226 | +{ | ||
227 | + if(confirm("Você realmente quer fazer isso?")) | ||
228 | + { | ||
229 | + botao.style.color="red" | ||
230 | + var o = botao.value | ||
231 | + botao.value = "Aguarde..." | ||
232 | + var codigoMap = $i("temaAtivo").value | ||
233 | + if(codigoMap != "") | ||
234 | + { | ||
235 | + var retorna = function(retorno) | ||
236 | + { | ||
237 | + ativaTema(codigoMap) | ||
238 | + } | ||
239 | + var p = "../php/temas.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | ||
240 | + cPaint.call(p,"",retorna); | ||
241 | + } | ||
242 | + } | ||
243 | +} | ||
244 | +YAHOO.util.Event.addListener(window, "load", initMenu); | ||
0 | \ No newline at end of file | 245 | \ No newline at end of file |
admin/php/admin.php
@@ -84,25 +84,32 @@ function retornaJSON($obj) | @@ -84,25 +84,32 @@ function retornaJSON($obj) | ||
84 | // | 84 | // |
85 | //para os casos em que json não está habilitado | 85 | //para os casos em que json não está habilitado |
86 | // | 86 | // |
87 | - if (!function_exists("json_encode")) | ||
88 | - { | 87 | + //if (!function_exists("json_encode")) |
88 | + //{ | ||
89 | include_once($locaplic."/pacotes/cpaint/JSON/json2.php"); | 89 | include_once($locaplic."/pacotes/cpaint/JSON/json2.php"); |
90 | + error_reporting(0); | ||
90 | $j = new Services_JSON(); | 91 | $j = new Services_JSON(); |
91 | $texto = $j->encode($obj); | 92 | $texto = $j->encode($obj); |
92 | if (!mb_detect_encoding($texto,"UTF-8",true)) | 93 | if (!mb_detect_encoding($texto,"UTF-8",true)) |
93 | $texto = utf8_encode($texto); | 94 | $texto = utf8_encode($texto); |
94 | header("Content-type: text/ascii; charset=UTF-8"); | 95 | header("Content-type: text/ascii; charset=UTF-8"); |
95 | echo $texto; | 96 | echo $texto; |
97 | + /* | ||
96 | } | 98 | } |
97 | else | 99 | else |
98 | { | 100 | { |
99 | if(extension_loaded('zlib')){ob_start('ob_gzhandler');} | 101 | if(extension_loaded('zlib')){ob_start('ob_gzhandler');} |
100 | $texto = json_encode($obj); | 102 | $texto = json_encode($obj); |
101 | - if (!mb_detect_encoding($texto,"UTF-8",true)) | ||
102 | - $texto = utf8_encode($texto); | 103 | + if (mb_detect_encoding($texto,"UTF-8",false)!="UTF-8") |
104 | + { | ||
105 | + $texto = utf8_encode($texto); | ||
106 | + } | ||
107 | + //header("Content-type: application/ascii"); | ||
108 | + //header("Content-type: text/ascii; charset=UTF-8"); | ||
103 | echo $texto; | 109 | echo $texto; |
104 | if(extension_loaded('zlib')){ob_end_flush();} | 110 | if(extension_loaded('zlib')){ob_end_flush();} |
105 | } | 111 | } |
112 | + */ | ||
106 | exit; | 113 | exit; |
107 | } | 114 | } |
108 | function verificaDuplicados($sql,$dbh) | 115 | function verificaDuplicados($sql,$dbh) |
admin/php/conexaomma.php
1 | <?php | 1 | <?php |
2 | -$dbh = new PDO('pgsql:dbname=geodados;user=geodados;password=geodados;host=dsvmapas.mma.gov.br'); | ||
3 | -$dbhw = new PDO('pgsql:dbname=geodados;user=pgsql;password=pgsql;host=dsvmapas.mma.gov.br'); | 2 | +try |
3 | +{ | ||
4 | + $dbh = new PDO('pgsql:dbname=geodados;user=geodados;password=geodados;host=dsvmapas.mma.gov.br'); | ||
5 | + $dbhw = new PDO('pgsql:dbname=geodados;user=pgsql;password=pgsql;host=dsvmapas.mma.gov.br'); | ||
6 | +} | ||
7 | +catch (PDOException $e) | ||
8 | +{ | ||
9 | + print "Erro ao criar o objeto PDO!: " . $e->getMessage() . "<br/> Talvez exista alguma incompatibilidade entre o PHP e o banco admin.db. Vc pode apagar o arquivo menutemas/admin.db e recria-lo com admin/php/criasqlite.php"; | ||
10 | + die(); | ||
11 | +} | ||
4 | $convUTF = false; | 12 | $convUTF = false; |
5 | ?> | 13 | ?> |
6 | \ No newline at end of file | 14 | \ No newline at end of file |
admin/php/criabanco.php
1 | <?php | 1 | <?php |
2 | $funcao = ""; | 2 | $funcao = ""; |
3 | include_once("admin.php"); | 3 | include_once("admin.php"); |
4 | +error_reporting(E_ALL); | ||
4 | verificaEditores($editores); | 5 | verificaEditores($editores); |
5 | $tabelas = array( | 6 | $tabelas = array( |
6 | "CREATE TABLE i3geoadmin_grupos (desc_grupo TEXT, id_grupo INTEGER PRIMARY KEY, nome_grupo TEXT)", | 7 | "CREATE TABLE i3geoadmin_grupos (desc_grupo TEXT, id_grupo INTEGER PRIMARY KEY, nome_grupo TEXT)", |
7 | "CREATE TABLE i3geoadmin_sistemasf (abrir_funcao TEXT, h_funcao NUMERIC, id_funcao INTEGER PRIMARY KEY, id_sistema NUMERIC, nome_funcao TEXT, perfil_funcao TEXT, w_funcao NUMERIC)", | 8 | "CREATE TABLE i3geoadmin_sistemasf (abrir_funcao TEXT, h_funcao NUMERIC, id_funcao INTEGER PRIMARY KEY, id_sistema NUMERIC, nome_funcao TEXT, perfil_funcao TEXT, w_funcao NUMERIC)", |
8 | "CREATE TABLE i3geoadmin_subgrupos (desc_subgrupo TEXT, id_subgrupo INTEGER PRIMARY KEY, nome_subgrupo TEXT)", | 9 | "CREATE TABLE i3geoadmin_subgrupos (desc_subgrupo TEXT, id_subgrupo INTEGER PRIMARY KEY, nome_subgrupo TEXT)", |
9 | -"CREATE TABLE i3geoadmin_temas (id_tema INTEGER PRIMARY KEY, kml_tema , ogc_tema , download_tema , tags_tema , tipoa_tema , link_tema , desc_tema , nome_tema , codigo_tema )", | 10 | +"CREATE TABLE i3geoadmin_temas (id_tema INTEGER PRIMARY KEY, kml_tema TEXT, ogc_tema TEXT, download_tema TEXT, tags_tema TEXT, tipoa_tema TEXT, link_tema TEXT, desc_tema TEXT, nome_tema TEXT, codigo_tema TEXT)", |
10 | "CREATE TABLE i3geoadmin_ws (autor_ws TEXT, desc_ws TEXT, id_ws INTEGER PRIMARY KEY, link_ws TEXT, nome_ws TEXT, tipo_ws TEXT)", | 11 | "CREATE TABLE i3geoadmin_ws (autor_ws TEXT, desc_ws TEXT, id_ws INTEGER PRIMARY KEY, link_ws TEXT, nome_ws TEXT, tipo_ws TEXT)", |
11 | "CREATE TABLE i3geoadmin_tags (id_tag INTEGER PRIMARY KEY, nome TEXT)", | 12 | "CREATE TABLE i3geoadmin_tags (id_tag INTEGER PRIMARY KEY, nome TEXT)", |
12 | "CREATE TABLE i3geoadmin_perfis (id_perfil INTEGER PRIMARY KEY, perfil TEXT)", | 13 | "CREATE TABLE i3geoadmin_perfis (id_perfil INTEGER PRIMARY KEY, perfil TEXT)", |
@@ -30,9 +31,40 @@ if($conexaoadmin == "") | @@ -30,9 +31,40 @@ if($conexaoadmin == "") | ||
30 | $banco = null; | 31 | $banco = null; |
31 | $dbhw = new PDO('sqlite:../../menutemas/admin.db'); | 32 | $dbhw = new PDO('sqlite:../../menutemas/admin.db'); |
32 | } | 33 | } |
34 | +else | ||
35 | +{ | ||
36 | + include($conexaoadmin); | ||
37 | +} | ||
33 | foreach($tabelas as $tabela) | 38 | foreach($tabelas as $tabela) |
34 | { | 39 | { |
40 | + if($dbh->getAttribute(PDO::ATTR_DRIVER_NAME) == "pgsql") | ||
41 | + { | ||
42 | + $tabela = str_replace("INTEGER PRIMARY KEY","SERIAL PRIMARY KEY NOT NULL",$tabela); | ||
43 | + } | ||
44 | + //echo $tabela."<br>"; | ||
35 | $q = $dbhw->query($tabela); | 45 | $q = $dbhw->query($tabela); |
46 | + /* | ||
47 | +GRANT SELECT ON TABLE i3geoadmin_atlas TO geodados; | ||
48 | +GRANT SELECT ON TABLE i3geoadmin_atlasp TO geodados; | ||
49 | +GRANT SELECT ON TABLE i3geoadmin_atlast TO geodados; | ||
50 | +GRANT SELECT ON TABLE i3geoadmin_grupos TO geodados; | ||
51 | +GRANT SELECT ON TABLE i3geoadmin_identifica TO geodados; | ||
52 | +GRANT SELECT ON TABLE i3geoadmin_mapas TO geodados; | ||
53 | +GRANT SELECT ON TABLE i3geoadmin_menus TO geodados; | ||
54 | +GRANT SELECT ON TABLE i3geoadmin_n1 TO geodados; | ||
55 | +GRANT SELECT ON TABLE i3geoadmin_n2 TO geodados; | ||
56 | +GRANT SELECT ON TABLE i3geoadmin_n3 TO geodados; | ||
57 | +GRANT SELECT ON TABLE i3geoadmin_perfis TO geodados; | ||
58 | +GRANT SELECT ON TABLE i3geoadmin_raiz TO geodados; | ||
59 | +GRANT SELECT ON TABLE i3geoadmin_sistemas TO geodados; | ||
60 | +GRANT SELECT ON TABLE i3geoadmin_sistemasf TO geodados; | ||
61 | +GRANT SELECT ON TABLE i3geoadmin_subgrupos TO geodados; | ||
62 | +GRANT SELECT ON TABLE i3geoadmin_atlas TO geodados; | ||
63 | +GRANT SELECT ON TABLE i3geoadmin_tags TO geodados; | ||
64 | +GRANT SELECT ON TABLE i3geoadmin_temas TO geodados; | ||
65 | +GRANT SELECT ON TABLE i3geoadmin_ws TO geodados; | ||
66 | + */ | ||
67 | + | ||
36 | } | 68 | } |
37 | $banco = null; | 69 | $banco = null; |
38 | echo "Banco criado!!!"; | 70 | echo "Banco criado!!!"; |
@@ -0,0 +1,34 @@ | @@ -0,0 +1,34 @@ | ||
1 | +<?php | ||
2 | +$funcao = ""; | ||
3 | +include_once("admin.php"); | ||
4 | +if(file_exists("../../menutemas/admin.db")) | ||
5 | +{echo "Arquivo menutemas/admin.db ja existe";exit;} | ||
6 | +$banco = sqlite_open("../../menutemas/admin.db",0666); | ||
7 | +$banco = null; | ||
8 | +$dbh = new PDO('sqlite:../../menutemas/admin.db'); | ||
9 | +$tabelas = array( | ||
10 | +"CREATE TABLE i3geoadmin_grupos (desc_grupo TEXT, id_grupo INTEGER PRIMARY KEY, nome_grupo TEXT)", | ||
11 | +"CREATE TABLE i3geoadmin_sistemasf (abrir_funcao TEXT, h_funcao NUMERIC, id_funcao INTEGER PRIMARY KEY, id_sistema NUMERIC, nome_funcao TEXT, perfil_funcao TEXT, w_funcao NUMERIC)", | ||
12 | +"CREATE TABLE i3geoadmin_subgrupos (desc_subgrupo TEXT, id_subgrupo INTEGER PRIMARY KEY, nome_subgrupo TEXT)", | ||
13 | +"CREATE TABLE i3geoadmin_temas (id_tema INTEGER PRIMARY KEY, kml_tema , ogc_tema , download_tema , tags_tema , tipoa_tema , link_tema , desc_tema , nome_tema , codigo_tema )", | ||
14 | +"CREATE TABLE i3geoadmin_ws (autor_ws TEXT, desc_ws TEXT, id_ws INTEGER PRIMARY KEY, link_ws TEXT, nome_ws TEXT, tipo_ws TEXT)", | ||
15 | +"CREATE TABLE i3geoadmin_tags (id_tag INTEGER PRIMARY KEY, nome TEXT)", | ||
16 | +"CREATE TABLE i3geoadmin_perfis (id_perfil INTEGER PRIMARY KEY, perfil TEXT)", | ||
17 | +"CREATE TABLE i3geoadmin_atlasp (ordem_prancha NUMERIC, desc_prancha TEXT, h_prancha NUMERIC, icone_prancha TEXT, id_atlas NUMERIC, id_prancha INTEGER PRIMARY KEY, link_prancha TEXT, mapext_prancha TEXT, titulo_prancha TEXT, w_prancha NUMERIC)", | ||
18 | +"CREATE TABLE i3geoadmin_atlast (ordem_tema NUMERIC, codigo_tema TEXT, id_prancha TEXT, id_tema INTEGER PRIMARY KEY, ligado_tema TEXT)", | ||
19 | +"CREATE TABLE i3geoadmin_menus (publicado_menu TEXT, perfil_menu TEXT, aberto TEXT, desc_menu TEXT, id_menu INTEGER PRIMARY KEY, nome_menu TEXT)", | ||
20 | +"CREATE TABLE i3geoadmin_mapas (publicado_mapa TEXT, ordem_mapa NUMERIC, perfil_mapa TEXT, ligados_mapa TEXT, temas_mapa TEXT, desc_mapa TEXT, ext_mapa TEXT, id_mapa INTEGER PRIMARY KEY, imagem_mapa TEXT, linkdireto_mapa TEXT, nome_mapa TEXT, outros_mapa TEXT)", | ||
21 | +"CREATE TABLE i3geoadmin_atlas (publicado_atlas TEXT, ordem_atlas NUMERIC, basemapfile_atlas TEXT, desc_atlas TEXT, h_atlas NUMERIC, icone_atlas TEXT, id_atlas INTEGER PRIMARY KEY, link_atlas TEXT, pranchadefault_atlas TEXT, template_atlas TEXT, tipoguias_atlas TEXT, titulo_atlas TEXT, w_atlas NUMERIC)", | ||
22 | +"CREATE TABLE i3geoadmin_sistemas (publicado_sistema TEXT, id_sistema INTEGER PRIMARY KEY, nome_sistema TEXT, perfil_sistema TEXT)", | ||
23 | +"CREATE TABLE i3geoadmin_identifica (publicado_i TEXT, abrir_i TEXT, id_i INTEGER PRIMARY KEY, nome_i TEXT, target_i TEXT)", | ||
24 | +"CREATE TABLE i3geoadmin_raiz (ordem NUMERIC, id_tema NUMERIC, id_menu NUMERIC, id_nivel NUMERIC, id_raiz INTEGER PRIMARY KEY, nivel NUMERIC, perfil TEXT)", | ||
25 | +"CREATE TABLE i3geoadmin_n1 (publicado TEXT, ordem NUMERIC, id_menu NUMERIC, id_grupo NUMERIC, id_n1 INTEGER PRIMARY KEY, n1_perfil TEXT)", | ||
26 | +"CREATE TABLE i3geoadmin_n2 (publicado TEXT, ordem NUMERIC, id_n1 NUMERIC, id_n2 INTEGER PRIMARY KEY, id_subgrupo NUMERIC, n2_perfil TEXT)", | ||
27 | +"CREATE TABLE i3geoadmin_n3 (publicado TEXT, ordem NUMERIC, id_n2 NUMERIC, id_n3 INTEGER PRIMARY KEY, id_tema NUMERIC, n3_perfil TEXT)" | ||
28 | +); | ||
29 | +foreach($tabelas as $tabela) | ||
30 | +{ | ||
31 | + $q = $dbh->query($tabela); | ||
32 | +} | ||
33 | +$banco = null; | ||
34 | +?> | ||
0 | \ No newline at end of file | 35 | \ No newline at end of file |
admin/php/menutemas.php
@@ -27,8 +27,9 @@ File: i3geo/admin/mapfiles.php | @@ -27,8 +27,9 @@ File: i3geo/admin/mapfiles.php | ||
27 | 19/6/2007 | 27 | 19/6/2007 |
28 | 28 | ||
29 | */ | 29 | */ |
30 | -error_reporting(0); | 30 | + |
31 | include_once("admin.php"); | 31 | include_once("admin.php"); |
32 | +error_reporting(E_ALL); | ||
32 | //faz a busca da função que deve ser executada | 33 | //faz a busca da função que deve ser executada |
33 | switch ($funcao) | 34 | switch ($funcao) |
34 | { | 35 | { |
@@ -804,7 +805,7 @@ function importarXmlMenu() | @@ -804,7 +805,7 @@ function importarXmlMenu() | ||
804 | include_once("../../classesphp/funcoes_gerais.php"); | 805 | include_once("../../classesphp/funcoes_gerais.php"); |
805 | include("conexao.php"); | 806 | include("conexao.php"); |
806 | if($convUTF) $nomemenu = utf8_encode($nomemenu); | 807 | if($convUTF) $nomemenu = utf8_encode($nomemenu); |
807 | - $dbhw->query("INSERT INTO i3geoadmin_menus (desc_menu,nome_menu) VALUES ('','$nomemenu')"); | 808 | + $dbhw->query("INSERT INTO i3geoadmin_menus (perfil_menu,desc_menu,nome_menu) VALUES ('','','$nomemenu')"); |
808 | $id_menu = $dbhw->query("SELECT id_menu FROM i3geoadmin_menus"); | 809 | $id_menu = $dbhw->query("SELECT id_menu FROM i3geoadmin_menus"); |
809 | $id_menu = $id_menu->fetchAll(); | 810 | $id_menu = $id_menu->fetchAll(); |
810 | $id_menu = intval($id_menu[count($id_menu)-1]['id_menu']); | 811 | $id_menu = intval($id_menu[count($id_menu)-1]['id_menu']); |
@@ -0,0 +1,578 @@ | @@ -0,0 +1,578 @@ | ||
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 | + $dbhw = null; | ||
573 | + | ||
574 | + return "ok"; | ||
575 | + } | ||
576 | + return "erro"; | ||
577 | +} | ||
578 | +?> | ||
0 | \ No newline at end of file | 579 | \ No newline at end of file |
admin/php/xml.php
@@ -7,7 +7,10 @@ function geraXmlSistemas($perfil,$locaplic,$editores) | @@ -7,7 +7,10 @@ function geraXmlSistemas($perfil,$locaplic,$editores) | ||
7 | $perfil = explode(" ",$perfil); | 7 | $perfil = explode(" ",$perfil); |
8 | $dbh = ""; | 8 | $dbh = ""; |
9 | include($locaplic."/admin/php/conexao.php"); | 9 | include($locaplic."/admin/php/conexao.php"); |
10 | + if($convUTF) | ||
10 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | 11 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; |
12 | + else | ||
13 | + $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; | ||
11 | $xml .= "\n<SISTEMAS>\n"; | 14 | $xml .= "\n<SISTEMAS>\n"; |
12 | $q = "select * from i3geoadmin_sistemas"; | 15 | $q = "select * from i3geoadmin_sistemas"; |
13 | $qatlas = $dbh->query($q); | 16 | $qatlas = $dbh->query($q); |
@@ -117,7 +120,10 @@ function geraXmlAtlas($locaplic,$editores) | @@ -117,7 +120,10 @@ function geraXmlAtlas($locaplic,$editores) | ||
117 | //error_reporting(E_ALL); | 120 | //error_reporting(E_ALL); |
118 | $dbh = ""; | 121 | $dbh = ""; |
119 | include($locaplic."/admin/php/conexao.php"); | 122 | include($locaplic."/admin/php/conexao.php"); |
123 | + if($convUTF) | ||
120 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | 124 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; |
125 | + else | ||
126 | + $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; | ||
121 | $xml .= "\n<RAIZ>\n"; | 127 | $xml .= "\n<RAIZ>\n"; |
122 | $q = "select * from i3geoadmin_atlas"; | 128 | $q = "select * from i3geoadmin_atlas"; |
123 | $qatlas = $dbh->query($q); | 129 | $qatlas = $dbh->query($q); |
@@ -163,7 +169,10 @@ function geraXmlIdentifica($perfil,$locaplic,$editores) | @@ -163,7 +169,10 @@ function geraXmlIdentifica($perfil,$locaplic,$editores) | ||
163 | $perfil = explode(" ",$perfil); | 169 | $perfil = explode(" ",$perfil); |
164 | $dbh = ""; | 170 | $dbh = ""; |
165 | include($locaplic."/admin/php/conexao.php"); | 171 | include($locaplic."/admin/php/conexao.php"); |
172 | + if($convUTF) | ||
166 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | 173 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; |
174 | + else | ||
175 | + $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; | ||
167 | $xml .= "\n<SISTEMAS>\n"; | 176 | $xml .= "\n<SISTEMAS>\n"; |
168 | $q = "select * from i3geoadmin_identifica "; | 177 | $q = "select * from i3geoadmin_identifica "; |
169 | $qi = $dbh->query($q); | 178 | $qi = $dbh->query($q); |
@@ -198,7 +207,10 @@ function geraXmlMapas($perfil,$locaplic,$editores) | @@ -198,7 +207,10 @@ function geraXmlMapas($perfil,$locaplic,$editores) | ||
198 | $perfil = explode(" ",$perfil); | 207 | $perfil = explode(" ",$perfil); |
199 | $dbh = ""; | 208 | $dbh = ""; |
200 | include($locaplic."/admin/php/conexao.php"); | 209 | include($locaplic."/admin/php/conexao.php"); |
210 | + if($convUTF) | ||
201 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | 211 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; |
212 | + else | ||
213 | + $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; | ||
202 | $xml .= "\n<MAPAS>\n"; | 214 | $xml .= "\n<MAPAS>\n"; |
203 | $q = "select * from i3geoadmin_mapas"; | 215 | $q = "select * from i3geoadmin_mapas"; |
204 | $q = $dbh->query($q); | 216 | $q = $dbh->query($q); |
@@ -252,7 +264,10 @@ function geraXmlMenutemas($perfil,$id_menu,$tipo,$locaplic) | @@ -252,7 +264,10 @@ function geraXmlMenutemas($perfil,$id_menu,$tipo,$locaplic) | ||
252 | if (!isset($perfil)){$perfil = "";} | 264 | if (!isset($perfil)){$perfil = "";} |
253 | $perfil = str_replace(","," ",$perfil); | 265 | $perfil = str_replace(","," ",$perfil); |
254 | $perfil = explode(" ",$perfil); | 266 | $perfil = explode(" ",$perfil); |
267 | + if($convUTF) | ||
255 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; | 268 | $xml = "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; |
269 | + else | ||
270 | + $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; | ||
256 | $xml .= "\n<TEMASGEO>\n"; | 271 | $xml .= "\n<TEMASGEO>\n"; |
257 | if(!isset($id_menu)) | 272 | if(!isset($id_menu)) |
258 | $xml .= "<CABECALHO>Utilize ?id_menu=1 por exemplo</CABECALHO>\n"; | 273 | $xml .= "<CABECALHO>Utilize ?id_menu=1 por exemplo</CABECALHO>\n"; |
@@ -269,7 +284,9 @@ function geraXmlMenutemas($perfil,$id_menu,$tipo,$locaplic) | @@ -269,7 +284,9 @@ function geraXmlMenutemas($perfil,$id_menu,$tipo,$locaplic) | ||
269 | foreach($qgrupos as $row) | 284 | foreach($qgrupos as $row) |
270 | { | 285 | { |
271 | if($row["perfil"] == "") | 286 | if($row["perfil"] == "") |
272 | - $mostra = true; | 287 | + { |
288 | + $mostra = true; | ||
289 | + } | ||
273 | else | 290 | else |
274 | { | 291 | { |
275 | $perfilatual = explode(" ",str_replace(","," ",$row["perfil"])); | 292 | $perfilatual = explode(" ",str_replace(","," ",$row["perfil"])); |
classesphp/classe_menutemas.php
@@ -114,6 +114,7 @@ array | @@ -114,6 +114,7 @@ array | ||
114 | { | 114 | { |
115 | if(!isset($this->locaplic)) | 115 | if(!isset($this->locaplic)) |
116 | {return "locaplic nao foi definido";} | 116 | {return "locaplic nao foi definido";} |
117 | + $locaplic = $this->locaplic; | ||
117 | include($this->locaplic."/admin/php/conexao.php"); | 118 | include($this->locaplic."/admin/php/conexao.php"); |
118 | $sql = 'SELECT * from i3geoadmin_menus order by nome_menu'; | 119 | $sql = 'SELECT * from i3geoadmin_menus order by nome_menu'; |
119 | $q = $dbh->query($sql,PDO::FETCH_ASSOC); | 120 | $q = $dbh->query($sql,PDO::FETCH_ASSOC); |
ms_configura.php
@@ -274,7 +274,7 @@ if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | @@ -274,7 +274,7 @@ if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | ||
274 | O programa PHP que estabelece a conexão deve retornar objetos com nomes padronizados. Veja o arquivo i3geo/admin/conexao.php para maiores detalhes. | 274 | O programa PHP que estabelece a conexão deve retornar objetos com nomes padronizados. Veja o arquivo i3geo/admin/conexao.php para maiores detalhes. |
275 | 275 | ||
276 | */ | 276 | */ |
277 | - $conexaoadmin = ""; //$locaplic."/admin/conexaomma.php"; | 277 | + $conexaoadmin = $locaplic."/admin/php/conexaomma.php"; |
278 | } | 278 | } |
279 | else //se for linux | 279 | else //se for linux |
280 | { | 280 | { |
@@ -295,6 +295,6 @@ else //se for linux | @@ -295,6 +295,6 @@ else //se for linux | ||
295 | $utilizacgi = "nao"; | 295 | $utilizacgi = "nao"; |
296 | $atlasxml = "";//"../menutemas/atlas.xml"; | 296 | $atlasxml = "";//"../menutemas/atlas.xml"; |
297 | $expoeMapfile = "sim"; | 297 | $expoeMapfile = "sim"; |
298 | - $conexaoadmin = "";//$locaplic."/admin/php/conexaomma.php"; | 298 | + $conexaoadmin = ""; |
299 | } | 299 | } |
300 | ?> | 300 | ?> |