From cc2fd9d7312edfb554d4eb1fe173459d6bb25735 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 11 Jun 2008 18:02:21 +0000 Subject: [PATCH] Inclusão da interface de administração --- admin/base.map | 9 +++++++++ admin/html/admin.css | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/html/atlas.html | 41 +++++++++++++++++++++++++++++++++++++++++ admin/html/atlas_importar.html | 22 ++++++++++++++++++++++ admin/html/i3geoadmin_arvore.html | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/html/i3geoadmin_grupos.html | 34 ++++++++++++++++++++++++++++++++++ admin/html/i3geoadmin_importarmenu.html | 24 ++++++++++++++++++++++++ admin/html/i3geoadmin_menus.html | 37 +++++++++++++++++++++++++++++++++++++ admin/html/i3geoadmin_subgrupos.html | 35 +++++++++++++++++++++++++++++++++++ admin/html/i3geoadmin_tags.html | 34 ++++++++++++++++++++++++++++++++++ admin/html/i3geoadmin_temas.html | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ admin/html/identifica.html | 33 +++++++++++++++++++++++++++++++++ admin/html/identifica_importar.html | 25 +++++++++++++++++++++++++ admin/html/mapas.html | 43 +++++++++++++++++++++++++++++++++++++++++++ admin/html/mapas_importar.html | 21 +++++++++++++++++++++ admin/html/mapfiles.html | 37 +++++++++++++++++++++++++++++++++++++ admin/html/ms_configura.html | 39 +++++++++++++++++++++++++++++++++++++++ admin/html/sistemas.html | 33 +++++++++++++++++++++++++++++++++ admin/html/sistemas_importar.html | 24 ++++++++++++++++++++++++ admin/html/temas.html | 43 +++++++++++++++++++++++++++++++++++++++++++ admin/html/webservices.html | 36 ++++++++++++++++++++++++++++++++++++ admin/html/webservices_importar.html | 31 +++++++++++++++++++++++++++++++ admin/imagens/01.png | Bin 0 -> 570 bytes admin/imagens/02.png | Bin 0 -> 481 bytes admin/imagens/03.png | Bin 0 -> 675 bytes admin/imagens/04.png | Bin 0 -> 383 bytes admin/index.htm | 15 +++++++++++++++ admin/index.html | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/admin.js | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/arvore.js | 381 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/atlas.js | 345 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/identifica.js | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/mapas.js | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/mapfiles.js | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/menutemas.js | 441 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/ms_configura.js | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/sistemas.js | 209 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/temas.js | 791 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/js/webservices.js | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/admin.php | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/arvore.php | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/atlas.php | 309 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/conexao.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ admin/php/conexaomma.php | 3 +++ admin/php/identifica.php | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/mapas.php | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/mapfiles.php | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/menutemas.php | 572 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/ms_configura.php | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/sistemas.php | 229 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/sqlite.php | 27 +++++++++++++++++++++++++++ admin/php/temas.php | 577 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/php/webservices.php | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/xmlatlas.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ admin/xmlmenutemas.php | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 55 files changed, 7155 insertions(+), 0 deletions(-) create mode 100644 admin/base.map create mode 100644 admin/html/admin.css create mode 100644 admin/html/atlas.html create mode 100644 admin/html/atlas_importar.html create mode 100644 admin/html/i3geoadmin_arvore.html create mode 100644 admin/html/i3geoadmin_grupos.html create mode 100644 admin/html/i3geoadmin_importarmenu.html create mode 100644 admin/html/i3geoadmin_menus.html create mode 100644 admin/html/i3geoadmin_subgrupos.html create mode 100644 admin/html/i3geoadmin_tags.html create mode 100644 admin/html/i3geoadmin_temas.html create mode 100644 admin/html/identifica.html create mode 100644 admin/html/identifica_importar.html create mode 100644 admin/html/mapas.html create mode 100644 admin/html/mapas_importar.html create mode 100644 admin/html/mapfiles.html create mode 100644 admin/html/ms_configura.html create mode 100644 admin/html/sistemas.html create mode 100644 admin/html/sistemas_importar.html create mode 100644 admin/html/temas.html create mode 100644 admin/html/webservices.html create mode 100644 admin/html/webservices_importar.html create mode 100644 admin/imagens/01.png create mode 100644 admin/imagens/02.png create mode 100644 admin/imagens/03.png create mode 100644 admin/imagens/04.png create mode 100644 admin/index.htm create mode 100644 admin/index.html create mode 100644 admin/js/admin.js create mode 100644 admin/js/arvore.js create mode 100644 admin/js/atlas.js create mode 100644 admin/js/identifica.js create mode 100644 admin/js/mapas.js create mode 100644 admin/js/mapfiles.js create mode 100644 admin/js/menutemas.js create mode 100644 admin/js/ms_configura.js create mode 100644 admin/js/sistemas.js create mode 100644 admin/js/temas.js create mode 100644 admin/js/webservices.js create mode 100644 admin/php/admin.php create mode 100644 admin/php/arvore.php create mode 100644 admin/php/atlas.php create mode 100644 admin/php/conexao.php create mode 100644 admin/php/conexaomma.php create mode 100644 admin/php/identifica.php create mode 100644 admin/php/mapas.php create mode 100644 admin/php/mapfiles.php create mode 100644 admin/php/menutemas.php create mode 100644 admin/php/ms_configura.php create mode 100644 admin/php/sistemas.php create mode 100644 admin/php/sqlite.php create mode 100644 admin/php/temas.php create mode 100644 admin/php/webservices.php create mode 100644 admin/xmlatlas.php create mode 100644 admin/xmlmenutemas.php diff --git a/admin/base.map b/admin/base.map new file mode 100644 index 0000000..c563480 --- /dev/null +++ b/admin/base.map @@ -0,0 +1,9 @@ +SYMBOLSET ../symbols/simbolos.sym +FONTSET "../symbols/fontes.txt" +LAYER + NAME base # ok + TYPE line + DATA "" + +END +END \ No newline at end of file diff --git a/admin/html/admin.css b/admin/html/admin.css new file mode 100644 index 0000000..abd7af9 --- /dev/null +++ b/admin/html/admin.css @@ -0,0 +1,70 @@ +P +{text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} + +legend +{font-weight:bold;cursor:pointer;background-color:white;color:navy;text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} + +.mensagem +{color:black;text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} + +h1 +{text-align: left;font-size:15px;font-family: Verdana, Arial, Helvetica, sans-serif;} + +input +{cursor:pointer;} + +.lista td +{border: 1px solid rgb(140,140,140);border-left: 0px;border-right:0px;border-top:0px;padding: 0px;color:#2F4632;margin:0px;text-align:left;font-size: 10px;font-family: Verdana, Arial, Helvetica, sans-serif;} + +.lista1 td +{cursor:pointer;text-align:left;font-size: 14px;font-family: Verdana, Arial, Helvetica, sans-serif;} + +.lista1 +{text-align:left;} +.aplicar +{ + background-image:URL('../imagens/02.png'); + background-repeat: no-repeat; + background-position: 0px 0px; + cursor:pointer; + width: 20px; + height: 20px; +} +.excluir +{ + background-image:URL('../imagens/01.png'); + background-repeat: no-repeat; + background-position: 0px 0px; + cursor:pointer; + width: 20px; + height: 20px; +} +.mostrar +{ + background-image:URL('../imagens/03.png'); + background-repeat: no-repeat; + background-position: 0px 0px; + cursor:pointer; + width: 20px; + height: 20px; +} +.ajuda +{ + background-image:URL('../imagens/04.png'); + background-repeat: no-repeat; + background-position: 0px 0px; + cursor:pointer; + width: 20px; + height: 15px; +} +.textoAjuda +{ + color:black;text-align: left;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif; +} +.fieldsetRaiz +{background-color:rgb(252,210,186);} +#fieldset +{ +text-align:left; + +} \ No newline at end of file diff --git a/admin/html/atlas.html b/admin/html/atlas.html new file mode 100644 index 0000000..206416b --- /dev/null +++ b/admin/html/atlas.html @@ -0,0 +1,41 @@ + + + + + + + + + +
+

Administração do i3geo - Atlas

+

Voltar

+

Este programa permite editar a lista de Atlas

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

Parâmetros:

+

ícone - endereço da imagem que será utilizada para identificar o mapa ou prancha +

link - link na internet que será aberto em uma janela dentro do atlas ou prancha +

template - arquivo HTMML de configuração do i3geo que será utilizado. Se não especificado, será utilizado o default. +

extensão - extensão geográfica que será utilizada em cada prancha, no formato xmin ymin xmax ymax. +

mapfile base - arquivo mapfile que será utilizado como base para montagem do atlas. Utilize o caminho completo no servidor. +

+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/atlas_importar.html b/admin/html/atlas_importar.html new file mode 100644 index 0000000..2eb6389 --- /dev/null +++ b/admin/html/atlas_importar.html @@ -0,0 +1,22 @@ + + + + + + + + + +
+

Administração do i3geo - importação de XML

+

Voltar

+

Este programa importa as definições do menu de temas armazenadas em um arquivo XML

+

O menu é baseado no banco admin.db.

+
+

Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo. +

Por padrão, o arquivo utilizado é i3geo/menutemas/atlas.xml


+ + +
+ + \ No newline at end of file diff --git a/admin/html/i3geoadmin_arvore.html b/admin/html/i3geoadmin_arvore.html new file mode 100644 index 0000000..be2566b --- /dev/null +++ b/admin/html/i3geoadmin_arvore.html @@ -0,0 +1,87 @@ + + + + + + + + + +
+

Administração do i3geo - menu de temas

+

Voltar

+

Este programa permite editar as árvores de cada menu

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

Utilize as opções abaixo para relacionar os temas a grupos e sub-grupos. Escolha primeiro um menu e depois edite +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. +

Os grupos, sub-grupos e temas já devem ter sido criados para que se possa montar a árvore de associações. +

+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/i3geoadmin_grupos.html b/admin/html/i3geoadmin_grupos.html new file mode 100644 index 0000000..55dfb63 --- /dev/null +++ b/admin/html/i3geoadmin_grupos.html @@ -0,0 +1,34 @@ + + + + + + + + + +
+

Administração do i3geo - menu de temas

+

Voltar

+

Este programa permite editar a lista de grupos

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+
+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/i3geoadmin_importarmenu.html b/admin/html/i3geoadmin_importarmenu.html new file mode 100644 index 0000000..bf19b96 --- /dev/null +++ b/admin/html/i3geoadmin_importarmenu.html @@ -0,0 +1,24 @@ + + + + + + + + + +
+

Administração do i3geo - importação de menu XML

+

Voltar

+

Este programa importa as definições do menu de temas armazenadas em um arquivo XML

+

O menu é baseado no banco admin.db.

+
+

Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo +

Por padrão, o arquivo utilizado é i3geo/menutemas/menutemas.xml

+ +

Nome do novo menu:

+

+ +
+ + \ No newline at end of file diff --git a/admin/html/i3geoadmin_menus.html b/admin/html/i3geoadmin_menus.html new file mode 100644 index 0000000..13d8049 --- /dev/null +++ b/admin/html/i3geoadmin_menus.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+

Administração do i3geo - menu de temas

+

Voltar

+

Este programa permite editar a lista de menus

+

Você pode criar vários menus e depois acrescentar grupos, subgrupos e temas em cada um. +A lista de menus que serão utilizados no i3geo é definida no arquivo ms_configura.php. +

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+
+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/i3geoadmin_subgrupos.html b/admin/html/i3geoadmin_subgrupos.html new file mode 100644 index 0000000..e1b0dbd --- /dev/null +++ b/admin/html/i3geoadmin_subgrupos.html @@ -0,0 +1,35 @@ + + + + + + + + + + +
+

Administração do i3geo - menu de temas

+

Voltar

+

Este programa permite editar a lista de sub-grupos

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+
+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/i3geoadmin_tags.html b/admin/html/i3geoadmin_tags.html new file mode 100644 index 0000000..6899ab0 --- /dev/null +++ b/admin/html/i3geoadmin_tags.html @@ -0,0 +1,34 @@ + + + + + + + + + + +
+

Administração do i3geo - menu de temas

+

Voltar

+

Este programa permite editar a lista de tags (palavras-chave)

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+
+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/i3geoadmin_temas.html b/admin/html/i3geoadmin_temas.html new file mode 100644 index 0000000..03032bd --- /dev/null +++ b/admin/html/i3geoadmin_temas.html @@ -0,0 +1,51 @@ + + + + + + + + + + +
+

Administração do i3geo - menu de temas

+

Voltar

+

Este programa permite editar a lista de temas

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

Os temas são relacionados aos mapfiles existentes no diretório i3geo/temas. Cada tema recebe um nome que será mostrado +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. +

+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/identifica.html b/admin/html/identifica.html new file mode 100644 index 0000000..0844f0f --- /dev/null +++ b/admin/html/identifica.html @@ -0,0 +1,33 @@ + + + + + + + + + +
+

Administração do i3geo - sistemas de identificação

+

Voltar

+

Este programa permite editar o cadastro de sistemas utilizados na ferramenta de identificação

+

A lista é baseada no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

O item programa define a URL que será chamada quando o usuário clica em um ponto no mapa. +A ferramenta de identificação irá acrescentar ao final da URL os parâmetros "x" e "y", correspondentes +às coordenadas do ponto clicado no mapa. +

+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/identifica_importar.html b/admin/html/identifica_importar.html new file mode 100644 index 0000000..e62f0f7 --- /dev/null +++ b/admin/html/identifica_importar.html @@ -0,0 +1,25 @@ + + + + + + + + + +
+

Administração do i3geo - importação da lista de funções da ferramenta identifica

+

Voltar

+

Este programa importa as definições das funções armazenadas em um arquivo XML

+

O menu é baseado no banco admin.db.

+
+

Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo

+

Os arquivos default do i3geo são (em i3geo/menutemas): identifica.xml

+ +
+
+ +
+ + + \ No newline at end of file diff --git a/admin/html/mapas.html b/admin/html/mapas.html new file mode 100644 index 0000000..c18c733 --- /dev/null +++ b/admin/html/mapas.html @@ -0,0 +1,43 @@ + + + + + + + + + +
+

Administração do i3geo - mapas

+

Voltar

+

Este programa permite editar a lista de mapas

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

Parâmetros:

+

Extensão: extensão geográfica no formato xmin ymin xmax ymax

+

Imagem: link para a imagem miniatura

+

Direto: link direto com todos os parâmetros de abertura do mapa. Se for usado, os outros parâmetros são desconsiderados

+

Outros: outros parâmetros que podem ser utilizados pelo ms_criamapa.php. São encadeados no final da URL de montagem do mapa.

+

Temas: códigos dos temas que serão mostrados no mapa

+

Ligados: códigos dos temas que estarão ligados no mapa (visíveis). Os códigos devem constar no item Temas

+

Perfil: lista de perfis de usuários que podem ver o mapa. Separe com vírgulas

+
+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/mapas_importar.html b/admin/html/mapas_importar.html new file mode 100644 index 0000000..0b88e40 --- /dev/null +++ b/admin/html/mapas_importar.html @@ -0,0 +1,21 @@ + + + + + + + + + +
+

Administração do i3geo - importação da lista de mapas

+

Voltar

+

Este programa importa as definições do menu de temas armazenadas em um arquivo XML

+

O menu é baseado no banco admin.db.

+
+

Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo. Por padrão, o i3geo utiliza o arquivo menutemas/mapas.xml

+ + +

+ + \ No newline at end of file diff --git a/admin/html/mapfiles.html b/admin/html/mapfiles.html new file mode 100644 index 0000000..e99fbdb --- /dev/null +++ b/admin/html/mapfiles.html @@ -0,0 +1,37 @@ + + + + + + + + + + +
+

Administração do i3geo - mapfiles principais

+

voltar

+

Este programa permite alterar as configurações básicas dos arquivos mapfile existentes em i3geo/aplicmap

+

Esses arquivos são os mapas básicos utilizados pelo i3geo na inicialização.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+
+ +

Aguarde...

+
+

+

+ + + + \ No newline at end of file diff --git a/admin/html/ms_configura.html b/admin/html/ms_configura.html new file mode 100644 index 0000000..5f9e456 --- /dev/null +++ b/admin/html/ms_configura.html @@ -0,0 +1,39 @@ + + + + + + + + + +
+

Administração do i3geo - ms_configura.php

+

voltar

+

Este programa permite alterar as variáveis de configuração existentes no programa ms_configura.php

+

O ms_configura.php é utilizado como um "include" nos programas do i3geo, definindo uma série de parâmetros necessários ao seu funcionamento.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

Da mesma forma, a variável $menutemas não pode ser modificada nesse formulário. Por padrão, essa variável é definida como vazia, forçando o i3geo a montar a árvore de camadas utilizando o banco de dados administrativo.

+

Se você quer utilizar um outro mecanismo de montagem do menu de temas, edite manualmente o arquivo ms_configura.php. +

+ +

Aguarde...

+
+

+

+ + + + \ No newline at end of file diff --git a/admin/html/sistemas.html b/admin/html/sistemas.html new file mode 100644 index 0000000..e90eae2 --- /dev/null +++ b/admin/html/sistemas.html @@ -0,0 +1,33 @@ + + + + + + + + + +
+

Administração do i3geo - sistemas especiais

+

Voltar

+

Este programa permite editar a lista de sistemas especiais que adicionam camadas ao mapa

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

A lista de perfis deve ser sepada por ",". Em abrir programa, inclua o endereço no servidro +do programa que será aberto em umajanela no i3geo. Cada sistema pode ter uma ou mais funções, que serão mostradas +em uma árvore hierárquica no i3geo.

+
+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/sistemas_importar.html b/admin/html/sistemas_importar.html new file mode 100644 index 0000000..ca93f1a --- /dev/null +++ b/admin/html/sistemas_importar.html @@ -0,0 +1,24 @@ + + + + + + + + + +
+

Administração do i3geo - importação da lista de sistemas

+

Voltar

+

Este programa importa as definições dos sistemas e funções armazenadas em um arquivo XML

+

O menu é baseado no banco admin.db.

+
+

Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo

+

O arquivo default do i3geo é i3geo/menutemas/sistemas.xml

+ +
+ +
+ + + \ No newline at end of file diff --git a/admin/html/temas.html b/admin/html/temas.html new file mode 100644 index 0000000..800935a --- /dev/null +++ b/admin/html/temas.html @@ -0,0 +1,43 @@ + + + + + + + + + +
+

Administração do i3geo - Temas

+

Voltar

+

Este programa permite criar ou editar os arquivos mapfile que compõem temas no i3geo.

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

A lista de arquivos editáveis é baseada no banco de dados administrativo. Para que um arquivo apareça na +listagem, ele deve ter sido incluído no banco por meio da opção "Editar a lista de temas"

+ +
+
+ Arquivo em edição +

Escolha o arquivo para editar (a lista de arquivos é baseada no banco de dados administrativo)

+

Aguarde...

+

+ +

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):

+

Código:

+

+

Nome:

+

+

+
+

+ + + + + + \ No newline at end of file diff --git a/admin/html/webservices.html b/admin/html/webservices.html new file mode 100644 index 0000000..1facf23 --- /dev/null +++ b/admin/html/webservices.html @@ -0,0 +1,36 @@ + + + + + + + + + +
+

Administração do i3geo - cadastro de web services

+

Voltar

+

Este programa permite editar o cadastro de web services

+

O menu é baseado no banco admin.db.

+

A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e +dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para +alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.

+

Tipos:

+

WS - web service convencional utilizado no cliente de web service (i3geo/wscliente.htm)>

+

WMS - web map service, utilizado na ferramenta de conexão com servidor remoto e no cliente de web service

+

GEORSS - RSS com padrão GEO, utilizado na ferramenta de adição de temas baseados em GEORSS

+

DOWNLOAD - endereço que será adicionado na aplicação datadownload.htm. Trata-se de um link para endereço na web com dados para download. +

+

Aguarde...

+ + + \ No newline at end of file diff --git a/admin/html/webservices_importar.html b/admin/html/webservices_importar.html new file mode 100644 index 0000000..99a567c --- /dev/null +++ b/admin/html/webservices_importar.html @@ -0,0 +1,31 @@ + + + + + + + + + +
+

Administração do i3geo - importação da lista de mapas

+

Voltar

+

Este programa importa as definições dos webservices armazenadas em um arquivo XML

+

O menu é baseado no banco admin.db.

+
+

Digite o nome do arquivo xml armazenado no servidor - utilize o caminho completo

+

Os arquivos default do i3geo são (em i3geo/menutemas): servicosgeorss.xml, servicosws.xml, servicoswms.xml e linksdownload.xml

+ +
+ + +
+ + + \ No newline at end of file diff --git a/admin/imagens/01.png b/admin/imagens/01.png new file mode 100644 index 0000000..cf640c1 Binary files /dev/null and b/admin/imagens/01.png differ diff --git a/admin/imagens/02.png b/admin/imagens/02.png new file mode 100644 index 0000000..af7ff59 Binary files /dev/null and b/admin/imagens/02.png differ diff --git a/admin/imagens/03.png b/admin/imagens/03.png new file mode 100644 index 0000000..473cee3 Binary files /dev/null and b/admin/imagens/03.png differ diff --git a/admin/imagens/04.png b/admin/imagens/04.png new file mode 100644 index 0000000..9e66dba Binary files /dev/null and b/admin/imagens/04.png differ diff --git a/admin/index.htm b/admin/index.htm new file mode 100644 index 0000000..e19c21f --- /dev/null +++ b/admin/index.htm @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/admin/index.html b/admin/index.html new file mode 100644 index 0000000..707910c --- /dev/null +++ b/admin/index.html @@ -0,0 +1,200 @@ + + + + + + + + +
+

Administração do i3geo

+
+ +
+Observações +

Para mais informações sobre a administração do i3geo, veja a documentação no Portal do Software Público Brasileiro (PSPB). +Você precisará se inscrever no Portal e ingressar na comunidade i3geo. Na página da comunidade, existem vários documentos que explicam como instalar e configurar o i3geo.

+

De forma geral, você deverá seguir as seguintes etapas na configuração:

+

1 - instalação e configuração +

2 - criação das camadas (layers) +

3 - organização das camadas em grupos e sub-grupos +

4 - configuração de mapas e atlas +

5 - edição do cadastro de web services e sistemas especiais +

6 - customização das ferramentas e interface +

Antes da versão 4.0 o i3geo utilizava arquivos armazenados em disco (arquivos XML) para organizar +as camadas e outras listagens. +Com a nova estrutura de administração, esses arquivos podem ser substituídos por registros em bancos de dados. +Se você opotar por usar um banco de dados, os arquivos antigos poderão ser importados para o banco (veja as opções de importação abaixo).

+

Para possibilitar a distribuição do i3geo de forma independente de banco de dados, optou-se pelo uso do gerenciador +SQLITE, cujo arquivo com os dados fica armazenado em i3geo/menutemas/admin.db. Os programas em PHP que gerenciam esse banco +utilizam o pacote PDO, possibilitando que seja utilizado outro gerenciador, como o POSTGRESQL, entre outros.

+

Para modificar a configuração do PDO, e utilizar outro gerenciador, deve-se editar o arquivo i3geo/admin/conexao.php +ou então alterar a variável de configuração, definida no ms_configura.php, chamada $conexaoadmin. Essa variável indica o nome de um +programa em PHP que será incluído nos programas que fazem acesso ao banco de dados de administração. Um exemplo de +conexão em PHP pode ser visto em i3geo/admin/conexaomma.php.

+

Para usar um gerenciador diferente do SQLITE é necessário criar as tabelas no novo banco de dados. Os sqls para +essa criação podem ser obtidos no item "Outras opções".

+

Apesar do uso de um banco de dados, o acesso aos registros pelo i3geo continua sendo feito por meio de arquivos XML. +O controle sobre a fonte desses XMLs é feito por meio da definição de variáveis armazenadas no arquivo i3geo/ms_configura.php. +Quando se utiliza a estrutura padrão das tabelas, como pode ser visto no banco SQLITE, o i3geo fornece programas PHP +que geram os arquivos XML em sua formatação correta (veja os arquivos XML existentes no diretório i3geo/menutemas). +Caso você queira utilizar uma estrutura de banco de dados diferente, será necessário criar os programas em PHP para a geração +dos arquivos XML. +

+
+
+Configuração geral + + + + + + + +
Ajuda
Abrir o i3geo
Testar a instalação do i3geo (testainstal.php)
Editar variáveis de configuração (ms_configura.php)
Editar os arquivos mapfile básicos utilizados na inicialização
+
+
+
+Editor de temas + + + + +
Ajuda
Edição
+
+
+
+Edição das tabelas auxiliares e do menu de adição de temas + + + + + + + + + + +
Ajuda
Editar a lista de tags (palavras-chave)
Editar a lista de menus
Editar a lista de grupos
Editar a lista de sub-grupos
Editar a lista de temas
Editar a árvore dos menus
Importar XML
+
+
+
+Mapas + + + + + +
Ajuda
Edição dos mapas
Importar XML
+
+
+
+Atlas + + + + + +
Ajuda
Edição dos atlas
Importar XML
+
+
+
+Cadastro de web services e links para download + + + + + +
Ajuda
Edição do cadastro
Importar XML
+
+
+
+Sistemas especiais de identificação + + + + + +
Ajuda
Edição dos sistemas
Importar XML
+
+
+
+Sistemas especiais que adicionam camadas + + + + + +
Ajuda
Edição dos sistemas
Importar XML
+
+
+
+Outras opções + + + +
Descrição do banco padrão (SQLITE)
Gera as miniaturas (thumbnails) para os temas existentes no diretório i3geo/temas
+
+
+
+

 

 

 

 

 

 

 

 

 

 

 

 

  +

 

 

 

 

 

 

 

 

 

 

 

 

  + + + + \ No newline at end of file diff --git a/admin/js/admin.js b/admin/js/admin.js new file mode 100644 index 0000000..18ec7b3 --- /dev/null +++ b/admin/js/admin.js @@ -0,0 +1,264 @@ +/* +Title: Admin + +Funções javascript utilizadas no sistema de administração + +File: i3geo/admin/admin.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +//variáveis globais +/* +Variable: $mensagemAguarde +*/ +$mensagemAguarde = "

Aguarde...

" + +$i = function(i) +{return document.getElementById(i);}; + +/* +Variable: cPaint +Objeto cpaint para chamada ajax +*/ +cPaint = new cpaint(); +cPaint.set_async("true"); +cPaint.set_response_type("JSON"); + +function ativaIndice(onde) +{ + var f = document.getElementsByTagName("fieldset") + for(t = 0;t < f.length;t++) + { + f[t].innerHTML += "

índice

" + } + var etrs = document.getElementsByTagName("legend") + var ins = "
Índice" + for(t = 0;t < etrs.length;t++) + { + ins += "

"+etrs[t].innerHTML+"

" + etrs[t].innerHTML = ""+etrs[t].innerHTML+""; + + } + document.getElementById(onde).innerHTML = ins+"
" +} +function ativaTR() +{ + var etrs = document.getElementsByTagName("tr") + for(t = 0;t < etrs.length;t++) + { + etrs[t].onmouseover = function() + {this.style.backgroundColor = "beige"} + etrs[t].onmouseout = function() + {this.style.backgroundColor = ""} + } +} + +function ativaLegenda() +{ + var etrs = document.getElementsByTagName("legend") + for(t = 0;t < etrs.length;t++) + { + etrs[t].onclick = function() + { + var c = this.parentNode.childNodes; + for(h = 0;h < c.length;h++) + { + if(c[h].style && c[h].tagName != "LEGEND") + { + if(c[h].style.display=="none") + c[h].style.display="block" + else + c[h].style.display="none" + } + } + } + } +} + +/* +Function: abre + +Abre uma url específica no lugar da página atual + +Parameters: + +url - nome do programa que será aberto +*/ +function abre(url) +{ + window.location.href = url +} +/* +Function: verificaEditores + +Verifica se o usuário está cadastrado como um editor do i3geo + +*/ +function verificaEditores() +{ + var retorna = function(retorno) + { + if(retorno.data=="nao") + {document.body.innerHTML += "

Você não está cadastrado como um editor";return} + montaParametros() + } + var p = "../php/mapfiles.php?funcao=verificaEditores"; + cPaint.call(p,"",retorna); +} +/* +Function: combosimnao + +Retorna os itens option de um combo sim nao +*/ +function combosimnao(marcar) +{ + var ins = "

"+$parametros.simples[i].cabeca+"" + ins += "

"+$parametros.simples[i].mensagem+"

" + ins += "" + ins += "
" + ins += "

" + } + document.body.innerHTML += ins +} +function geraLinhas(dados,param,ncolunas) +{ + var nparam = param.linhas.length; + var contaParam = 0 + var resultado = ""; + do + { + var p = param.linhas[contaParam]; + var idd = eval("dados."+p.id) + if(idd != undefined) + var id = p.prefixoid+idd; + else + var id = p.prefixoid+p.id; + var valor = eval("dados."+p.valor); + var titulo = p.titulo; + if(p.texto) + {var texto = p.texto} + else + {var texto = ""} + resultado += ""+texto+"" + resultado += "" + resultado += ""+titulo+": " + resultado += "" + if(ncolunas = 3) + resultado += "" + resultado += "" + contaParam++ + } + while(contaParam < nparam) + return(resultado) +} +function geraLinhas2(dados,param,funcao) +{ + var nparam = param.linhas.length; + var contaParam = 0 + var resultado = ""; + do + { + var p = param.linhas[contaParam]; + var idd = eval("dados."+p.id) + if(idd != undefined) + var id = p.prefixoid+idd; + else + var id = p.prefixoid+p.id; + var valor = eval("dados."+p.valor); + var titulo = p.titulo; + if(p.texto) + {var texto = p.texto} + else + {var texto = ""} + resultado += "
+- "+titulo+"
" + resultado += "

"+texto+"

" + resultado += "

" + resultado += "" + resultado += "" + resultado += "

" + contaParam++ + } + while(contaParam < nparam) + return(resultado) +} \ No newline at end of file diff --git a/admin/js/arvore.js b/admin/js/arvore.js new file mode 100644 index 0000000..31f61a1 --- /dev/null +++ b/admin/js/arvore.js @@ -0,0 +1,381 @@ +/* +Title: Arvore + +Funções javascript utilizadas no sistema de administração do menu de temas + +File: i3geo/admin/arvore.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração + +Ao retornar, por default, executa a função montaParametros() +*/ +function iniciaAdmin() +{ + verificaEditores() +} +function montaParametros() +{ + if(!$i("resultado")) + {document.body.innerHTML += "
"} +} +/* +Function: listaRaiz + +Monta o html com os parametros e os divs que receberão os dados dos formulários. + +Para cada registro na variável $parametrs, é montado um formulário. +*/ +function listaRaiz() +{ + $i("resultado").innerHTML = $mensagemAguarde + var ins = "" + for (i=0;i<$parametros.simples.length;i++) + { + ins += "
"+$parametros.simples[i].cabeca+"" + ins += "

" + ins += "

" + ins += "
" + ins += "
" + ins += "

"+$parametros.simples[i].mensagem+"

" + ins += "

" + ins += "

" + } + $i("resultado").innerHTML = ins + pegaNosRaiz() + pegaTemasRaiz(0,0,"temasRaiz0") +} +function pegaTemasRaiz(nivel,id_nivel,onde) +{ + $i(onde).innerHTML = $mensagemAguarde + var n = $temasRaiz.length + var ins = "" + if(n > 0) + { + var ins = "
Temas na raiz desse nível" + for (i=0;i" + ins += "
" + ins += "" + ins += "" + ins += "" + ins += "" + } + } + ins += "

" + } + $i(onde).innerHTML = ins; +} +function pegaNosRaiz() +{ + $i("nivel1").innerHTML = $mensagemAguarde + //monta o primeiro nível + var retorna = function(retorno) + { + var r = retorno.data + var ins = ""; + var rl = r.length; + for (i=0;i
+- grupo "+r[i].id_n1+"" + ins += "
" + ins += ""; + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
NomePerfis (separe com vírgula)
" + ins += "
" + ins += "" + ins += "" + ins += "" + ins += "
" + ins += "
" + ins += "
" + ins += "

" + } + $i("nivel1").innerHTML = ins; + for (t=0;t
subgrupo "+r[i].id_n2+"" + ins += ""; + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
NomePerfis (separe com vírgula)
" + ins += "
" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
" + + ins += "
" + ins += "
" + ins += "
" + } + $i("n2_"+idn1).innerHTML = ins; + ativaLegenda() + } + var p = "../php/arvore.php?funcao=pegaN2&idn1="+idn1; + cPaint.call(p,"",retorna); +} +function pegaNosSubGrupo(idn2) +{ + $i("n3_"+idn2).innerHTML = $mensagemAguarde + var retorna = function(retorno) + { + var r = retorno.data + var ins = ""; + for (i=0;i" + ins += ""; + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
NomePerfis (separe com vírgula)
" + ins += "
" + //ins += "
" + ins += "" + } + $i("n3_"+idn2).innerHTML = ins; + } + var p = "../php/arvore.php?funcao=pegaN3&idn2="+idn2; + cPaint.call(p,"",retorna); +} +function alterarRaiz(id_raiz,nivel,id_nivel,onde) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + $temasRaiz = retorno.data; + pegaTemasRaiz(nivel,id_nivel,onde); + } + if (id_raiz != "") + { + var id_tema = $i("raizTema_"+id_raiz).value + var perfil = $i("raizPerfil_"+id_raiz).value + } + else + { + var id_raiz = ""; + var perfil = ""; + var id_tema = "" + } + var p = "../php/arvore.php?funcao=alterarRaiz&id_nivel="+id_nivel+"&nivel="+nivel+"&id_raiz="+id_raiz+"&id_menu="+$i("menusel").value+"&perfil="+perfil+"&id_tema="+id_tema; + cPaint.call(p,"",retorna); + //} +} +function alterarTema(id,idsubgrupo) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function() + {pegaNosSubGrupo(idsubgrupo);} + if (id != "") + { + var perfil = $i("perfiln3_"+id).value + if(perfil == "null"){var perfil = "";} + var idtema = $i("teman3_"+id).value + //var idsubgrupo = "" + } + else + { + var id = ""; + var perfil = ""; + var idtema = "" + } + if($i("n3_"+idtema)) + $i("n3_"+idtema).innerHTML = $mensagemAguarde + var p = "../php/arvore.php?funcao=alteraN3&id="+id+"&perfil="+perfil+"&idtema="+idtema+"&idsubgrupo="+idsubgrupo; + cPaint.call(p,"",retorna); + //} + +} + +function alterarSubGrupo(idgrupo,id) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function() + {pegaNosGrupo(idgrupo);} + if (id != "") + { + var perfil = $i("perfiln2_"+id).value + if(perfil == "null"){var perfil = "";} + var idsubgrupo = $i("subgrupon2_"+id).value + } + else + { + var id = ""; + var perfil = ""; + var idsubgrupo = "" + } + if($i("n2_"+idsubgrupo)) + $i("n2_"+idsubgrupo).innerHTML =$mensagemAguarde + var p = "../php/arvore.php?funcao=alteraN2&id="+id+"&perfil="+perfil+"&idsubgrupo="+idsubgrupo+"&idgrupo="+idgrupo; + cPaint.call(p,"",retorna); + //} + +} +/* +Function: alterarGrupo + +Altera o valor de uma variável +*/ +function alterarGrupo(id) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function() + {pegaNosRaiz();} + if (id != "") + { + var n1 = $i("n1_"+id).value + var perfil = $i("perfiln1_"+id).value + if(n1 == "null"){var n1 = "";} + if(perfil == "null"){var perfil = "";} + var idgrupo = $i("grupon1_"+id).value + } + else + { + var id = ""; + var perfil = ""; + var idgrupo = ""; + } + if($i("n1_"+id)) + $i("n1_"+id).innerHTML =$mensagemAguarde + var idmenu = $i("menusel").value + var p = "../php/arvore.php?funcao=alteraN1&id="+id+"&perfil="+perfil+"&idgrupo="+idgrupo+"&idmenu="+idmenu; + cPaint.call(p,"",retorna); + //} +} +/* +Function: excluir + +Exclui um registro +*/ +function excluir(prefixo,id,coluna,idnpai) +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + { + if(retorno.data == "erro") + {alert("Não foi possível excluir. Verifique se ainda existem elementos abaixo desse nível")} + if(prefixo == "raiz") + { + $i(idnpai).innerHTML = ""; + pegaTemasRaiz("0",id_nivel,idnpai) + } + if(prefixo == "n1") + { + pegaNosRaiz(); + } + if(prefixo == "n2") + { + $i(prefixo+"_"+idnpai).innerHTML = ""; + pegaNosGrupo(idnpai) + } + if(prefixo == "n3") + { + $i(prefixo+"_"+idnpai).innerHTML = ""; + pegaNosSubGrupo(idnpai) + } + } + if($i(prefixo+"_"+idnpai)) + $i(prefixo+"_"+idnpai).innerHTML = $mensagemAguarde + + if(prefixo == "raiz") + var tabela = "i3geoadmin_raiz" + + if(prefixo == "n1") + var tabela = "i3geoadmin_n1" + + if(prefixo == "n2") + var tabela = "i3geoadmin_n2" + + if(prefixo == "n3") + var tabela = "i3geoadmin_n3" + + var p = "../php/arvore.php?funcao=excluir&id="+id+"&tabela="+tabela+"&coluna="+coluna; + cPaint.call(p,"",retorna); + } +} +/* +Function: excluirRaiz + +Exclui um registro de um tema no nível raiz +*/ +function excluirRaiz(nivel,id_nivel,id_raiz,idnpai) +{ + if(confirm("Você realmente quer fazer isso?")) + { + $i(idnpai).innerHTML = $mensagemAguarde; + var retorna = function(retorno) + { + $i(idnpai).innerHTML = ""; + $temasRaiz = retorno.data; + pegaTemasRaiz(nivel,id_nivel,idnpai) + } + var tabela = "i3geoadmin_raiz" + var p = "../php/arvore.php?funcao=excluir&id="+id_raiz+"&tabela="+tabela+"&coluna=id_raiz"; + cPaint.call(p,"",retorna); + } +} \ No newline at end of file diff --git a/admin/js/atlas.js b/admin/js/atlas.js new file mode 100644 index 0000000..5e0f39b --- /dev/null +++ b/admin/js/atlas.js @@ -0,0 +1,345 @@ +/* +Title: Atlas + +Funções javascript utilizadas no sistema de administração do cadastro de web services + +File: i3geo/admin/atlas.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração + +Ao retornar, por default, executa a função montaParametros() +*/ +function iniciaAdmin() +{ + verificaEditores() + tipos = ["expandida","automatica"] +} +function montaParametros() +{ + if(!$i("resultado")) + {document.body.innerHTML += "
"} + $i("resultado").innerHTML = $mensagemAguarde + var p = "../php/atlas.php?funcao=pegaAtlas"; + cPaint.call(p,"",listaAtlas); +} +/* +Function: listaAtlas + +Monta o html com os parametros e os divs que receberão os dados dos formulários. +*/ +function listaAtlas(retorno) +{ + ins = "

" + montaAtlas(retorno,"resultado") +} +function montaAtlas(retorno,onde) +{ + var d = retorno.data; + var nm = retorno.data.length + for (i=0;i"} + ins += "
+- "+d[i].titulo_atlas+"" + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome",prefixoid:"titulo_",id:"id_atlas",valor:"titulo_atlas"}, + {titulo:"Descrição",prefixoid:"desc_",id:"id_atlas",valor:"desc_atlas"}, + {titulo:"Ícone",prefixoid:"icone_",id:"id_atlas",valor:"icone_atlas"}, + {titulo:"Link",prefixoid:"link_",id:"id_atlas",valor:"link_atlas"}, + {titulo:"Template",prefixoid:"template_",id:"id_atlas",valor:"template_atlas"}, + {titulo:"Prancha aberta",prefixoid:"pranchadefault_",id:"id_atlas",valor:"pranchadefault_atlas"}, + {titulo:"Largura da janela do texto exlicativo",prefixoid:"w_",id:"id_atlas",valor:"w_atlas"}, + {titulo:"Altura",prefixoid:"h_",id:"id_atlas",valor:"h_atlas"}, + {titulo:"Mapfile base",prefixoid:"basemapfile_",id:"id_atlas",valor:"basemapfile_atlas"} + ] + } + ins += (geraLinhas(d[i],param,2)); + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
Tipo das guias:
" + ins += "" + ins += "" + ins += "
" + ins += "
+- Pranchas" + ins += "

" + ins += "
" + ins += "
" + if(!$i(d[i].id_atlas)) + ins += "
" + ins += "
" + } + $i(onde).innerHTML = ins + listaPranchas(retorno) +} +function listaPranchas(retorno) +{ + var d = retorno.data; + var nm = retorno.data.length + for (i=0;i" + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome",prefixoid:"tituloP_",id:"id_prancha",valor:"titulo_prancha"}, + {titulo:"Descrição",prefixoid:"descP_",id:"id_prancha",valor:"desc_prancha"}, + {titulo:"Ícone",prefixoid:"iconeP_",id:"id_prancha",valor:"icone_prancha"}, + {titulo:"Link",prefixoid:"linkP_",id:"id_prancha",valor:"link_prancha"}, + {titulo:"Largura da janela do texto exlicativo",prefixoid:"wP_",id:"id_prancha",valor:"w_prancha"}, + {titulo:"Altura",prefixoid:"hP_",id:"id_prancha",valor:"h_prancha"}, + {titulo:"Extensão geográfica",prefixoid:"mapextP_",id:"id_prancha",valor:"mapext_prancha"} + ] + } + ins += (geraLinhas(d[i].pranchas[j],param,2)); + ins += "
" + ins += "" + ins += "" + ins += "
" + + ins += "
+- Temas" + ins += "

" + ins += "
" + ins += "
" + ins += "

" + } + if(document.getElementById("pranchas_"+d[i].id_atlas)) + {document.getElementById("pranchas_"+d[i].id_atlas).innerHTML = ins} + } + listaTemas(retorno) +} +function listaTemas(retorno) +{ + var d = retorno.data; + var nm = retorno.data.length + for (i=0;i" + ins += "
"; + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
Nome:
Ligado: " + ins += "
" + ins += "" + ins += "" + ins += "
" + ins += "

" + } + if(document.getElementById("temas_"+d[i].pranchas[j].id_prancha)) + {document.getElementById("temas_"+d[i].pranchas[j].id_prancha).innerHTML = ins} + } + } + ativaLegenda() +} + +function alterarTemas(id_tema,id_prancha) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + listaTemas(retorno); + } + if (id_tema != "") + { + var codigo_tema = document.getElementById("codigo_"+id_tema).value + var ligado_tema = document.getElementById("ligado_"+id_tema).value + } + else + { + var id_tema = ""; + var codigo_tema = "" + var ligado_tema = "250" + } + var p = "../php/atlas.php?funcao=alterarTemas&id_prancha="+id_prancha+"&id_tema="+id_tema+"&codigo_tema="+codigo_tema+"&ligado_tema="+ligado_tema + cPaint.call(p,"",retorna); + //} +} +function alterarPranchas(id_prancha,id_atlas) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + listaPranchas(retorno); + } + if (id_prancha != "") + { + var desc_prancha = document.getElementById("descP_"+id_prancha).value + var h_prancha = document.getElementById("hP_"+id_prancha).value + var w_prancha = document.getElementById("wP_"+id_prancha).value + var icone_prancha = document.getElementById("iconeP_"+id_prancha).value + var link_prancha = document.getElementById("linkP_"+id_prancha).value + var titulo_prancha = document.getElementById("tituloP_"+id_prancha).value + var mapext_prancha = document.getElementById("mapextP_"+id_prancha).value + } + else + { + var id_prancha = ""; + var desc_prancha = "" + var h_prancha = "250" + var w_prancha = "250" + var icone_prancha = "" + var link_prancha = "" + var titulo_prancha = ""; + var mapext_prancha = ""; + } + var p = "../php/atlas.php?funcao=alterarPranchas&id_atlas="+id_atlas+"&id_prancha="+id_prancha+"&titulo_prancha="+titulo_prancha+"&desc_prancha="+desc_prancha+"&h_prancha="+h_prancha+"&w_prancha="+w_prancha+"&icone_prancha="+icone_prancha+"&link_prancha="+link_prancha + cPaint.call(p,"",retorna); + //} +} + +function alterarAtlas(id_atlas,onde) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + if(id_atlas == "") + listaAtlas(retorno); + else + {ins = "";montaAtlas(retorno,onde)} + } + if (id_atlas != "") + { + var titulo_atlas = document.getElementById("titulo_"+id_atlas).value + var desc_atlas = document.getElementById("desc_"+id_atlas).value + var h_atlas = document.getElementById("h_"+id_atlas).value + var w_atlas = document.getElementById("w_"+id_atlas).value + var icone_atlas = document.getElementById("icone_"+id_atlas).value + var link_atlas = document.getElementById("link_"+id_atlas).value + var pranchadefault_atlas = document.getElementById("pranchadefault_"+id_atlas).value + var template_atlas = document.getElementById("template_"+id_atlas).value + var tipoguias_atlas = document.getElementById("tipoguias_"+id_atlas).value + var basemapfile_atlas = document.getElementById("basemapfile_"+id_atlas).value + } + else + { + var id_atlas = ""; + var desc_atlas = "" + var h_atlas = "250" + var w_atlas = "250" + var icone_atlas = "" + var link_atlas = "" + var pranchadefault_atlas = "" + var template_atlas = "" + var tipoguias_atlas = "expandida" + var titulo_atlas = ""; + var basemapfile_atlas = ""; + } + var p = "../php/atlas.php?funcao=alterarAtlas&id_atlas="+id_atlas+"&basemapfile_atlas="+basemapfile_atlas+"&titulo_atlas="+titulo_atlas+"&desc_atlas="+desc_atlas+"&h_atlas="+h_atlas+"&w_atlas="+w_atlas+"&icone_atlas="+icone_atlas+"&link_atlas="+link_atlas+"&pranchadefault_atlas="+pranchadefault_atlas+"&template_atlas="+template_atlas+"&tipoguias_atlas="+tipoguias_atlas + cPaint.call(p,"",retorna); + //} +} +function excluir(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + { + if(retorno.data == "erro") + { + alert("Nao foi possivel excluir.Exclua as pranchas primeiro") + } + else + { + $i("resultado").innerHTML = $mensagemAguarde; + montaParametros() + } + } + var p = "../php/atlas.php?funcao=excluir&id="+id; + cPaint.call(p,"",retorna); + } +} +function excluirPranchas(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + { + if(retorno.data == "erro") + { + alert("Nao foi possivel excluir.Exclua os temas primeiro") + } + else + { + $i("resultado").innerHTML = $mensagemAguarde; + montaParametros() + } + } + var p = "../php/atlas.php?funcao=excluirPranchas&id="+id; + cPaint.call(p,"",retorna); + } +} +function excluirTemas(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + $i("resultado").innerHTML = $mensagemAguarde; + var retorna = function() + { + montaParametros() + } + var p = "../php/atlas.php?funcao=excluirTemas&id="+id; + cPaint.call(p,"",retorna); + } +} + +function importarXmlAtlas() +{ + $i("resultado").innerHTML = $mensagemAguarde + var retorna = function(retorno) + {$i("resultado").innerHTML = retorno.data} + var p = "../php/atlas.php?funcao=importarXmlAtlas&xml="+$i("arquivo").value; + cPaint.call(p,"",retorna); +} \ No newline at end of file diff --git a/admin/js/identifica.js b/admin/js/identifica.js new file mode 100644 index 0000000..ce1db04 --- /dev/null +++ b/admin/js/identifica.js @@ -0,0 +1,136 @@ +/* +Title: Identifica + +Funções javascript utilizadas no sistema de administração do cadastro de sistemas da ferramenta identifica + +File: i3geo/admin/webservices.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração + +Ao retornar, por default, executa a função montaParametros() +*/ +function iniciaAdmin() +{ + verificaEditores() +} +function montaParametros() +{ + if(!$i("resultado")) + {document.body.innerHTML += "
"} + $i("resultado").innerHTML = $mensagemAguarde + var p = "../php/identifica.php?funcao=pegaFuncoes"; + cPaint.call(p,"",listaFuncoes); +} +/* +Function: listaFuncoes + +Monta o html com os parametros e os divs que receberão os dados dos formulários. +*/ +function listaFuncoes(retorno) +{ + ins = "

" + montaFuncoes(retorno,"resultado") + +} +function montaFuncoes(retorno,onde) +{ + var d = retorno.data; + var nm = retorno.data.length + for (i=0;i"} + ins += "
+- "+d[i].nome_i+"" + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome",prefixoid:"nome_",id:"id_i",valor:"nome_i"}, + {titulo:"Destino",prefixoid:"destino_",id:"id_i",valor:"target_i"}, + {titulo:"Programa",prefixoid:"abrir_",id:"id_prancha",valor:"abrir_i"} + ] + } + ins += (geraLinhas(d[i],param,2)); + ins += "
" + ins += "" + ins += "" + ins += "
" + ins += "

" + if(!$i(d[i].id_i)) + ins += "" + } + $i(onde).innerHTML = ins + ativaLegenda() +} + +function alterarFuncoes(id,onde) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + if(id == "") + listaFuncoes(retorno); + else + {ins = "";montaFuncoes(retorno,onde)} + } + if (id != "") + { + var nome = $i("nome_"+id).value + var destino = $i("destino_"+id).value + var abrir = $i("abrir_"+id).value + } + else + { + var id = ""; + var destino = "" + var abrir = "" + var nome = "" + } + var p = "../php/identifica.php?funcao=alterarFuncoes&id_i="+id+"&nome_i="+nome+"&target_i="+destino+"&abrir_i="+abrir + cPaint.call(p,"",retorna); + //} +} +function excluir(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + $i("resultado").innerHTML = $mensagemAguarde; + var retorna = function() + { + montaParametros() + } + var p = "../php/identifica.php?funcao=excluir&id="+id; + cPaint.call(p,"",retorna); + } +} +function importarXmlI() +{ + $i("resultado").innerHTML = $mensagemAguarde + var retorna = function(retorno) + {$i("resultado").innerHTML = retorno.data} + var p = "../php/identifica.php?funcao=importarXmlI&xml="+$i("arquivo").value; + cPaint.call(p,"",retorna); +} \ No newline at end of file diff --git a/admin/js/mapas.js b/admin/js/mapas.js new file mode 100644 index 0000000..9ab51cc --- /dev/null +++ b/admin/js/mapas.js @@ -0,0 +1,177 @@ +/* +Title: Arvore + +Funções javascript utilizadas no sistema de administração do menu de mapas + +File: i3geo/admin/mapas.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração + +Ao retornar, por default, executa a função montaParametros() +*/ +function iniciaAdmin() +{ + verificaEditores() +} +function montaParametros() +{ + if(!$i("resultado")) + {document.body.innerHTML += "
"} + $i("resultado").innerHTML = $mensagemAguarde + var p = "../php/mapas.php?funcao=pegaMapas"; + cPaint.call(p,"",listaMapas); +} +/* +Function: listaMapas + +Monta o html com os parametros e os divs que receberão os dados dos formulários. + +Para cada registro na variável $parameters, é montado um formulário. +*/ +function listaMapas(retorno) +{ + ins = "

" + montaMapa(retorno,"resultado") +} +function montaMapa(retorno,onde) +{ + var d = retorno.data; + var nm = retorno.data.length + for (i=0;i" + ins += "
+- "+d[i].nome_mapa+"" + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome",prefixoid:"nome_",id:"id_mapa",valor:"nome_mapa"}, + {titulo:"Descrição",prefixoid:"desc_",id:"id_mapa",valor:"desc_mapa"}, + {titulo:"Perfis",prefixoid:"perfil_",id:"id_mapa",valor:"perfil_mapa"}, + {titulo:"Extensão",prefixoid:"ext_",id:"id_mapa",valor:"ext_mapa"}, + {titulo:"Imagem",prefixoid:"imagem_",id:"id_mapa",valor:"imagem_mapa"}, + {titulo:"Outros",prefixoid:"outros_",id:"id_mapa",valor:"outros_mapa"}, + {titulo:"Direto",prefixoid:"linkdireto_",id:"id_mapa",valor:"linkdireto_mapa"} + ] + } + ins += (geraLinhas(d[i],param,3)); + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
Temas: " + ins += "
Ligados:
" + ins += "" + ins += "" + ins += "
" + if(d[i].linkdireto_mapa != "") + {var l = d[i].linkdireto_mapa;} + else + { + var l = "../ms_criamapa.php?temasa="+d[i].temas_mapa+"&layers="+d[i].ligados_mapa + if (d[i].ext_mapa != "") + {l += "&mapext="+d[i].ext_mapa} + if (d[i].outros_mapa != "") + {l += "&"+d[i].outros_mapa} + } + ins += "
Testar: "+l+"" + if(d[i].imagem_mapa != "") + ins += "
" + ins += "

" + if(!$i(d[i].id_mapa)) + ins += "" + } + $i(onde).innerHTML = ins + ativaLegenda() +} +function adicionaTema(id,codigo) +{ + var valor = $i("temas_"+id).value + if(valor == "") + $i("temas_"+id).value = codigo + else + $i("temas_"+id).value += " "+codigo +} +function alterarMapas(id_mapa,onde) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + if(id_mapa == "") + listaMapas(retorno); + else + {ins = "";montaMapa(retorno,onde)} + } + if (id_mapa != "") + { + var nome = $i("nome_"+id_mapa).value + var desc = $i("desc_"+id_mapa).value + var ext = $i("ext_"+id_mapa).value + var imagem = $i("imagem_"+id_mapa).value + var outros = $i("outros_"+id_mapa).value + var linkdireto = $i("linkdireto_"+id_mapa).value + var temas = $i("temas_"+id_mapa).value + var ligados = $i("ligados_"+id_mapa).value + var perfil = $i("perfil_"+id_mapa).value + } + else + { + var id_mapa = ""; + var perfil = ""; + } + var p = "../php/mapas.php?funcao=alterarMapas&id_mapa="+id_mapa+"&nome="+nome+"&desc="+desc+"&ext="+ext+"&imagem="+imagem+"&outros="+outros+"&linkdireto="+linkdireto+"&temas="+temas+"&ligados="+ligados+"&perfil="+perfil + cPaint.call(p,"",retorna); + //} +} +function excluir(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + $i("resultado").innerHTML = $mensagemAguarde; + var retorna = function() + { + montaParametros() + } + var p = "../php/mapas.php?funcao=excluir&id="+id; + cPaint.call(p,"",retorna); + } +} +function importarXmlMapas() +{ + $i("resultado").innerHTML = $mensagemAguarde + var retorna = function(retorno) + {$i("resultado").innerHTML = retorno.data} + var p = "../php/mapas.php?funcao=importarXmlMapas&xml="+$i("arquivo").value; + cPaint.call(p,"",retorna); +} \ No newline at end of file diff --git a/admin/js/mapfiles.js b/admin/js/mapfiles.js new file mode 100644 index 0000000..bf1856b --- /dev/null +++ b/admin/js/mapfiles.js @@ -0,0 +1,118 @@ +/* +Title: mapfiles + +Funções javascript utilizadas no sistema de administração de mapfiles básicos + +File: i3geo/admin/mapfiles.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração +*/ +function iniciaAdmin() +{ +$parametros = { + "simples": [ + { mensagem: "Arquivo que define as fontes de texto utilizadas",cabeca: "FONTSET", variavel: "FONTSET"}, + { mensagem: "Arquivo que define a simbologia",cabeca: "SYMBOLSET", variavel: "SYMBOLSET"}, + { mensagem: "Diretório com o caminho padrão para arquivos shapefile",cabeca: "SHAPEPATH", variavel: "SHAPEPATH"}, + { mensagem: "Extensão geográfica. Após alterar os valores, clique na imagem para atualizar.",cabeca: "EXTENT", variavel: "EXTENT"}, + { mensagem: "Endereço da imagem de referência",cabeca: "IMAGE", variavel: "IMAGE"}, + { mensagem: "Caminho para o armazenamento das imagens temporárias",cabeca: "IMAGEPATH", variavel: "IMAGEPATH"}, + { mensagem: "Complemento para a url das imagens",cabeca: "IMAGEURL", variavel: "IMAGEURL"} + ]}; + verificaEditores() +} +/* +Function: montaParametros + +Monta o html com os parametros +*/ +function montaParametros() +{ + montaCampos() + pegaParametros() +} +/* + +http://labs.metacarta.com/wms-c/Basic.py?LAYERS=basic&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-70,-40,-30,0&WIDTH=200&HEIGHT=200 + + +Function: pegaParametros + +Pega os parâmetros do mapfiles.php + +*/ +function pegaParametros() +{ + var l = $i("EXTENT").parentNode.parentNode.parentNode + l.innerHTML += "
" + var retorna = function(retorno) + { + for (i=0;i<$parametros.simples.length;i++) + { + if($i($parametros.simples[i].variavel)) + {$i($parametros.simples[i].variavel).value = eval("retorno.data."+$parametros.simples[i].variavel);} + } + maparef() + } + var p = "../php/mapfiles.php?funcao=pegaParametrosConfigura"; + cPaint.call(p,"",retorna); +} +function maparef() +{ + var bb = $i("EXTENT").value.split(" ") + var bb = bb.toString() + $i("mapaRef").innerHTML = "
" +} +/* +Function - restauraPadrao + +Copia o arquivo ms_configura.default para mapfiles.php +*/ +function restauraPadrao() +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + {window.location.reload();} + var p = "../php/mapfiles.php?funcao=restauraConfigura"; + cPaint.call(p,"",retorna); + } +} +/* +Function - salva + +Salva o novo valor de uma variável +*/ +function salva(variavel) +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + {window.location.reload();} + var p = "../php/mapfiles.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value; + cPaint.call(p,"",retorna); + } +} \ No newline at end of file diff --git a/admin/js/menutemas.js b/admin/js/menutemas.js new file mode 100644 index 0000000..204c1d3 --- /dev/null +++ b/admin/js/menutemas.js @@ -0,0 +1,441 @@ +/* +Title: Menutemas + +Funções javascript utilizadas no sistema de administração do menu de temas + +File: i3geo/admin/menutemas.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração +*/ +function iniciaAdmin() +{ + verificaEditores() +} +/* +Function: importarXmlMenu + +Importa um arquivo xml para o banco de dados. + +O xml deve ser estruturado no padrão menutemas.xml +*/ +function importarXmlMenu() +{ + $i("resultado").innerHTML = $mensagemAguarde + var retorna = function(retorno) + {$i("resultado").innerHTML = retorno.data} + var p = "../php/menutemas.php?funcao=importarXmlMenu&nomemenu="+$i("nome").value+"&xml="+$i("arquivo").value; + cPaint.call(p,"",retorna); +} +/* +Function: montaParametros + +Monta o html com os parametros e os divs que receberão os dados dos formulários. + +Para cada registro na variável $parametrs, é montado um formulário. +*/ +function montaParametros() +{ + var ins = "" + for (i=0;i<$parametros.simples.length;i++) + { + ins += "
"+$parametros.simples[i].cabeca+"" + ins += "

" + ins += " Filtro:

" + ins += "

" + ins += "
" + ins += "

"+$parametros.simples[i].mensagem+"

" + ins += "

" + ins += "

" + } + document.body.innerHTML += ins + //pegaParametros() +} +/* +Function: pegaParametros + +Pega os parâmetros do mapfiles.php + +*/ +function pegaParametros(tipo) +{ + if(tipo == "tags" || arguments.length == 0 && $i("tags")) + { + var retornaTags = function(retorno) + { + var r = retorno.data + var ins = ""; + for (i=0;i" + ins += "" + ins += "" + ins += "" + } + ins += "
Nome
" + ins += "
" + ins += "
" + $i("tags").innerHTML = ins; + } + var p = "../php/menutemas.php?funcao=pegaTags"; + cPaint.call(p,"pegaTags",retornaTags); + } + if(tipo == "menus" || arguments.length == 0 && $i("menus")) + { + var retornaMenus = function(retorno) + { + var r = retorno.data + var ins = ""; + for (i=0;i" + ins += "" + ins += "" + ins += "" + ins += "" + } + ins += "
NomeDescriçãoAberto
" + $i("menus").innerHTML = ins; + } + var p = "../php/menutemas.php?funcao=pegaMenus"; + cPaint.call(p,"pegaMenus",retornaMenus); + } + if(tipo == "grupos" || arguments.length == 0 && $i("grupos")) + { + var retornaGrupos = function(retorno) + { + var r = retorno.data + var ins = ""; + for (i=0;i" + var temp = montaDivTemas(r[j]) + ins += temp+"" + } + $i("temas").innerHTML = ins; + ativaLegenda() + } + var p = "../php/menutemas.php?funcao=pegaTemas&filtro="+$i("filtro").value; + cPaint.call(p,"pegaTemas",retornaTemas); + } + + if(tipo == "arvore" || arguments.length == 0 && $i("arvore")) + { + var retornaArvore = function(retorno) + { + var r = retorno.data + var ins = "
NomeDescrição
"; + for (i=0;i" + ins += "" + ins += "" + ins += "" + } + ins += "
NomeDescrição
" + $i("subgrupos").innerHTML = ins; + } + var p = "../php/menutemas.php?funcao=pegaSubXGrupos"; + cPaint.call(p,"pegaSubXGrupos",retornaSubXGrupos); + } +} +/* +Function: montaOpcoes +*/ +function montaOpcoes(prefixo,id,nome,desc,opc) +{ + var ins = "" + ins += "
" + ins += "
" + ins += "" + ins += "" + return (ins) +} +/* +Function: montaDivTemas + +Preenche a div com os dados de um tema específico na edição da lista de temas + +Parameters: + +i - objeto json com os dados para montar o formulário +*/ +function montaDivTemas(i) +{ + var ins = "
+- "+i.nome_tema+"" + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome do tema",prefixoid:"nometema_",id:"id_tema",valor:"nome_tema"}, + {titulo:"Descrição",prefixoid:"desctema_",id:"id_tema",valor:"desc_tema"}, + {titulo:"Link para a fonte",prefixoid:"linktema_",id:"id_tema",valor:"link_tema"} + ] + } + ins += (geraLinhas(i,param,2)); + + ins += "" + + ins += "" + + ins += "" + + ins += "" + + ins += "" + + ins += "
Tags (separe com espaço):" + ins += "" + ins += "
Tipo:" + ins += "
Permite acesso via WMS/WFS?" + ins += "
Permite o download na aplicação datadownload.htm?" + ins += "
Permite acesso via kml?" + ins += "
" + ins += ""; + ins += "" + ins += "
" + + ins += "
" + return(ins) +} +function registraTag(id,tag) +{ + var tags = $i(id).value + if(tag == "") + $i(id).value = tag + else + $i(id).value = $i(id).value+" "+tag +} +/* +Function: alterar + +Altera o valor de uma variável +*/ +function alterar(prefixo,id) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function() + {pegaParametros(prefixo);} + if(prefixo == "tags") + { + if (id != "") + { + var nome = $i("nometag_"+id).value + } + else + { + var nome = ""; + } + $i(prefixo).innerHTML =$mensagemAguarde + var p = "../php/menutemas.php?funcao=alteraTags&nome="+nome+"&id="+id; + //window.open(p) + + } + if(prefixo == "menus") + { + if (id != "") + { + var nome = $i("nomemenu_"+id).value + var desc = $i("descmenu_"+id).value + var aberto = $i("abertomenu_"+id).value + if(nome == "null"){var nome = "";} + if(desc == "null"){var desc = "";} + if(aberto == "null"){var aberto = "";} + } + else + { + var nome = ""; + var desc = ""; + var aberto = ""; + } + $i(prefixo).innerHTML =$mensagemAguarde + var p = "../php/menutemas.php?funcao=alteraMenus&nome="+nome+"&desc="+desc+"&id="+id+"&aberto="+aberto; + } + if(prefixo == "grupos") + { + if (id != "") + { + var nome = $i("nomegrupo_"+id).value + var desc = $i("descgrupo_"+id).value + if(nome == "null"){var nome = "";} + if(desc == "null"){var desc = "";} + } + else + { + var nome = ""; + var desc = ""; + } + $i(prefixo).innerHTML =$mensagemAguarde + var p = "../php/menutemas.php?funcao=alteraGrupos&nome="+nome+"&desc="+desc+"&id="+id; + } + if(prefixo == "subgrupos") + { + if (id != "") + { + var nome = $i("nomesubgrupo_"+id).value + var desc = $i("descsubgrupo_"+id).value + if(nome == "null"){var nome = "";} + if(desc == "null"){var desc = "";} + } + else + { + var nome = ""; + var desc = ""; + } + $i(prefixo).innerHTML =$mensagemAguarde + var p = "../php/menutemas.php?funcao=alteraSubGrupos&nome="+nome+"&desc="+desc+"&id="+id; + } + if(prefixo == "temas") + { + if (id != "") + { + var nome = $i("nometema_"+id).value + var codigo = $i("codigotema_"+id).value + var desc = $i("desctema_"+id).value + var tipoa = $i("tipoatema_"+id).value + var link = $i("linktema_"+id).value + var ogc = $i("ogctema_"+id).value + var kml = $i("kmltema_"+id).value + var download = $i("downloadtema_"+id).value + var tags = $i("tagstema_"+id).value + if(nome == "null"){var nome = "";} + if(codigo == "null"){var codigo = "";} + if(desc == "null"){var desc = "";} + if(tipoa == "null"){var tipoa = "";} + if(link == "null"){var link = "";} + if(ogc == "null"){var ogc = "";} + if(kml == "null"){var kml = "";} + if(download == "null"){var download = "";} + if(tags == "null"){var tags = "";} + } + else + { + var nome = ""; + var codigo = ""; + var desc = ""; + var link = ""; + var tipoa = ""; + var ogc = ""; + var kml = ""; + var download = ""; + var tags = ""; + } + $i(prefixo).innerHTML =$mensagemAguarde + 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; + } + + cPaint.call(p,"",retorna); + //} +} +/* +Function: excluir + +Exclui um registro +*/ +function excluir(prefixo,id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function() + {pegaParametros(prefixo);} + $i(prefixo).innerHTML = $mensagemAguarde + var p = "../php/menutemas.php?funcao=excluirRegistro&id="+id+"&tabela="+prefixo; + cPaint.call(p,"",retorna); + } +} + +/* +Function: pegaMapfiles + +Pega a lista de mapfiles existentes no i3geo + +Parameters: + +retorna - nome da função que processará o resultado +*/ +function pegaMapfiles(retorna) +{ + var cPaint = new cpaint(); + //cPaint.set_async("true"); + cPaint.set_response_type("JSON"); + var p = "../php/menutemas.php?funcao=listaMapsTemas"; + cPaint.call(p,"listaMapsTemas",retorna); +} diff --git a/admin/js/ms_configura.js b/admin/js/ms_configura.js new file mode 100644 index 0000000..42314ae --- /dev/null +++ b/admin/js/ms_configura.js @@ -0,0 +1,117 @@ +/* +Title: Admin + +Funções javascript utilizadas no sistema de administração + +File: i3geo/admin/admin.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração +*/ +function iniciaAdmin() +{ +$parametros = { + "simples": [ + { mensagem: "Mensagem mostrada sempre que o i3geo é inicializado",cabeca: "Mensagem de inicialização", variavel: "$mensagemInicia"}, + { mensagem: "Texto mostrado na barra superior do navegador e em alguns aplicativos do i3geo, como a versão mobile",cabeca: "Título", variavel: "$tituloInstituicao"}, + { mensagem: "Diretório (caminho absoluto) utilizado para armazenar os mapfiles temporários e outros arquivos utilizados durante a operação do i3geo",cabeca: "Diretório temporário", variavel: "$dir_tmp"}, + { mensagem: "Local no servidor (caminho absoluto) onde o i3geo está armazenado",cabeca: "Localização do i3geo", variavel: "$locaplic"}, + { mensagem: "Diretório onde ficam os arquivos mapfiles dos temas disponíveis para uso na guia de adição de temas",cabeca: "Diretório com os temas", variavel: "$temasdir"}, + { mensagem: "Diretório onde ficam armazenados os arquivos de template HTML e mapfiles iniciais",cabeca: "Diretório aplicmap", variavel: "$temasaplic"}, + { mensagem: "Onde está armazenado o mapserv CGI no servidor",cabeca: "Mapserv CGI", variavel: "$locmapserv"}, + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de sistemas que são incluídos na guia de adição de temas",cabeca: "XML sistemas", variavel: "$locsistemas"}, + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de programas especiais executados na ferramenta de identificação",cabeca: "XML identifica", variavel: "$locidentifica"}, + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de mapas que são mostrados na versão mobile e na guia mapas",cabeca: "XML mapas", variavel: "$locmapas"}, + { mensagem: "(opcional) Endereço do arquivo XML ou programa PHP que gera o xml com a lista de atlas e pranchas utilizadas na interface Atlas do i3geo.",cabeca: "XML Atlas", variavel: "$atlasxml"}, + { mensagem: "Caminho onde fica o arquivo executável do software R",cabeca: "Caminho para o R", variavel: "$R_path"}, + { mensagem: "(depreciado) string de conexão com o banco de dados postgis para a realização de cálculos geométricos, como área. Na versão 5.x do mapserver não é mais necessário",cabeca: "Conexão postgis para cálculos", variavel: "$postgis_con"}, + { mensagem: "(depreciado) código da projeção definida no banco de dados postgis para cálculos de área",cabeca: "SRID postgis", variavel: "$srid_area"}, + { mensagem: "(opcional) string de conexão com o banco de dados para substituir o item CONECTION quando o mesmo estiver vazio",cabeca: "Substituição de conexão", variavel: "$postgis_mapa"}, + { mensagem: "sim|nao Define se o desenho da imagem do mapa será feito por meio do CGI ou não. A escolha do uso do CGI ou não deve ser testada para verificar qual a melhor performance em cada instalação.",cabeca: "Utiliza CGI", variavel: "$utilizacgi"}, + { mensagem: "sim|nao Expõe ou não o endereço do arquivo mapfile utilizado no mapa que está sendo usado. Quando essa variável for definida como nao algumas das funcionalidades do i3geo poderão ficar prejudicadas, mas sem comprometimento das funções principais",cabeca: "Expõe o mapfile", variavel: "$expoeMapfile"}, + { mensagem: "Arquivo (PHP) que define a conexão com o banco de dados administrativo. Mantendo esse valor como vazio, o i3geo irá utilizar o banco de dados padrão em SQLITE. Veja i3geo/ms_configura.php e i3geo/admin/conexao.php para maiores informações sobre como utilizar outros bancos de dados.",cabeca: "Conexão com o banco de dados administrativo", variavel: "$conexaoadmin"} + ]}; + verificaEditores() +} +/* +Function: montaParametros + +Monta o html com os parametros +*/ +function montaParametros() +{ + montaCampos() + pegaParametros() +} +/* +Function: pegaParametros + +Pega os parâmetros do ms_configura.php + +*/ +function pegaParametros() +{ + var retorna = function(retorno) + { + for (i=0;i<$parametros.simples.length;i++) + { + if($i($parametros.simples[i].variavel)) + {$i($parametros.simples[i].variavel).value = eval("retorno.data."+$parametros.simples[i].variavel);} + } + document.getElementById("aguarde").style.display="none" + } + var p = "../php/ms_configura.php?funcao=pegaParametrosConfigura"; + cPaint.call(p,"",retorna); +} +/* +Function - restauraPadrao + +Copia o arquivo ms_configura.default para ms_configura.php +*/ +function restauraPadrao() +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + {window.location.reload();} + var p = "../php/ms_configura.php?funcao=restauraConfigura"; + cPaint.call(p,"",retorna); + } +} +/* +Function - salva + +Salva o novo valor de uma variável +*/ +function salva(variavel) +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + {window.location.reload();} + var p = "../php/ms_configura.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value; + cPaint.call(p,"",retorna); + } +} \ No newline at end of file diff --git a/admin/js/sistemas.js b/admin/js/sistemas.js new file mode 100644 index 0000000..6e07ea9 --- /dev/null +++ b/admin/js/sistemas.js @@ -0,0 +1,209 @@ +/* +Title: Sistemas + +Funções javascript utilizadas no sistema de administração do cadastro de web services + +File: i3geo/admin/webservices.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração + +Ao retornar, por default, executa a função montaParametros() +*/ +function iniciaAdmin() +{ + verificaEditores() +} +function montaParametros() +{ + if(!$i("resultado")) + {document.body.innerHTML += "
"} + $i("resultado").innerHTML = $mensagemAguarde + var p = "../php/sistemas.php?funcao=pegaSistemas"; + cPaint.call(p,"",listaSistemas); +} +/* +Function: listaSistemas + +Monta o html com os parametros e os divs que receberão os dados dos formulários. +*/ +function listaSistemas(retorno) +{ + ins = "

" + montaSistemas(retorno,"resultado") +} +function montaSistemas(retorno,onde) +{ + var d = retorno.data; + var nm = retorno.data.length + for (i=0;i"} + ins += "
+- "+d[i].nome_sistema+"" + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome",prefixoid:"nome_",id:"id_sistema",valor:"nome_sistema"}, + {titulo:"Perfil",prefixoid:"perfil_",id:"id_sistema",valor:"perfil_sistema"} + ] + } + ins += (geraLinhas(d[i],param,2)); + ins += "
" + ins += "" + ins += "" + ins += "
" + + ins += "
+- Funções" + ins += "

" + var nf = d[i].funcoes.length + for (j=0;j" + var func = d[i].funcoes[j] + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome da função",prefixoid:"nomefuncao_",id:"id_funcao",valor:"nome_funcao"}, + {titulo:"Perfil",prefixoid:"perfilfuncao_",id:"id_funcao",valor:"perfil_funcao"}, + {titulo:"Abrir programa",prefixoid:"abrir_",id:"id_funcao",valor:"abrir_funcao"}, + {titulo:"Largura da janela",prefixoid:"w_",id:"id_funcao",valor:"w_funcao"}, + {titulo:"Altura",prefixoid:"h_",id:"id_funcao",valor:"h_funcao"} + ] + } + ins += (geraLinhas(func,param,2)); + ins += "
" + ins += "" + ins += "" + ins += "
" + ins += "

" + ins += "
" + } + ins += "
" + ins += "
" + if(!$i(d[i].id_sistema)) + ins += "
" + } + $i(onde).innerHTML = ins + ativaLegenda() +} +function alterarFuncoes(id_funcao,id_sistema) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + if(id_funcao == "") + listaSistemas(retorno); + else + {ins = "";montaSistemas(retorno,id_sistema)} + } + if (id_funcao != "") + { + var nomefuncao = $i("nomefuncao_"+id_funcao).value + var perfil = $i("perfilfuncao_"+id_funcao).value + var abrir = $i("abrir_"+id_funcao).value + var w = $i("w_"+id_funcao).value + var h = $i("h_"+id_funcao).value + } + else + { + //var id_sistema = ""; + var id_funcao = "" + var nomefuncao = "" + var perfil = "" + var abrir = "" + var w = 200 + var h = 200 + } + 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 + cPaint.call(p,"",retorna); + //} +} +function alterarSistemas(id_sistema,onde) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + if(id_sistema == "") + listaSistemas(retorno); + else + {ins = "";montaSistemas(retorno,onde)} + } + if (id_sistema != "") + { + var nome = $i("nome_"+id_sistema).value + var perfil = $i("perfil_"+id_sistema).value + } + else + { + var id_sistema = ""; + var nome = "" + var perfil = "" + } + var p = "../php/sistemas.php?funcao=alterarSistemas&id_sistema="+id_sistema+"&nome="+nome+"&perfil="+perfil + cPaint.call(p,"",retorna); + //} +} +function excluir(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + var retorna = function(retorno) + { + if(retorno.data=="erro") + {alert("Não foi possivel excluir. Exclua as funcoes primeiro");} + else + { + $i("resultado").innerHTML = $mensagemAguarde; + montaParametros() + } + } + var p = "../php/sistemas.php?funcao=excluir&id="+id; + cPaint.call(p,"",retorna); + } +} +function excluirFuncoes(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + $i("resultado").innerHTML = $mensagemAguarde; + var retorna = function() + { + montaParametros() + } + var p = "../php/sistemas.php?funcao=excluirFuncoes&id="+id; + cPaint.call(p,"",retorna); + } +} +function importarXmlSistemas() +{ + $i("resultado").innerHTML = $mensagemAguarde + var retorna = function(retorno) + {$i("resultado").innerHTML = retorno.data} + var p = "../php/sistemas.php?funcao=importarXmlSistemas&xml="+$i("arquivo").value; + cPaint.call(p,"",retorna); +} \ No newline at end of file diff --git a/admin/js/temas.js b/admin/js/temas.js new file mode 100644 index 0000000..8bd1e11 --- /dev/null +++ b/admin/js/temas.js @@ -0,0 +1,791 @@ +/* +Title: Arvore + +Funções javascript utilizadas no sistema de administração do menu de mapas + +File: i3geo/admin/mapas.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +contaN = 0; +objcontype = [ + {texto:"MS_INLINE",valor:"0"}, + {texto:"MS_SHAPEFILE",valor:"1"}, + {texto:"MS_TILED_SHAPEFILE",valor:"2"}, + {texto:"MS_SDE",valor:"3"}, + {texto:"MS_OGR",valor:"4"}, + {texto:"MS_TILED_OGR",valor:"5"}, + {texto:"MS_POSTGIS",valor:"6"}, + {texto:"MS_WMS",valor:"7"}, + {texto:"MS_ORACLESPATIAL",valor:"8"}, + {texto:"MS_WFS",valor:"9"}, + {texto:"MS_GRATICULE",valor:"10"}, + {texto:"MS_MYGIS",valor:"11"}, + {texto:"MS_RASTER",valor:"12"}, + {texto:"MS_PLUGIN",valor:"13"} +]; +objbool_tf = [ + {texto:"MS_TRUE",valor:"0"}, + {texto:"MS_FALSE",valor:"1"} +]; +objbool_of = [ + {texto:"MS_ON",valor:"2"}, + {texto:"MS_OFF",valor:"3"} +]; +objbool_yn = [ + {texto:"MS_YES",valor:"4"}, + {texto:"MS_NO",valor:"5"} +]; +objmapunits = [ + {texto:"MS_INCHES",valor:"0"}, + {texto:"MS_FEET",valor:"1"}, + {texto:"MS_MILES",valor:"2"}, + {texto:"MS_METERS",valor:"3"}, + {texto:"MS_KILOMETERS",valor:"4"}, + {texto:"MS_DD",valor:"5"}, + {texto:"MS_PIXELS",valor:"6"} +]; +objlayertypes = [ + {texto:"MS_LAYER_POINT",valor:"0"}, + {texto:"MS_LAYER_LINE",valor:"1"}, + {texto:"MS_LAYER_POLYGON",valor:"2"}, + {texto:"MS_LAYER_RASTER",valor:"3"}, + {texto:"MS_LAYER_ANNOTATION",valor:"4"}, + {texto:"MS_LAYER_QUERY",valor:"5"}, + {texto:"MS_LAYER_CIRCLE",valor:"6"}, + {texto:"MS_LAYER_TILEINDEX",valor:"7"}, + {texto:"MS_LAYER_CHART",valor:"8"} +]; +objstatus = [ + {texto:"MS_ON",valor:"1"}, + {texto:"MS_OFF",valor:"0"}, + {texto:"MS_DEFAULT",valor:"2"} +]; +objfonttypes = [ + {texto:"MS_TRUETYPE",valor:"0"}, + {texto:"MS_BITMAP",valor:"1"} +]; +objposition = [ + {texto:"MS_UL",valor:"0"}, + {texto:"MS_LR",valor:"1"}, + {texto:"MS_UR",valor:"2"}, + {texto:"MS_LL",valor:"3"}, + {texto:"MS_CR",valor:"4"}, + {texto:"MS_CL",valor:"5"}, + {texto:"MS_UC",valor:"6"}, + {texto:"MS_WMS",valor:"7"}, + {texto:"MS_LC",valor:"8"}, + {texto:"MS_CC",valor:"9"}, + {texto:"MS_AUTO",valor:"10"}, + {texto:"MS_XY",valor:"11"}, + {texto:"MS_FOLLOW",valor:"12"} +]; +objfontstyle = [ + {texto:"MS_TINY",valor:"0"}, + {texto:"MS_SMALL",valor:"1"}, + {texto:"MS_MEDIUM",valor:"2"}, + {texto:"MS_LARGE",valor:"3"}, + {texto:"MS_GIANT",valor:"4"}, +]; +objshapetype = [ + {texto:"MS_SHAPE_POINT",valor:"0"}, + {texto:"MS_SHAPE_LINE",valor:"1"}, + {texto:"MS_SHAPE_POLYGON",valor:"2"}, + {texto:"MS_SHAPE_NULL",valor:"3"} +]; +objshapefiletype = [ + {texto:"MS_SHP_POINT",valor:"0"}, + {texto:"MS_SHP_ARC",valor:"1"}, + {texto:"MS_SHP_POLYGON",valor:"2"}, + {texto:"MS_SHP_MULTIPOINT",valor:"3"} +]; +objalignment = [ + {texto:"MS_ALIGN_LEFT",valor:"0"}, + {texto:"MS_ALIGN_CENTER",valor:"1"}, + {texto:"MS_ALIGN_RIGHT",valor:"2"} +]; + +$i = function(i) +{return document.getElementById(i);}; + +var retorna = function(retorno) +{ + fontes = retorno.data; +} +var p = "../php/temas.php?funcao=pegaFontes"; +cPaint.call(p,"",retorna); + +function iniciaAdmin() +{ + verificaEditores() +} +function montaParametros() +{ + var retorna = function(retorno) + { + ins = "" + $i("arquivoAtivo").innerHTML = ins + } + var p = "../php/menutemas.php?funcao=pegaTemas"; + cPaint.call(p,"",retorna); +} +function adicionarLayer() +{ + var codigoMap = $i("temaAtivo").value + if(codigoMap != "") + { + var retorna = function(retorno) + { + ativaTema(codigoMap) + } + var p = "../php/temas.php?funcao=criarNovoLayer&codigoMap="+codigoMap; + cPaint.call(p,"",retorna); + } +} +function criarNovoMap() +{ + var nome = $i("nomeNovoMap").value + var codigo = $i("codigoNovoMap").value + if(nome != "" && codigo != "") + { + var retorna = function(retorno) + { + $i("nomeNovoMap").value = "" + $i("codigoNovoMap").value = "" + $i("forms").style.display="none" + montaParametros() + } + var p = "../php/temas.php?funcao=criarNovoMap&nome="+nome+"&codigo="+codigo; + cPaint.call(p,"",retorna); + } +} +function ativaTema(codigoMap) +{ + var retorna = function(retorno) + { + var cl = retorno.data.layers + var ins = "" + for(c=0;c
" + ins += "
" + ins += "
" + ins += "
" + ins += "
" + ins += "
" + ins += "
" + + ins += "
" + } + $i("forms").innerHTML = ins + var ins = "" + for(c=0;c

" + ins += "
+- Legenda (amostra)
" + ins += "" + ins += "
" + var retorna = function(retorna) + { + var nc = retorna.data.length + for(c=0;c
" + ins += "

" + ins += "
+- status
" + ins += "

Sets the current display status of the class. Default turns the class on.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- expression
" + ins += "

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.
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).
Regular expressions function just like previous versions of MapServer. However, you must now delimit a regular expression using /regex/. No quotes should be used.

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.
One string function exists: length(). This obviously computes the length of a string. An example follows:
EXPRESSION (length('[NAME_E]') < 8)
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.

" + ins += "

" + ins += "" + ins += "

" + + ins += (geraLinhas2(d.dados,param,"salvarClasse")); + + var param = { + "linhas":[ + {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).", + titulo:"keyimage",prefixoid:"keyimage_",id:codigoLayer+"_"+d.id,valor:"keyimage"}, + {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.", + titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer+"_"+d.id,valor:"maxscale"}, + {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.", + titulo:"minscale",prefixoid:"minscale_",id:codigoLayer+"_"+d.id,valor:"minscale"}, + {texto:"Maximum size in pixels to draw a symbol. Default is 50.", + titulo:"maxsize",prefixoid:"maxsize_",id:codigoLayer+"_"+d.id,valor:"maxsize"}, + {texto:"Minimum size in pixels to draw a symbol. Default is 0.", + titulo:"minsize",prefixoid:"minsize_",id:codigoLayer+"_"+d.id,valor:"minsize"}, + {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.", + titulo:"size",prefixoid:"size_",id:codigoLayer+"_"+d.id,valor:"size"}, + {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]).", + titulo:"text",prefixoid:"text_",id:codigoLayer+"_"+d.id,valor:"text"} + ] + } + + ins += "
+- Mais...
" + ins += (geraLinhas2(d.dados,param,"salvarClasse")); + ins += "
" + //labels + ins += "
+- Label (para ativar, defina LABELITEM em caract. gerais)
" + var param = { + "linhas":[ + {texto:"Color to draw text with.", + titulo:"color",prefixoid:"label_color_",id:codigoLayer+"_"+d.id,valor:"label.color"}, + {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.", + titulo:"size",prefixoid:"label_size_",id:codigoLayer+"_"+d.id,valor:"label.size"}, + {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.", + titulo:"position",prefixoid:"label_position_",id:codigoLayer+"_"+d.id,valor:"label.position"}, + {texto:"Padding, in pixels, around labels. Useful for maintaining spacing around text to enhance readability. Available only for cached labels. Default is 0.", + titulo:"buffer",prefixoid:"label_buffer_",id:codigoLayer+"_"+d.id,valor:"label.buffer"} + ] + } + + ins += "
+- font
" + ins += "

Font alias (as defined in the FONTSET) to use for labeling.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- type
" + ins += "

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.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- partials
" + ins += "

Can text run off the edge of the map? Default is true.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- force
" + ins += "

Forces labels for a particular class on, regardless of collisions. Available only for cached labels. Default is false.

" + ins += "

" + ins += "" + ins += "

" + + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); + var param = { + "linhas":[ + {texto:"Color to draw a background rectangle (i.e. billboard). Off by default.", + titulo:"backgroundcolor",prefixoid:"label_backgroundcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundcolor"}, + {texto:"Color to draw a background rectangle (i.e. billboard) shadow. Off by default.", + titulo:"backgroundshadowcolor",prefixoid:"label_backgroundshadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowcolor"}, + {texto:"Color to draw a one pixel outline around the text.", + titulo:"outlinecolor",prefixoid:"label_outlinecolor_",id:codigoLayer+"_"+d.id,valor:"label.outlinecolor"}, + {texto:"Color of drop shadow.", + titulo:"shadowcolor",prefixoid:"label_shadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.shadowcolor"}, + {texto:"Shadow offset in pixels.", + titulo:"shadowsizex",prefixoid:"label_shadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizex"}, + {texto:"Shadow offset in pixels.", + titulo:"shadowsizey",prefixoid:"label_shadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizey"}, + {texto:"How far should the background rectangle be offset? Default is 1.", + titulo:"backgroundshadowsizex",prefixoid:"label_backgroundshadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizex"}, + {texto:"How far should the background rectangle be offset? Default is 1.", + titulo:"backgroundshadowsizey",prefixoid:"label_backgroundshadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizey"}, + {texto:"Minimum font size to use when scaling text (pixels). Default is 4.", + titulo:"minsize",prefixoid:"label_minsize_",id:codigoLayer+"_"+d.id,valor:"label.minsize"}, + {texto:"Maximum font size to use when scaling text (pixels). Default is 256.", + titulo:"maxsize",prefixoid:"label_maxsize_",id:codigoLayer+"_"+d.id,valor:"label.maxsize"}, + {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.", + titulo:"offsetx",prefixoid:"label_offsetx_",id:codigoLayer+"_"+d.id,valor:"label.offsetx"}, + {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.", + titulo:"offsety",prefixoid:"label_offsety_",id:codigoLayer+"_"+d.id,valor:"label.offsety"}, + {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", + titulo:"angle",prefixoid:"label_angle_",id:codigoLayer+"_"+d.id,valor:"label.angle"}, + {texto:"Should text be antialiased? Note that this requires more available colors, decreased drawing performance, and results in slightly larger output images.", + titulo:"antialias",prefixoid:"label_antialias_",id:codigoLayer+"_"+d.id,valor:"label.antialias"}, + {texto:"Character that represents an end-of-line condition in label text, thus resulting in a multi-line label.", + titulo:"wrap",prefixoid:"label_wrap_",id:codigoLayer+"_"+d.id,valor:"label.wrap"}, + {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.", + titulo:"minfeaturesize",prefixoid:"label_minfeaturesize_",id:codigoLayer+"_"+d.id,valor:"label.minfeaturesize"}, + {texto:"Minimum distance between duplicate labels. Given in pixels.", + titulo:"mindistance",prefixoid:"label_mindistance_",id:codigoLayer+"_"+d.id,valor:"label.mindistance"}, + {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.", + titulo:"encoding",prefixoid:"label_encoding_",id:codigoLayer+"_"+d.id,valor:"label.encoding"} + ] + } + ins += "
+- Mais...
" + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); + ins += "
" + + ins += "
" + + ins += "
+- Estilos
" + ins += "

" + ins += "
" + ins += "
" + ins += "
" + } + ins += "" + $i("classes_"+codigoLayer+"_"+codigoMap).innerHTML = ins + pegaEstilos(codigoMap,codigoLayer) + } + var p = "../php/temas.php?funcao=pegaClasses&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + cPaint.call(p,"",retorna); + +} +function pegaEstilos(codigoMap,codigoLayer) +{ + var retorna = function(retorno) + { + var nc = retorno.data.length + for(c=0;c" + ins += (geraLinhas2(d,param,"salvarEstilo")); + + var param = { + "linhas":[ + {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.", + titulo:"minsize",prefixoid:"",id:"minsize_"+preid,valor:"minsize"}, + {texto:"Maximum size in pixels to draw a symbol. Default is 50.", + titulo:"maxsize",prefixoid:"",id:"maxsize_"+preid,valor:"maxsize"}, + {texto:"Offset values for shadows, hollow symbols, etc ...", + titulo:"offsetx",prefixoid:"",id:"offsetx_"+preid,valor:"offsetx"}, + {texto:"Offset values for shadows, hollow symbols, etc ...", + titulo:"offsety",prefixoid:"",id:"offsety_"+preid,valor:"offsety"}, + {texto:"Should TrueType fonts and Cartoline symbols be antialiased.", + titulo:"antialias",prefixoid:"",id:"antialias_"+preid,valor:"antialias"}, + {texto:"Minimum width in pixels to draw the line work.", + titulo:"minwidth",prefixoid:"",id:"minwidth_"+preid,valor:"minwidth"}, + {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.", + titulo:"angle",prefixoid:"",id:"angle_"+preid,valor:"angle"}, + {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.", + titulo:"angleitem",prefixoid:"",id:"angleitem_"+preid,valor:"angleitem"}, + {texto:"For MapServer versions <5, this is the attribute/field that stores the size to be used in rendering. Value is given in pixels.", + titulo:"sizeitem",prefixoid:"",id:"sizeitem_"+preid,valor:"sizeitem"} + ] + } + ins += "
+- Mais...
" + ins += (geraLinhas2(d,param,"salvarEstilo")); + ins += "
" + ins += "" + $i(divestilos).innerHTML = ins + } + } + ativaLegenda() + } + var p = "../php/temas.php?funcao=pegaEstilos&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + cPaint.call(p,"",retorna); +} +function pegaMetadados(codigoMap,codigoLayer) +{ + var ins = "
+- Metadados
" + var retorna = function(retorna) + { + ins += ""; + var param = { + "linhas":[ + {texto:"Nome que será utilizado na legenda do mapa e na guia 'Temas'", + titulo:"tema",prefixoid:"tema_",id:codigoLayer,valor:"tema"}, + {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.", + titulo:"escala",prefixoid:"escala_",id:codigoLayer,valor:"escala"}, + {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", + titulo:"extensao",prefixoid:"extensao_",id:codigoLayer,valor:"extensao"} + ] + } + ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); + + ins += "
+- aplicaextensao
" + ins += "

Indica se a extensão geográfica do mapa deve ser alterada quando o tema for adicionado ao mapa

" + ins += "

" + ins += "" + ins += "

" + + + ins += "
+- download
" + ins += "

Indica se o usuário pode fazer download do tema

" + ins += "

" + ins += "" + ins += "

" + + var param = { + "linhas":[ + {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.", + titulo:"itens",prefixoid:"itens_",id:codigoLayer,valor:"itens"}, + {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.", + titulo:"itensdesc",prefixoid:"itensdesc_",id:codigoLayer,valor:"itensdesc"}, + {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:
ITENS 'codigo,nome2,uf'
ITENSDESC 'codigo do IBGE,nome do município,uf'
ITENSLLINK ',http://www.ibge.gov.br/munic2001/tabelas.php?codmun=[codigo]&descricao=[nome],'", + titulo:"itenslink",prefixoid:"itenslink_",id:codigoLayer,valor:"itenslink"}, + {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 ','.", + titulo:"tip",prefixoid:"tip_",id:codigoLayer,valor:"tip"}, + {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.", + titulo:"mensagem",prefixoid:"mensagem_",id:codigoLayer,valor:"mensagem"}, + {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.
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.", + titulo:"classesitem",prefixoid:"classesitem_",id:codigoLayer,valor:"classesitem"}, + {texto:"Nome da coluna que será utilizada para compor o nome das classes geradas automaticamente.", + titulo:"classesnome",prefixoid:"classesnome_",id:codigoLayer,valor:"classesnome"}, + {texto:"Nome da coluna que definirá a cor do símbolo utilizado em cada classe. As cores devem ser definidas em RGB.", + titulo:"classescor",prefixoid:"classescor_",id:codigoLayer,valor:"classescor"}, + {texto:"Nome da coluna que definirá o símbolo utilizado em cada classe.", + titulo:"classessimbolo",prefixoid:"classessimbolo_",id:codigoLayer,valor:"classessimbolo"}, + {texto:"Nome da coluna que definirá o tamanho de cada símbolo.", + titulo:"classestamanho",prefixoid:"classestamanho_",id:codigoLayer,valor:"classestamanho"} + ] + } + + + ins += "
+- Mais...
" + + ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); + + ins += "
+- classe
" + ins += "

Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- escondido
" + ins += "

Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- identifica
" + ins += "

Indica se o tema irá ser mostrado na ferramenta de identificação

" + ins += "

" + ins += "" + ins += "

" + + ins += "
" + + $i("metadados_"+codigoLayer+"_"+codigoMap).innerHTML = ins + } + var p = "../php/temas.php?funcao=pegaMetadados&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + cPaint.call(p,"",retorna); +} +function pegaCaracteristicasGerais(codigoMap,codigoLayer) +{ + var ins = "

" + ins += "
+- Características gerais
" + var retorna = function(retorna) + { + var param = { + "linhas":[ + {texto:"Layer name", + titulo:"name",prefixoid:"name_",id:codigoLayer,valor:"name"}, + {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]", + titulo:"connection",prefixoid:"connection_",id:codigoLayer,valor:"connection"}, + {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 ' from ', 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.", + titulo:"data",prefixoid:"data_",id:codigoLayer,valor:"data"} + ] + } + ins += "

Colunas: "+retorna.data.colunas+"

" + ins += "
+- status
" + ins += "

Sets the current status of the layer. Often modified by MapServer itself. Default turns the layer on permanently.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- type
" + ins += "

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.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
+- connectiontype
" + ins += "

Type of connection. Default is local.

" + ins += "

" + ins += "" + ins += "

" + + ins += (geraLinhas2(retorna.data,param,"salvarLayer")); + + + var param = { + "linhas":[ + {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.", + titulo:"group",prefixoid:"group_",id:codigoLayer,valor:"group"}, + {texto:"Item that contains the location of an individual tile, default is 'location'.", + titulo:"tileitem",prefixoid:"tileitem_",id:codigoLayer,valor:"tileitem"}, + {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.", + titulo:"tileindex",prefixoid:"tileindex_",id:codigoLayer,valor:"tileindex"}, + {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.", + titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer,valor:"maxscale"}, + {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.", + titulo:"minscale",prefixoid:"minscale_",id:codigoLayer,valor:"minscale"}, + {texto:"Sets the color index to treat as transparent for raster layers.", + titulo:"offsite (R,G,B)",prefixoid:"offsite_",id:codigoLayer,valor:"offsite"}, + {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.", + titulo:"opacity",prefixoid:"opacity_",id:codigoLayer,valor:"opacity"}, + {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", + titulo:"filter",prefixoid:"filter_",id:codigoLayer,valor:"filter"}, + {texto:"Item to use with simple FILTER expressions. OGR and shapefiles only.", + titulo:"filteritem",prefixoid:"filteritem_",id:codigoLayer,valor:"filteritem"}, + {texto:"Item name in attribute table to use for class annotation angles. Values should be in degrees.", + titulo:"labelangleitem",prefixoid:"labelangleitem_",id:codigoLayer,valor:"labelangleitem"}, + {texto:"Item name in attribute table to use for class annotation (i.e. labeling).", + titulo:"labelitem",prefixoid:"labelitem_",id:codigoLayer,valor:"labelitem"}, + {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.", + titulo:"labelmaxscale",prefixoid:"labelmaxscale_",id:codigoLayer,valor:"labelmaxscale"}, + {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.", + titulo:"labelminscale",prefixoid:"labelminscale_",id:codigoLayer,valor:"labelminscale"}, + {texto:"Item name in attribute table to use for class annotation sizes. Values should be in pixels.", + titulo:"labelsizeitem",prefixoid:"labelsizeitem_",id:codigoLayer,valor:"labelsizeitem"}, + {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.", + titulo:"symbolscale",prefixoid:"symbolscale_",id:codigoLayer,valor:"symbolscale"}, + {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.", + titulo:"tolerance",prefixoid:"tolerance_",id:codigoLayer,valor:"tolerance"}, + {texto:" ", + titulo:"projection",prefixoid:"projection_",id:codigoLayer,valor:"projection"} + ] + } + + + ins += "
+- Mais...
" + ins += (geraLinhas2(retorna.data,param,"salvarLayer")); + + ins += "
+- sizeunits
" + ins += "

Sets the unit of CLASS object SIZE values (default is pixels). Useful for simulating buffering.

" + ins += "

" + ins += "" + ins += "

" + + ins += "
" + + ins += "
" + $i("geral_"+codigoLayer+"_"+codigoMap).innerHTML = ins + } + var p = "../php/temas.php?funcao=pegaCaracteristicasGerais&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + cPaint.call(p,"",retorna); +} +function testarMap() +{ + var codigo = $i("temaAtivo").value + window.open("../testamapfile.php?map="+codigo+".map") +} +function salvarLayer(layer,parametro,icone) +{ + icone.src="../imagens/aguarde.gif" + var retorna = function(retorno) + {icone.src="../imagens/02.png";} + var valor = $i(parametro+"_"+layer).value + $i(parametro+"_"+layer).style.color="black" + var p = "../php/temas.php?funcao=alteraLayer&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; + cPaint.call(p,"",retorna); +} +function salvarMetadados(layer,parametro,icone) +{ + icone.src="../imagens/aguarde.gif" + var retorna = function(retorno) + {icone.src="../imagens/02.png";} + var valor = $i(parametro+"_"+layer).value + $i(parametro+"_"+layer).style.color="black" + var p = "../php/temas.php?funcao=alteraMetadados&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; + cPaint.call(p,"",retorna); +} +function salvarClasse(layer,parametro,icone) +{ + icone.src="../imagens/aguarde.gif" + var temp = layer.split("_") + var layer = temp[0] + var classe = temp[1] + var retorna = function(retorno) + { + icone.src="../imagens/02.png"; + contaN++ + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN + } + var valor = $i(parametro+"_"+layer+"_"+classe).value + $i(parametro+"_"+layer+"_"+classe).style.color="black" + var p = "../php/temas.php?funcao=alteraClasse&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; + cPaint.call(p,"",retorna); +} +function salvarClasseLabel(layer,parametro,icone) +{ + icone.src="../imagens/aguarde.gif" + var temp = layer.split("_") + var layer = temp[0] + var classe = temp[1] + var parametro = parametro.split("."); + var parametro = parametro[1] + var retorna = function(retorno) + {icone.src="../imagens/02.png";} + var valor = $i("label_"+parametro+"_"+layer+"_"+classe).value + $i("label_"+parametro+"_"+layer+"_"+classe).style.color="black" + var p = "../php/temas.php?funcao=alteraClasseLabel&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; + cPaint.call(p,"",retorna); +} +function salvarEstilo(estilo,parametro,icone) +{ + icone.src="../imagens/aguarde.gif" + var temp = estilo.split("_") + var layer = temp[1] + var classe = temp[2] + var estilo = temp[3] + var retorna = function(retorno) + { + icone.src="../imagens/02.png"; + contaN++ + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN + } + var valor = $i(parametro+"_"+layer+"_"+classe+"_"+estilo).value + $i(parametro+"_"+layer+"_"+classe+"_"+estilo).style.color="black" + var p = "../php/temas.php?funcao=alteraEstilo&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"&estilo="+estilo+"¶metro="+parametro+"&valor="+valor; + cPaint.call(p,"",retorna); +} +function adicionarClasse(codigoLayer,botao) +{ + botao.style.color="red" + var o = botao.value + botao.value = "Aguarde..." + var codigoMap = $i("temaAtivo").value + if(codigoMap != "") + { + var retorna = function(retorno) + { + pegaClasses(codigoMap,codigoLayer) + } + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + cPaint.call(p,"",retorna); + } +} +function adicionarEstilo(codigoLayer,codigoClasse,botao) +{ + botao.style.color="red" + var o = botao.value + botao.value = "Aguarde..." + var codigoMap = $i("temaAtivo").value + if(codigoMap != "") + { + var retorna = function(retorno) + { + pegaEstilos(codigoMap,codigoLayer) + } + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; + cPaint.call(p,"",retorna); + } +} +function excluirClasse(codigoLayer,codigoClasse,botao) +{ + if(confirm("Você realmente quer fazer isso?")) + { + botao.style.color="red" + var o = botao.value + botao.value = "Aguarde..." + var codigoMap = $i("temaAtivo").value + if(codigoMap != "") + { + var retorna = function(retorno) + { + pegaClasses(codigoMap,codigoLayer) + } + var p = "../php/temas.php?funcao=excluirClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; + cPaint.call(p,"",retorna); + } + } +} +function excluirLayer(codigoLayer,botao) +{ + if(confirm("Você realmente quer fazer isso?")) + { + botao.style.color="red" + var o = botao.value + botao.value = "Aguarde..." + var codigoMap = $i("temaAtivo").value + if(codigoMap != "") + { + var retorna = function(retorno) + { + ativaTema(codigoMap) + } + var p = "../php/temas.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; + cPaint.call(p,"",retorna); + } + } +} \ No newline at end of file diff --git a/admin/js/webservices.js b/admin/js/webservices.js new file mode 100644 index 0000000..f5fd020 --- /dev/null +++ b/admin/js/webservices.js @@ -0,0 +1,155 @@ +/* +Title: Arvore + +Funções javascript utilizadas no sistema de administração do cadastro de web services + +File: i3geo/admin/webservices.js + +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +/* +Function: iniciaAdmin + +Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração + +Ao retornar, por default, executa a função montaParametros() +*/ +function iniciaAdmin() +{ + verificaEditores() +} +function montaParametros() +{ + if(!$i("resultado")) + {document.body.innerHTML += "
"} + $i("resultado").innerHTML = $mensagemAguarde + var p = "../php/webservices.php?funcao=pegaWS"; + cPaint.call(p,"",listaWS); +} +/* +Function: listaWS + +Monta o html com os parametros e os divs que receberão os dados dos formulários. +*/ +function listaWS(retorno) +{ + ins = "

" + montaWS(retorno,"resultado") +} +function montaWS(retorno,onde) +{ + var d = retorno.data; + var nm = retorno.data.length + for (i=0;i"} + ins += "
+- "+d[i].nome_ws+"" + ins += "
"; + var param = { + "linhas":[ + {titulo:"Nome",prefixoid:"nome_",id:"id_ws",valor:"nome_ws"}, + {titulo:"Descrição",prefixoid:"desc_",id:"id_ws",valor:"desc_ws"}, + {titulo:"Autor",prefixoid:"autor_",id:"id_ws",valor:"autor_ws"}, + {titulo:"Endereço",prefixoid:"link_",id:"id_ws",valor:"link_ws"}, + {titulo:"Nome",prefixoid:"nome_",id:"id_ws",valor:"nome_ws"} + ] + } + ins += (geraLinhas(d[i],param,2)); + ins += "" + ins += "" + ins += "" + ins += "" + ins += "
Tipo: " + ins += "
" + ins += "" + ins += "" + ins += "
" + ins += "

" + if(!$i(d[i].id_ws)) + ins += "
" + } + $i(onde).innerHTML = ins + ativaLegenda() +} +function adicionaTema(id,codigo) +{ + var valor = $i("temas_"+id).value + if(valor == "") + $i("temas_"+id).value = codigo + else + $i("temas_"+id).value += " "+codigo +} +function alterarWS(id_ws,onde) +{ + //if(confirm("Você realmente quer fazer isso?")) + //{ + var retorna = function(retorno) + { + if(id_ws == "") + listaWS(retorno); + else + {ins = "";montaWS(retorno,onde)} + } + if (id_ws != "") + { + var nome = $i("nome_"+id_ws).value + var desc = $i("desc_"+id_ws).value + var autor = $i("autor_"+id_ws).value + var link = $i("link_"+id_ws).value + var tipo = $i("tipo_"+id_ws).value + } + else + { + var id_ws = ""; + var nome = "" + var desc = "" + var autor = "" + var link = "" + var tipo = "" + } + var p = "../php/webservices.php?funcao=alterarWS&id_ws="+id_ws+"&nome="+nome+"&desc="+desc+"&autor="+autor+"&link="+link+"&tipo="+tipo + cPaint.call(p,"",retorna); + //} +} +function excluir(id) +{ + if(confirm("Você realmente quer fazer isso?")) + { + $i("resultado").innerHTML = $mensagemAguarde; + var retorna = function() + { + montaParametros() + } + var p = "../php/webservices.php?funcao=excluir&id="+id; + cPaint.call(p,"",retorna); + } +} +function importarXmlWS() +{ + $i("resultado").innerHTML = $mensagemAguarde + var retorna = function(retorno) + {$i("resultado").innerHTML = retorno.data} + var p = "../php/webservices.php?funcao=importarXmlWS&xml="+$i("arquivo").value+"&tipo="+$i("tipo").value; + cPaint.call(p,"",retorna); +} \ No newline at end of file diff --git a/admin/php/admin.php b/admin/php/admin.php new file mode 100644 index 0000000..b5378cc --- /dev/null +++ b/admin/php/admin.php @@ -0,0 +1,150 @@ +query("DELETE from $t"); + } + $dbh = null; + exit; +} +function verificaDuplicados($sql,$dbh) +{ + $res = $dbh->query($sql,PDO::FETCH_ASSOC); + if(count($res->fetchAll())>0) + return true; + else + return false; +} +/* +Function: verificaEditores + +Verifica se o usuário atual está cadastrado como editor + +Parameters: + +editores - array com a lista de editores obtido do ms_configura.php + +Return: + +string - sim|nao +*/ +function verificaEditores($editores) +{ + $editor = "nao"; + foreach ($editores as $e) + { + $e = gethostbyname($e); + $ip = "UNKNOWN"; + if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); + else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); + else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); + else $ip = "UNKNOWN"; + if ($e == $ip){$editor="sim";} + } + return $editor; +} +/* +Function: exclui + +Exlcui um registro de uma tabela +*/ +function exclui() +{ + global $tabela,$coluna,$id; + try + { + include("conexao.php"); + $dbh->query("DELETE from $tabela WHERE $coluna = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: pegaDados + +Executa um sql de busca de dados +*/ +function pegaDados($sql) +{ + try + { + $resultado = array(); + include("conexao.php"); + $q = $dbh->query($sql,PDO::FETCH_ASSOC); + $resultado = $q->fetchAll(); + $dbh = null; + return $resultado; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} + +?> \ No newline at end of file diff --git a/admin/php/arvore.php b/admin/php/arvore.php new file mode 100644 index 0000000..3f7938f --- /dev/null +++ b/admin/php/arvore.php @@ -0,0 +1,213 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + case "pegaTemasRaiz": + $cp->set_data(pegaDados("select * from i3geoadmin_raiz LEFT JOIN i3geoadmin_temas ON i3geoadmin_raiz.id_tema = i3geoadmin_temas.id_tema")); + $cp->return_data(); + break; + case "pegaN1": + $cp->set_data(pegaDados("select * from i3geoadmin_n1 where id_menu=$menu")); + $cp->return_data(); + break; + case "alterarRaiz": + alterarRaiz(); + $cp->set_data(pegaDados("select * from i3geoadmin_raiz LEFT JOIN i3geoadmin_temas ON i3geoadmin_raiz.id_tema = i3geoadmin_temas.id_tema")); + $cp->return_data(); + break; + case "alteraN1": + $cp->set_data(alteraN1()); + $cp->return_data(); + break; + case "alteraN2": + $cp->set_data(alteraN2()); + $cp->return_data(); + break; + case "alteraN3": + $cp->set_data(alteraN3()); + $cp->return_data(); + break; + case "pegaN2": + $cp->set_data(pegaDados("select * from i3geoadmin_n2 where id_n1=$idn1")); + $cp->return_data(); + break; + case "pegaN3": + $cp->set_data(pegaDados("select * from i3geoadmin_n3 where id_n2=$idn2")); + $cp->return_data(); + break; + case "excluir"; + if($tabela != "i3geoadmin_raiz") + { + $f = verificaFilhos(); + if(!$f) + $cp->set_data(exclui()); + else + $cp->set_data("erro"); + } + else + { + exclui(); + $cp->set_data(pegaDados("select * from i3geoadmin_raiz LEFT JOIN i3geoadmin_temas ON i3geoadmin_raiz.id_tema = i3geoadmin_temas.id_tema")); + } + $cp->return_data(); + break; +} +/* +Function: verificaFilhos + +Verifica se o pai tem filhos +*/ +function verificaFilhos() +{ + global $tabela,$coluna,$id; + try + { + $res = false; + if($tabela == "i3geoadmin_n2") + { + $r = pegaDados("select * from i3geoadmin_n3 where id_n2=$id"); + if(count($r) > 0) + $res = true; + } + if($tabela == "i3geoadmin_n1") + { + $r = pegaDados("select * from i3geoadmin_n2 where id_n1=$id"); + if(count($r) > 0) + $res = true; + } + return $res; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: alteraN3 + +Altera o registro de um nível 3 (temas) +*/ +function alteraN3() +{ + global $perfil,$id,$idtema,$idsubgrupo; + try + { + require_once("conexao.php"); + if($id != "") + $dbh->query("UPDATE i3geoadmin_n3 SET id_tema = '$idtema', n3_perfil = '$perfil' WHERE id_n3 = $id"); + else + $dbh->query("INSERT INTO i3geoadmin_n3 (id_n2,id_tema,n3_perfil) VALUES ($idsubgrupo,'', '')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: alteraN2 + +Altera o registro de um nível 2 +*/ +function alteraN2() +{ + global $perfil,$id,$idsubgrupo,$idgrupo; + try + { + require_once("conexao.php"); + if($id != "") + $dbh->query("UPDATE i3geoadmin_n2 SET id_subgrupo = '$idsubgrupo', n2_perfil = '$perfil' WHERE id_n2 = $id"); + else + $dbh->query("INSERT INTO i3geoadmin_n2 (id_n1,id_subgrupo,n2_perfil) VALUES ($idgrupo,'', '')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: alteraN1 + +Altera o registro de um nível 1 +*/ +function alteraN1() +{ + global $perfil,$idgrupo,$id,$idmenu; + try + { + require_once("conexao.php"); + if($id != "") + $dbh->query("UPDATE i3geoadmin_n1 SET id_grupo = '$idgrupo', n1_perfil = '$perfil' WHERE id_menu = $idmenu and id_n1 = $id"); + else + $dbh->query("INSERT INTO i3geoadmin_n1 (id_menu,id_grupo,n1_perfil) VALUES ($idmenu,'', '')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: alterarRaiz + +Altera o registro na raiz de um nível +*/ +function alterarRaiz() +{ + global $id_nivel,$nivel,$id_raiz,$id_menu,$perfil,$id_tema; + try + { + include("conexao.php"); + if($id_raiz != "") + $dbh->query("UPDATE i3geoadmin_raiz SET id_nivel = '$nivel', nivel = '$nivel', perfil = '$perfil', id_menu = '$id_menu', id_tema = '$id_tema' WHERE id_raiz = $id_raiz"); + else + $dbh->query("INSERT INTO i3geoadmin_raiz (id_nivel,nivel,id_menu,perfil,id_tema) VALUES ($id_nivel,$nivel,$id_menu,'','')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} + +?> \ No newline at end of file diff --git a/admin/php/atlas.php b/admin/php/atlas.php new file mode 100644 index 0000000..9899e69 --- /dev/null +++ b/admin/php/atlas.php @@ -0,0 +1,309 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + + case "pegaAtlas": + $sis = dadosAtlas(); + $cp->set_data($sis); + $cp->return_data(); + break; + + case "alterarAtlas": + alterarAtlas(); + $sis = dadosAtlas(); + $cp->set_data($sis); + $cp->return_data(); + break; + + case "alterarPranchas": + alterarPranchas(); + $sis = dadosAtlas(); + $cp->set_data($sis); + $cp->return_data(); + break; + + case "alterarTemas": + alterarTemas(); + $sis = dadosAtlas(); + $cp->set_data($sis); + $cp->return_data(); + break; + + case "excluir": + $tabela = "i3geoadmin_atlas"; + $f = verificaFilhos(); + if(!$f) + $cp->set_data(excluirAtlas()); + else + $cp->set_data("erro"); + $cp->return_data(); + break; + + case "excluirPranchas": + $tabela = "i3geoadmin_atlasp"; + $f = verificaFilhos(); + if(!$f) + $cp->set_data(excluirPranchas()); + else + $cp->set_data("erro"); + $cp->return_data(); + break; + + case "excluirTemas": + $cp->set_data(excluirTemas()); + $cp->return_data(); + break; + + case "importarXmlAtlas": + $cp->set_data(importarXmlAtlas()); + $cp->return_data(); + break; +} +function dadosAtlas() +{ + global $id_atlas; + if($id_atlas == "") + $sis = pegaDados('SELECT * from i3geoadmin_atlas order by titulo_atlas'); + else + $sis = pegaDados("SELECT * from i3geoadmin_atlas where id_atlas = '$id_atlas' "); + for($i=0;$iquery("INSERT INTO i3geoadmin_atlas (basemapfile_atlas,desc_atlas,h_atlas,w_atlas,icone_atlas,link_atlas,pranchadefault_atlas,template_atlas,tipoguias_atlas,titulo_atlas) VALUES ('','','$h_atlas','$w_atlas','','','','','$tipoguias_atlas','')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function alterarPranchas() +{ + global $mapext_prancha,$id_atlas,$id_prancha,$desc_prancha,$h_prancha,$w_prancha,$icone_prancha,$link_prancha,$titulo_prancha; + try + { + $desc_prancha = mb_convert_encoding($desc_prancha,"UTF-8","ISO-8859-1"); + $titulo_prancha = mb_convert_encoding($titulo_prancha,"UTF-8","ISO-8859-1"); + include("conexao.php"); + if($id_prancha != "") + $dbh->query("UPDATE i3geoadmin_atlasp SET mapext_prancha='$mapext_prancha',desc_prancha='$desc_prancha',h_prancha='$h_prancha',w_prancha='$w_prancha',icone_prancha='$icone_prancha',link_prancha='$link_prancha',titulo_prancha='$titulo_prancha' WHERE id_prancha = $id_prancha and id_atlas='$id_atlas'"); + else + $dbh->query("INSERT INTO i3geoadmin_atlasp (mapext_prancha,desc_prancha,h_prancha,w_prancha,icone_prancha,link_prancha,titulo_prancha,id_atlas) VALUES ('','','$h_prancha','$w_prancha','','','','$id_atlas')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function alterarTemas() +{ + global $id_tema,$id_prancha,$codigo_tema,$ligado_tema; + try + { + include("conexao.php"); + if($id_tema != "") + $dbh->query("UPDATE i3geoadmin_atlast SET codigo_tema='$codigo_tema',ligado_tema='$ligado_tema' WHERE id_prancha = $id_prancha and id_tema='$id_tema'"); + else + $dbh->query("INSERT INTO i3geoadmin_atlast (codigo_tema,ligado_tema,id_prancha) VALUES ('','','$id_prancha')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} + +function excluirPranchas() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_atlasp WHERE id_prancha = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function excluirTemas() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_atlast WHERE id_tema = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function excluirAtlas() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_atlas WHERE id_atlas = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function importarXmlAtlas() +{ + global $xml,$tipo; + if(!file_exists($xml)) + {return "
Arquivo $xml não encontrado";} + include_once("../../classesphp/funcoes_gerais.php"); + include("conexao.php"); + $xml = simplexml_load_file($xml); + // + //importa os atlas + // + $atlasExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_atlas"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$atlasExistentes[$r["titulo_atlas"]] = 0;} + foreach($xml->ATLAS as $atlas) + { + $titulo = ixml($atlas,"TITULO"); + $desc = ixml($atlas,"DESCRICAO"); + $icone = ixml($atlas,"ICONE"); + $link = ixml($atlas,"LINKMAISINFO"); + $template = ixml($atlas,"TEMPLATEHTML"); + $w = ixml($atlas,"WABERTURA"); + $h = ixml($atlas,"HABERTURA"); + $pranchadefault = ixml($atlas,"PRANCHADEFAULT"); + $tipoguias = ixml($atlas,"TIPOGUIAS"); + if(!isset($atlasExistentes[$titulo])) + $dbh->query("INSERT INTO i3geoadmin_atlas (desc_atlas,h_atlas,w_atlas,icone_atlas,link_atlas,pranchadefault_atlas,template_atlas,tipoguias_atlas,titulo_atlas) VALUES ('$desc','$h','$w','$icone','$link','$pranchadefault','$template','$tipoguias','$titulo')"); + $atlasExistentes[$titulo] = 0; + $id_atlas = $dbh->lastInsertId("id_atlas"); + foreach ($atlas->PRANCHAS->PRANCHA as $prancha) + { + $titulo = ixml($prancha,"TITULO"); + $desc = ixml($prancha,"DESCRICAO"); + $icone = ixml($prancha,"ICONE"); + $link = ixml($prancha,"LINKMAISINFO"); + $w = ixml($prancha,"WABERUTRA"); + $h = ixml($prancha,"HABERTURA"); + $mapext = ixml($prancha,"MAPEXT"); + $dbh->query("INSERT INTO i3geoadmin_atlasp (id_atlas,desc_prancha,h_prancha,w_prancha,icone_prancha,link_prancha,titulo_prancha,mapext_prancha) VALUES ('$id_atlas','$desc','$h','$w','$icone','$link','$titulo','$mapext')"); + $id_prancha = $dbh->lastInsertId("id_prancha"); + foreach ($prancha->TEMAS->TEMA as $tema) + { + $codigo = ixml($tema,"CODIGO"); + $ligado = ixml($tema,"LIGADO"); + $dbh->query("INSERT INTO i3geoadmin_atlast (id_prancha,codigo_tema,ligado_tema) VALUES ('$id_prancha','$codigo','$ligado')"); + } + + } + } + $dbh = null; + return "Dados importados."; +} +function verificaFilhos() +{ + global $tabela,$id; + try + { + $res = false; + if($tabela == "i3geoadmin_atlas") + { + $r = pegaDados("select * from i3geoadmin_atlasp where id_atlas=$id"); + if(count($r) > 0) + $res = true; + } + if($tabela == "i3geoadmin_atlasp") + { + $r = pegaDados("select * from i3geoadmin_atlast where id_prancha=$id"); + if(count($r) > 0) + $res = true; + } + return $res; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} + +?> \ No newline at end of file diff --git a/admin/php/conexao.php b/admin/php/conexao.php new file mode 100644 index 0000000..f6562e6 --- /dev/null +++ b/admin/php/conexao.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/admin/php/conexaomma.php b/admin/php/conexaomma.php new file mode 100644 index 0000000..b37fa7a --- /dev/null +++ b/admin/php/conexaomma.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/admin/php/identifica.php b/admin/php/identifica.php new file mode 100644 index 0000000..40a6288 --- /dev/null +++ b/admin/php/identifica.php @@ -0,0 +1,133 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + + case "pegaFuncoes": + $cp->set_data(pegaDados('SELECT * from i3geoadmin_identifica')); + $cp->return_data(); + break; + + case "alterarFuncoes": + alterarFuncoes(); + if($id_i == "") + $cp->set_data(pegaDados('SELECT * from i3geoadmin_identifica')); + else + $cp->set_data(pegaDados('SELECT * from i3geoadmin_identifica where id_i = '.$id_i)); + $cp->return_data(); + break; + + case "excluir": + $cp->set_data(excluirFuncoes()); + $cp->return_data(); + break; + + case "importarXmlI": + $cp->set_data(importarXmlI()); + $cp->return_data(); + break; +} +/* +Function: alterarFuncoes + +Altera o registro de um WS +*/ +function alterarFuncoes() +{ + global $id_i,$abrir_i,$nome_i,$target_i; + try + { + $nome_i = mb_convert_encoding($nome_i,"UTF-8","ISO-8859-1"); + require_once("conexao.php"); + if($id_i != "") + $dbh->query("UPDATE i3geoadmin_identifica SET nome_i = '$nome_i',abrir_i = '$abrir_i', target_i = '$target_i' WHERE id_i = $id_i"); + else + $dbh->query("INSERT INTO i3geoadmin_identifica (nome_i,abrir_i,target_i) VALUES ('','','')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function excluirFuncoes() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_identifica WHERE id_i = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function importarXmlI() +{ + global $xml; + if(!file_exists($xml)) + {return "
Arquivo $xml não encontrado";} + include_once("../../classesphp/funcoes_gerais.php"); + include("conexao.php"); + $xml = simplexml_load_file($xml); + // + //importa os grupos + // + $wsExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_identifica"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$iExistentes[$r["nome_i"]] = 0;} + foreach($xml->FUNCAO as $item) + { + $nome_i = ixml($item,"NOMESIS"); + $target_i = ixml($item,"TARGET"); + $abrir_i = ixml($item,"ABRIR"); + if(!isset($iExistentes[$nome_i])) + $dbh->query("INSERT INTO i3geoadmin_identifica (nome_i,target_i,abrir_i) VALUES ('$nome_i','$target_i','$abrir_i')"); + $iExistentes[$nome_i] = 0; + } + $dbh = null; + return "Dados importados."; +} + +?> \ No newline at end of file diff --git a/admin/php/mapas.php b/admin/php/mapas.php new file mode 100644 index 0000000..326a3fc --- /dev/null +++ b/admin/php/mapas.php @@ -0,0 +1,141 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + + case "pegaMapas": + $cp->set_data(pegaDados('SELECT * from i3geoadmin_mapas order by nome_mapa')); + $cp->return_data(); + break; + + case "alterarMapas": + alterarMapas(); + if($id_mapa == "") + $cp->set_data(pegaDados('SELECT * from i3geoadmin_mapas')); + else + $cp->set_data(pegaDados('SELECT * from i3geoadmin_mapas WHERE id_mapa = '.$id_mapa)); + $cp->return_data(); + break; + + case "excluir": + $cp->set_data(excluirMapa()); + $cp->return_data(); + break; + + case "importarXmlMapas": + $cp->set_data(importarXmlMapas()); + $cp->return_data(); + break; +} +/* +Function: alterarMapas + +Altera o registro de um mapa +*/ +function alterarMapas() +{ + global $id_mapa,$desc,$ext,$imagem,$outros,$nome,$linkdireto,$temas,$ligados,$perfil; + try + { + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); + require_once("conexao.php"); + if($id_mapa != "") + $dbh->query("UPDATE i3geoadmin_mapas SET desc_mapa = '$desc',ext_mapa = '$ext',imagem_mapa = '$imagem',outros_mapa = '$outros',nome_mapa = '$nome', linkdireto_mapa = '$linkdireto',temas_mapa = '$temas',ligados_mapa = '$ligados',perfil_mapa = '$perfil' WHERE id_mapa = $id_mapa"); + else + $dbh->query("INSERT INTO i3geoadmin_mapas (perfil_mapa,desc_mapa,ext_mapa,imagem_mapa,linkdireto_mapa,nome_mapa,outros_mapa,temas_mapa,ligados_mapa) VALUES ('','','','','','','','','')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function excluirMapa() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_mapas WHERE id_mapa = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function importarXmlMapas() +{ + global $xml; + if(!file_exists($xml)) + {return "
Arquivo $xml não encontrado";} + include_once("../../classesphp/funcoes_gerais.php"); + include("conexao.php"); + $xml = simplexml_load_file($xml); + // + //importa os grupos + // + $mapasExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_mapas"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$mapasExistentes[$r["nome_mapa"]] = 0;} + foreach($xml->MAPA as $mapa) + { + $perfil = ixml($mapa,"PERFIL"); + $descricao = ixml($mapa,"DESCRICAO"); + //$descricao = mb_convert_encoding($descricao,"UTF-8","ISO-8859-1"); + $nome = ixml($mapa,"NOME"); + //$nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + $imagem = ixml($mapa,"IMAGEM"); + $temas = ixml($mapa,"TEMAS"); + $ligados = ixml($mapa,"LIGADOS"); + $extensao = ixml($mapa,"EXTENSAO"); + $outros = ixml($mapa,"OUTROS"); + $linkdireto = ixml($mapa,"LINKDIRETO"); + if(!isset($mapasExistentes[$nome])) + $dbh->query("INSERT INTO i3geoadmin_mapas (perfil_mapa,desc_mapa,ext_mapa,imagem_mapa,linkdireto_mapa,nome_mapa,outros_mapa,temas_mapa,ligados_mapa) VALUES ('$perfil','$descricao','$extensao','$imagem','$linkdireto','$nome','$outros','$temas','$ligados')"); + $mapasExistentes[$nome] = 0; + } + $dbh = null; + return "Dados importados."; +} +?> \ No newline at end of file diff --git a/admin/php/mapfiles.php b/admin/php/mapfiles.php new file mode 100644 index 0000000..2dd9782 --- /dev/null +++ b/admin/php/mapfiles.php @@ -0,0 +1,135 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + //pega os parâmetros do ms_configura + case "pegaParametrosConfigura": + $vs = array( + "FONTSET ", + "SYMBOLSET ", + "SHAPEPATH ", + "EXTENT ", + "IMAGE ", + "IMAGEPATH ", + "IMAGEURL " + ); + $par = array(); + foreach ($vs as $v) + { + $handle = fopen ($temasaplic."/".$mapfile.".map", "r"); + while (!feof ($handle)) { + $buffer = fgets($handle); + if(!(stristr($buffer, $v) === FALSE)) + { + $temp = explode(trim($v),$buffer); + if(trim($temp[0]) != "#") + { + $temp = trim($temp[1]); + $par[trim($v)] = $temp; + fclose ($handle); + break; + } + } + } + } + $cp->set_data($par); + $cp->return_data(); + break; + + //retorna o mapfile atual como texto + case "restauraConfigura": + $cp->register('restauraConfigura'); + unlink($temasaplic."/".$mapfile.".map"); + copy ($temasaplic."/".$mapfile.".default",$temasaplic."/".$mapfile.".map"); + $cp->set_data("ok"); + $cp->return_data(); + break; + + //salva um novo valor para uma variável do ms_configura + case "salvaConfigura": + $cp->register('salvaConfigura'); + salvaConfigura($variavel,$valor,$mapfile,$temasaplic); + $cp->set_data("ok"); + $cp->return_data(); + break; +} +/* +Function: salvaConfigura + +Salva um novo valor de uma variável no ms_configura.php + +Parameters: + +variavel - nome da variável + +valor - novo valor +*/ +function salvaConfigura($variavel,$valor,$mapfile,$temasaplic) +{ + $handle = fopen ($temasaplic."/".$mapfile.".map", "r"); + $linhas = array(); + $valor = str_replace("\\\"",'"',$valor); + while (!feof ($handle)) { + + $buffer = fgets($handle); + if(!(stristr($buffer, $variavel) === FALSE)) + { + $temp = explode(trim($variavel),$buffer); + if(trim($temp[0]) != "#") + { + $temp = trim($temp[1]); + $par[trim($variavel)] = $temp; + $linhas[] = $variavel." ".$valor."\n"; + $variavel = "______________"; + } + else{$linhas[] = $buffer;} + } + else + $linhas[] = $buffer; + } + fclose ($handle); + unlink($temasaplic."/".$mapfile.".map"); + $handle = fopen ($temasaplic."/".$mapfile.".map", "w"); + foreach ($linhas as $linha) + { + fwrite($handle, $linha); + } + fclose($handle); +} + +?> \ No newline at end of file diff --git a/admin/php/menutemas.php b/admin/php/menutemas.php new file mode 100644 index 0000000..f91cf00 --- /dev/null +++ b/admin/php/menutemas.php @@ -0,0 +1,572 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + + case "importarXmlMenu": + $cp->set_data(importarXmlMenu()); + $cp->return_data(); + break; + + case "pegaMenus": + $cp->set_data(pegaDados('SELECT * from i3geoadmin_menus order by nome_menu')); + $cp->return_data(); + break; + + case "pegaTags": + $cp->set_data(pegaDados('SELECT * from i3geoadmin_tags order by nome')); + $cp->return_data(); + break; + + case "alteraMenus": + $cp->set_data(alteraMenus()); + $cp->return_data(); + break; + + case "pegaGrupos": + $cp->set_data(pegaDados('SELECT * from i3geoadmin_grupos order by nome_grupo')); + $cp->return_data(); + break; + + case "alteraGrupos": + $cp->set_data(alteraGrupos()); + $cp->return_data(); + break; + + case "pegaSubGrupos": + $cp->set_data(pegaDados('SELECT * from i3geoadmin_subgrupos order by nome_subgrupo')); + $cp->return_data(); + break; + + case "alteraSubGrupos": + $cp->set_data(alteraSubGrupos()); + $cp->return_data(); + break; + + case "pegaTemas": + $cp->set_data(pegaTemas()); + $cp->return_data(); + break; + + case "alteraTemas": + $cp->set_data(alteraTemas()); + $cp->return_data(); + break; + + case "alteraTags": + $cp->set_data(alteraTags()); + $cp->return_data(); + break; + + case "pegaSubXGrupos": + $cp->set_data(pegaSubXGrupos()); + $cp->return_data(); + break; + + case "excluirRegistro": + if($tabela == "grupos") + {$tabela = "i3geoadmin_grupos";$coluna = "id_grupo";} + if($tabela == "tags") + {excluiTagTemas($id);$tabela = "i3geoadmin_tags";$coluna = "id_tag";} + if($tabela == "subgrupos") + {$tabela = "i3geoadmin_subgrupos";$coluna = "id_subgrupo";} + if($tabela == "temas") + {$tabela = "i3geoadmin_temas";$coluna = "id_tema";} + if($tabela == "menus") + {$tabela = "i3geoadmin_menus";$coluna = "id_menu";} + $cp->set_data(exclui()); + $cp->return_data(); + break; + + case "listaMapsTemas": + $cp->set_data(listaMapsTemas()); + $cp->return_data(); + break; +} +function excluiTagTemas($id) +{ + require_once("conexao.php"); + foreach($dbh->query("select * from i3geoadmin_tags where id_tag = $id") as $row) + {$nometag = $row["nome"];} + foreach($dbh->query("select * from i3geoadmin_temas") as $row) + { + $ts = $row['tags_tema']; + $i = $row['id_tema']; + $ts = str_replace($nometag,"",$ts); + $dbh->query("UPDATE i3geoadmin_temas SET tags_tema = '$ts' WHERE id_tema = $i"); + } +} +/* +Function: pegaTemas + +Pega a lista de temas + +Parameters: + +filtro - texto para filtrar os dados +*/ +function pegaTemas() +{ + global $filtro; + try + { + $resultado = array(); + require_once("conexao.php"); + foreach($dbh->query('SELECT * from i3geoadmin_temas order by nome_tema') as $row) + { + $continua = true; + if(isset($filtro) && $filtro != "") + { + $continua = false; + if ($row['codigo_tema'] == $filtro) + {$continua = true;} + $testanome = mb_convert_encoding($filtro,"UTF-8","ISO-8859-1"); + if (!stristr($row['nome_tema'],$testanome) === FALSE) + {$continua = true;} + if (!stristr($row['tags_tema'],$testanome) === FALSE) + {$continua = true;} + } + if($row['codigo_tema'] == ""){$continua = true;} + if ($continua) + $resultado[] = array( + "nome_tema"=>$row['nome_tema'], + "codigo_tema"=>$row['codigo_tema'], + "id_tema"=>$row['id_tema'], + "desc_tema"=>$row['desc_tema'], + "link_tema"=>$row['link_tema'], + "tipoa_tema"=>$row['tipoa_tema'], + "download_tema"=>$row['download_tema'], + "ogc_tema"=>$row['ogc_tema'], + "kml_tema"=>$row['kml_tema'], + "tags_tema"=>$row['tags_tema'] + ); + } + $dbh = null; + return $resultado; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} + +/* +Function: pegaSubXGrupos + +Pega a lista de sub-grupos por grupos +*/ +function pegaSubXGrupos() +{ +/* +select i3geoadmin_subxgrupos.id_subxgrupo,i3geoadmin_grupos.nome_grupo,i3geoadmin_subgrupos.nome_subgrupo +from +i3geoadmin_grupos,i3geoadmin_subgrupos,i3geoadmin_subxgrupos +where +i3geoadmin_grupos.id_grupo = i3geoadmin_subxgrupos.id_grupo +and +i3geoadmin_subgrupos.id_subgrupo = i3geoadmin_subxgrupos.id_subgrupo +order by nome_grupo,nome_subgrupo +*/ + +} +/* +Function: alteraMenus + +Altera o registro de um menu. Se id for vazio acrescenta o registro +*/ +function alteraMenus() +{ + global $nome,$desc,$id,$aberto; + try + { + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); + include("conexao.php"); + if($id != "") + { + $dbh->query("UPDATE i3geoadmin_menus SET aberto = '$aberto', nome_menu = '$nome', desc_menu = '$desc' WHERE id_menu = $id"); + } + else + $dbh->query("INSERT INTO i3geoadmin_menus (nome_menu, desc_menu, aberto) VALUES ('', '','sim')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function alteraTags() +{ + global $nome,$id; + try + { + $dbh = ""; + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + include("conexao.php"); + if($id != "") + { + if(!verificaDuplicados("select * from i3geoadmin_tags where nome = '$nome'",$dbh)) + { + $original = ""; + foreach($dbh->query("select * from i3geoadmin_tags where id_tag = $id") as $row) + {$original = $row["nome"];} + $dbh->query("UPDATE i3geoadmin_tags SET nome = '$nome' WHERE id_tag = $id"); + //exclui os registros do tag alterado nos temas + foreach($dbh->query("select * from i3geoadmin_temas") as $row) + { + $ts = $row['tags_tema']; + $i = $row['id_tema']; + $ts = str_replace($original,$nome,$ts); + $dbh->query("UPDATE i3geoadmin_temas SET tags_tema = '$ts' WHERE id_tema = $i"); + } + } + } + else + $dbh->query("INSERT INTO i3geoadmin_tags (nome) VALUES ('$nome')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: alteraGrupos + +Altera o registro de um grupo. Se id for vazio acrescenta o registro +*/ +function alteraGrupos() +{ + global $nome,$desc,$id; + try + { + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); + include("conexao.php"); + if($id != "") + { + $dbh->query("UPDATE i3geoadmin_grupos SET nome_grupo = '$nome', desc_grupo = '$desc' WHERE id_grupo = $id"); + } + else + $dbh->query("INSERT INTO i3geoadmin_grupos (nome_grupo, desc_grupo) VALUES ('', '')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: alteraSubGrupos + +Altera o registro de um sub-grupo. Se id for vazio acrescenta o registro +*/ +function alteraSubGrupos() +{ + global $nome,$desc,$id; + try + { + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); + require_once("conexao.php"); + if($id != "") + { + $dbh->query("UPDATE i3geoadmin_subgrupos SET nome_subgrupo = '$nome', desc_subgrupo = '$desc' WHERE id_subgrupo = $id"); + } + else + $dbh->query("INSERT INTO i3geoadmin_subgrupos (nome_subgrupo, desc_subgrupo) VALUES ('', '')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: alteraTemas + +Altera o registro de um tema. Se id for vazio acrescenta o registro +*/ +function alteraTemas() +{ + global $nome,$desc,$id,$codigo,$tipoa,$download,$ogc,$kml,$link,$tags; + try + { + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); + $tags = mb_convert_encoding($tags,"UTF-8","ISO-8859-1"); + require_once("conexao.php"); + if($id != "") + { + $dbh->query("UPDATE i3geoadmin_temas SET tags_tema='$tags', link_tema='$link', nome_tema ='$nome',desc_tema='$desc',codigo_tema='$codigo',tipoa_tema='$tipoa',download_tema='$download',ogc_tema='$ogc',kml_tema='$kml' WHERE id_tema = $id"); + } + else + $dbh->query("INSERT INTO i3geoadmin_temas (link_tema,kml_tema,ogc_tema,download_tema,nome_tema,desc_tema,codigo_tema,tipoa_tema,tags_tema) VALUES ('','', '','','','','','','')"); + //verifica se é necessário adicionar algum tag novo + $tags = explode(" ",$tags); + foreach($tags as $tag) + { + if(!(verificaDuplicados("select * from i3geoadmin_tags where nome = '$tag'",$dbh))) + { + $dbh->query("INSERT INTO i3geoadmin_tags (nome) VALUES ('$tag')"); + } + } + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +/* +Function: listaMapsTemas + +Retorna a lista de mapfiles do diretorio i3geo/temas + +Parameters: + +cp - objeto CPAINT + +locaplic - localização da instalação do I3Geo +*/ +function listaMapsTemas() +{ + global $cp,$locaplic; + $arquivos = array(); + if (is_dir($locaplic."/temas")) + { + if ($dh = opendir($locaplic."/temas")) + { + while (($file = readdir($dh)) !== false) + { + if(!stristr($file, '.map') === FALSE || !stristr($file, ".php")===FALSE) + { + $file = str_replace(".map","",$file); + $file = str_replace(".php","",$file); + $arquivos[] = $file; + } + } + } + closedir($dh); + } + sort($arquivos); + return $arquivos; +} +/* +/* +Function importarXmlMenu + +Importa um arquivo xml do tipo "menutemas" para o banco de dados +*/ +function importarXmlMenu() +{ + global $nomemenu,$xml; + $listaDeTags = array(); + if(!file_exists($xml)) + {return "
Arquivo $xml não encontrado";} + include_once("../../classesphp/funcoes_gerais.php"); + include("conexao.php"); + $dbh->query("INSERT INTO i3geoadmin_menus (desc_menu,nome_menu) VALUES ('','$nomemenu')"); + $id_menu = $dbh->lastInsertId("id_menu"); + + $xml = simplexml_load_file($xml); + // + //importa os grupos + // + $gruposExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_grupos"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$gruposExistentes[$r["nome_grupo"]] = 0;} + foreach($xml->GRUPO as $grupo) + { + $nome = ixml($grupo,"GTIPO"); + $descricao = ixml($grupo,"DTIPO"); + if(!isset($gruposExistentes[$nome])) + $dbh->query("INSERT INTO i3geoadmin_grupos (desc_grupo,nome_grupo) VALUES ('$descricao','$nome')"); + $gruposExistentes[$nome] = 0; + } + // + //importa os sub-grupos + // + $subgruposExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_subgrupos"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$subgruposExistentes[$r["nome_subgrupo"]] = 0;} + foreach($xml->GRUPO as $grupo) + { + foreach($grupo->SGRUPO as $sgrupo) + { + $nome = ixml($sgrupo,"SDTIPO"); + $descricao = ""; + if(!isset($subgruposExistentes[$nome])) + $dbh->query("INSERT INTO i3geoadmin_subgrupos (desc_subgrupo,nome_subgrupo) VALUES ('$descricao','$nome')"); + $subgruposExistentes[$nome] = 0; + } + } + // + //importa os temas + // + $temasExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_subgrupos"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$temasExistentes[$r["codigo_tema"]] = 0;} + foreach($xml->TEMA as $tema) + { + $nome = ixml($tema,"TNOME"); + $descricao = ixml($tema,"TDESC"); + $codigo = ixml($tema,"TID"); + $link = ixml($tema,"TLINK"); + $tipo = ixml($tema,"TIPOA"); + $tags = ixml($tema,"TAGS"); + $down = ixml($tema,"DOWNLOAD"); + $kml = ixml($tema,"KML"); + $ogc = ixml($tema,"OGC"); + $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); + if(!isset($temasExistentes[$codigo])) + $dbh->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); + $temasExistentes[$codigo] = 0; + } + foreach($xml->GRUPO as $grupo) + { + foreach($grupo->TEMA as $tema) + { + $nome = ixml($tema,"TNOME"); + $descricao = ixml($tema,"TDESC"); + $codigo = ixml($tema,"TID"); + $link = ixml($tema,"TLINK"); + $tipo = ixml($tema,"TIPOA"); + $tags = ixml($tema,"TAGS"); + $down = ixml($tema,"DOWNLOAD"); + $kml = ixml($tema,"KML"); + $ogc = ixml($tema,"OGC"); + $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); + if(!isset($temasExistentes[$codigo])) + $dbh->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); + $temasExistentes[$codigo] = 0; + } + foreach($grupo->SGRUPO as $sgrupo) + { + foreach($sgrupo->TEMA as $tema) + { + $nome = ixml($tema,"TNOME"); + $descricao = ixml($tema,"TDESC"); + $codigo = ixml($tema,"TID"); + $link = ixml($tema,"TLINK"); + $tipo = ixml($tema,"TIPOA"); + $tags = ixml($tema,"TAGS"); + $down = ixml($tema,"DOWNLOAD"); + $kml = ixml($tema,"KML"); + $ogc = ixml($tema,"OGC"); + $listaDeTags = array_merge($listaDeTags,explode(" ",$tags)); + if(!isset($temasExistentes[$codigo])) + $dbh->query("INSERT INTO i3geoadmin_temas (kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,nome_tema,codigo_tema) VALUES ('$kml','$ogc','$down','$tags','$tipo','$link','$descricao','$nome','$codigo')"); + $temasExistentes[$codigo] = 0; + } + } + } + // + //monta árvore + // + // + //registra os temas no nível da raiz + // + foreach($xml->TEMA as $tema) + { + $codigo = ixml($tema,"TID"); + $perfil = ixml($tema,"PERFIL"); + $r = $dbh->query("select id_tema from i3geoadmin_temas where codigo_tema = '$codigo'"); + $id_tema = $r->fetchColumn(); + $dbh->query("INSERT INTO i3geoadmin_raiz (id_tema,id_menu,id_nivel,nivel,perfil) VALUES ('$id_tema','$id_menu','0','0','$perfil')"); + } + // + //registra o restante + // + foreach($xml->GRUPO as $grupo) + { + $gtipo = ixml($grupo,"GTIPO"); + $n1_perfil = ixml($grupo,"PERFIL"); + $r = $dbh->query("select id_grupo from i3geoadmin_grupos where nome_grupo = '$gtipo'"); + $id_grupo = $r->fetchColumn(); + $dbh->query("INSERT INTO i3geoadmin_n1 (id_menu,id_grupo,n1_perfil) VALUES ('$id_menu','$id_grupo','$n1_perfil')"); + $id_n1 = $dbh->lastInsertId("id_n1"); + foreach($grupo->TEMA as $tema) + { + $codigo = ixml($tema,"TID"); + $perfil = ixml($tema,"PERFIL"); + $r = $dbh->query("select id_tema from i3geoadmin_temas where codigo_tema = '$codigo'"); + $id_tema = $r->fetchColumn(); + $dbh->query("INSERT INTO i3geoadmin_raiz (id_tema,id_menu,id_nivel,nivel,perfil) VALUES ('$id_tema','$id_menu','$id_n1','1','$perfil')"); + } + foreach($grupo->SGRUPO as $subgrupo) + { + $sdtipo = ixml($subgrupo,"SDTIPO"); + $n2_perfil = ixml($subgrupo,"PERFIL"); + $r = $dbh->query("select id_subgrupo from i3geoadmin_subgrupos where nome_subgrupo = '$sdtipo'"); + $id_subgrupo = $r->fetchColumn(); + + $dbh->query("INSERT INTO i3geoadmin_n2 (id_n1,id_subgrupo,n2_perfil) VALUES ('$id_n1','$id_subgrupo','$n2_perfil')"); + $id_n2 = $dbh->lastInsertId("id_n2"); + foreach($subgrupo->TEMA as $tema) + { + $codigo = ixml($tema,"TID"); + $perfil = ixml($tema,"PERFIL"); + $r = $dbh->query("select id_tema from i3geoadmin_temas where codigo_tema = '$codigo'"); + $id_tema = $r->fetchColumn(); + $dbh->query("INSERT INTO i3geoadmin_n3 (id_n2,id_tema,n3_perfil) VALUES ('$id_n2','$id_tema','$perfil')"); + } + } + } + //registra os tags + $listaDeTags = array_unique($listaDeTags); + foreach ($listaDeTags as $t) + { + if(!(verificaDuplicados("select * from i3geoadmin_tags where nome = '$t'",$dbh))) + $dbh->query("INSERT INTO i3geoadmin_tags (nome) VALUES ('$t')"); + } + $dbh = null; + return "Dados importados."; +} +?> \ No newline at end of file diff --git a/admin/php/ms_configura.php b/admin/php/ms_configura.php new file mode 100644 index 0000000..f008021 --- /dev/null +++ b/admin/php/ms_configura.php @@ -0,0 +1,128 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + //pega os parâmetros do ms_configura + case "pegaParametrosConfigura": + $vs = array( + "\$dir_tmp", + "\$mensagemInicia", + "\$tituloInstituicao", + "\$locaplic", + "\$temasdir", + "\$temasaplic", + "\$locmapserv", + "\$locsistemas", + "\$locidentifica", + "\$locmapas", + "\$R_path", + "\$postgis_con", + "\$srid_area", + "\$postgis_mapa", + "\$utilizacgi", + "\$atlasxml", + "\$expoeMapfile", + "\$menutemas", + "\$conexaoadmin" + ); + $par = array(); + foreach ($vs as $v) + { + eval("\$s = $v;"); + if(is_array($s)) + { + $par[$v] = $s; + } + else + $par[$v] = mb_convert_encoding($s,"UTF-8","ISO-8859-1"); + } + $cp->set_data($par); + $cp->return_data(); + break; + //retorna o mapfile atual como texto + case "restauraConfigura": + $cp->register('restauraConfigura'); + unlink("../../ms_configura.php"); + copy ("../../ms_configura.default","../../ms_configura.php"); + $cp->set_data("ok"); + $cp->return_data(); + break; + //salva um novo valor para uma variável do ms_configura + case "salvaConfigura": + $cp->register('salvaConfigura'); + salvaConfigura($variavel,mb_convert_encoding($valor,"ISO-8859-1","UTF-8")); + $cp->set_data("ok"); + $cp->return_data(); + break; +} +/* +Function: salvaConfigura + +Salva um novo valor de uma variável no ms_configura.php + +Parameters: + +variavel - nome da variável + +valor - novo valor +*/ +function salvaConfigura($variavel,$valor) +{ + $handle = fopen ("../../ms_configura.php", "r"); + $linhas = array(); + while (!feof ($handle)) { + $buffer = fgets($handle); + $temp = explode("=",$buffer); + $temp = trim($temp[0]); + if ($temp == $variavel) + $linhas[] = $variavel." = '".$valor."';\n"; + else + $linhas[] = $buffer; + } + fclose ($handle); + unlink("../../ms_configura.php"); + $handle = fopen ("../../ms_configura.php", "w"); + foreach ($linhas as $linha) + { + fwrite($handle, $linha); + } + fclose($handle); +} +?> \ No newline at end of file diff --git a/admin/php/sistemas.php b/admin/php/sistemas.php new file mode 100644 index 0000000..b3400a8 --- /dev/null +++ b/admin/php/sistemas.php @@ -0,0 +1,229 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + + case "pegaSistemas": + $sis = pegaDados('SELECT * from i3geoadmin_sistemas order by nome_sistema'); + for($i=0;$iquery("INSERT INTO i3geoadmin_sistemas (nome_sistema,perfil_sistema) VALUES ('','')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function alterarFuncoes() +{ + global $id_sistema,$id_funcao,$perfil,$nomefuncao,$w,$h,$abrir; + try + { + require_once("conexao.php"); + $nomefuncao = mb_convert_encoding($nomefuncao,"UTF-8","ISO-8859-1"); + if($id_funcao != "") + $dbh->query("UPDATE i3geoadmin_sistemasf SET nome_funcao = '$nomefuncao',perfil_funcao = '$perfil', w_funcao = '$w',h_funcao = '$h', abrir_funcao = '$abrir' WHERE id_sistema = $id_sistema and id_funcao = $id_funcao"); + else + $dbh->query("INSERT INTO i3geoadmin_sistemasf (id_sistema,nome_funcao,perfil_funcao,w_funcao,h_funcao,abrir_funcao) VALUES ('$id_sistema','','','$w','$h','')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function excluirFuncoes() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_sistemasf WHERE id_sistema = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function excluirSistemas() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_sistemas WHERE id_sistema = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function importarXmlSistemas() +{ + global $xml,$tipo; + if(!file_exists($xml)) + {return "
Arquivo $xml não encontrado";} + include_once("../../classesphp/funcoes_gerais.php"); + include("conexao.php"); + $xml = simplexml_load_file($xml); + // + //importa os grupos + // + $sistemasExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_sistemas"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$sistemasExistentes[$r["nome_sistema"]] = 0;} + foreach($xml->SISTEMA as $item) + { + $nome = ixml($item,"NOMESIS"); + $perfil = ixml($item,"PERFIL"); + if(!isset($sistemasExistentes[$nome])) + $dbh->query("INSERT INTO i3geoadmin_sistemas (nome_sistema,perfil_sistema) VALUES ('$nome','$perfil')"); + $sistemasExistentes[$nome] = 0; + $id_sistema = $dbh->lastInsertId("id_sistema"); + foreach ($item->FUNCAO as $funcao) + { + $abrir_funcao = ixml($funcao,"ABRIR"); + $nome_funcao = ixml($funcao,"NOMEFUNCAO"); + $w_funcao = ixml($funcao,"JANELAW"); + $h_funcao = ixml($funcao,"JANELAH"); + $perfil_funcao = ixml($funcao,"PERFIL"); + $dbh->query("INSERT INTO i3geoadmin_sistemasf (nome_funcao,abrir_funcao,perfil_funcao,w_funcao,h_funcao,id_sistema) VALUES ('$nome_funcao','$abrir_funcao','$perfil_funcao','$w_funcao','$h_funcao','$id_sistema')"); + } + } + $dbh = null; + return "Dados importados."; +} +function verificaFilhos() +{ + try + { + global $id; + $res = false; + $r = pegaDados("select * from i3geoadmin_sistemasf where id_sistema=$id"); + if(count($r) > 0) + $res = true; + return $res; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} + +?> \ No newline at end of file diff --git a/admin/php/sqlite.php b/admin/php/sqlite.php new file mode 100644 index 0000000..b468738 --- /dev/null +++ b/admin/php/sqlite.php @@ -0,0 +1,27 @@ +"; +$dbh = new PDO('sqlite:../menutemas/admin.db'); +echo "

Lista de tabelas

"; +$q = $dbh->query("SELECT name FROM (SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type='table' ORDER BY name",PDO::FETCH_ASSOC); +$resultado = $q->fetchAll(); +foreach ($resultado as $r) +echo $r["name"]."
"; + + +$q = $dbh->query("select * from sqlite_master",PDO::FETCH_ASSOC); +$resultado = $q->fetchAll(); +echo "

SQL no padrão SQLITE

"; +foreach($resultado as $r) +{ + echo $r["sql"]."
"; +} +echo "

SQL no padrão POSTGRES

"; +foreach($resultado as $r) +{ + echo str_ireplace("INTEGER PRIMARY KEY","SERIAL",$r["sql"])."
"; +} +echo "

Listagem completa

"; + +var_dump($resultado); +$dbh = null; +?> \ No newline at end of file diff --git a/admin/php/temas.php b/admin/php/temas.php new file mode 100644 index 0000000..9f1e5ed --- /dev/null +++ b/admin/php/temas.php @@ -0,0 +1,577 @@ +set_data(criarNovoMap()); + $cp->return_data(); + break; + case "pegaLayers": + $cp->set_data(pegaLayers()); + $cp->return_data(); + break; + case "pegaCaracteristicasGerais": + $cp->set_data(pegaCaracteristicasGerais()); + $cp->return_data(); + break; + case "pegaMetadados": + $cp->set_data(pegaMetadados()); + $cp->return_data(); + break; + case "pegaClasses": + $cp->set_data(pegaClasses()); + $cp->return_data(); + break; + case "pegaEstilos": + $cp->set_data(pegaEstilos()); + $cp->return_data(); + break; + case "alteraLayer": + substituiCon($map_file,$postgis_mapa); + $cp->set_data(alteraLayer()); + $cp->return_data(); + break; + case "alteraMetadados": + $cp->set_data(alteraMetadados()); + $cp->return_data(); + break; + case "alteraClasse": + substituiCon($map_file,$postgis_mapa); + $cp->set_data(alteraClasse()); + $cp->return_data(); + break; + case "alteraClasseLabel": + substituiCon($map_file,$postgis_mapa); + $cp->set_data(alteraClasseLabel()); + $cp->return_data(); + break; + case "alteraEstilo": + substituiCon($map_file,$postgis_mapa); + $cp->set_data(alteraEstilo()); + $cp->return_data(); + break; + case "pegaFontes": + $cp->set_data(pegaFontes()); + $cp->return_data(); + break; + case "criarNovoLayer": + $cp->set_data(criarNovoLayer()); + $cp->return_data(); + break; + case "excluirLayer": + $cp->set_data(excluirLayer()); + $cp->return_data(); + break; + case "adicionarClasse": + substituiCon($map_file,$postgis_mapa); + $cp->set_data(adicionarClasse()); + $cp->return_data(); + break; + case "excluirClasse": + substituiCon($map_file,$postgis_mapa); + $cp->set_data(excluirClasse()); + $cp->return_data(); + break; + case "adicionarEstilo": + substituiCon($map_file,$postgis_mapa); + $cp->set_data(adicionarEstilo()); + $cp->return_data(); + break; +} +function adicionarEstilo() +{ + global $codigoMap,$codigoLayer,$codigoClasse; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $nl = $mapa->getlayerbyname($codigoLayer); + $classObj = $nl->getclass($codigoClasse); + $nestilo = ms_newStyleObj($classObj); + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function excluirClasse() +{ + global $codigoMap,$codigoLayer,$codigoClasse; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $nl = $mapa->getlayerbyname($codigoLayer); + $classObj = $nl->getclass($codigoClasse); + $classObj->set("status",MS_DELETE); + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function adicionarClasse() +{ + global $codigoMap,$codigoLayer; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $nl = $mapa->getlayerbyname($codigoLayer); + $classObj = ms_newClassObj($nl); + $classObj->set("name"," "); + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function excluirLayer() +{ + global $codigoMap,$codigoLayer; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $nl = $mapa->getlayerbyname($codigoLayer); + $nl->set("status",MS_DELETE); + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function criarNovoLayer() +{ + global $codigoMap; + include_once("../../classesphp/funcoes_gerais.php"); + $mapfile = "../temas/".$codigoMap.".map"; + $mapat = ms_newMapObj("base.map"); + $layer = $mapat->getlayerbyname("base"); + $mapa = ms_newMapObj($mapfile); + $nl = ms_newLayerObj($mapa,$layer); + $nl->set("name",nomeRandomico()); + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function pegaFontes() +{ + $arq = "../symbols/fontes.txt"; + $h = fopen ($arq,"r"); + while ($i = fscanf ($h, "%s\t%s\t")) + { + list ($f,$g) = $i; + $nome[] = $f; + } + return $nome; +} +function alteraEstilo() +{ + global $codigoMap,$codigoLayer,$classe,$estilo,$parametro,$valor; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $classe = $layer->getclass($classe); + $estilo = $classe->getstyle($estilo); + $ok = false; + $cor = ""; + switch ($parametro) + { + case "backgroundcolor": + $cor = $estilo->backgroundcolor; + $ok = true; + break; + case "color": + $cor = $estilo->color; + $ok = true; + break; + case "outlinecolor": + $cor = $estilo->outlinecolor; + $ok = true; + break; + default: + if(!$ok)$estilo->set($parametro,$valor); + } + if ($cor != "") + { + $c = explode(",",$valor); + if(count($c) < 3) + $c = explode(" ",$valor); + $cor->setrgb($c[0],$c[1],$c[2]); + } + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function alteraClasse() +{ + global $codigoMap,$codigoLayer,$classe,$parametro,$valor; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $classe = $layer->getclass($classe); + if($parametro == "text") + {$classe->settext($valor);} + elseif + ($parametro == "expression") + {$classe->setexpression($valor);} + else + $classe->set($parametro,$valor); + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function alteraClasseLabel() +{ + global $codigoMap,$codigoLayer,$classe,$parametro,$valor; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $classe = $layer->getclass($classe); + $label = $classe->label; + $ok = false; + $cor = ""; + switch ($parametro) + { + case "backgroundcolor": + $cor = $label->backgroundcolor; + $ok = true; + break; + case "backgroundshadowcolor": + $cor = $label->backgroundshadowcolor; + $ok = true; + break; + case "color": + $cor = $label->color; + $ok = true; + break; + case "outlinecolor": + $cor = $label->outlinecolor; + $ok = true; + break; + case "shadowcolor": + $cor = $label->shadowcolor; + $ok = true; + break; + case "shadowsizex": + $cor = $label->shadowsizex; + $ok = true; + break; + case "shadowsizey": + $cor = $label->shadowsizey; + $ok = true; + break; + case "backgroundshadowsizex": + $cor = $label->backgroundshadowsizex; + $ok = true; + break; + case "backgroundshadowsizey": + $cor = $label->backgroundshadowsizey; + $ok = true; + break; + default: + if(!$ok)$label->set($parametro,$valor); + } + if ($cor != "") + { + $c = explode(",",$valor); + if(count($c) < 3) + $c = explode(" ",$valor); + $cor->setrgb($c[0],$c[1],$c[2]); + } + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} + +function alteraMetadados() +{ + global $codigoMap,$codigoLayer,$parametro,$valor; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $layer->setmetadata(strtoupper($parametro),$valor); + if($valor == "") + $layer->removemetadata(strtoupper($parametro)); + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} + +function alteraLayer() +{ + global $codigoMap,$codigoLayer,$parametro,$valor; + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $ok = false; + switch ($parametro) + { + case "offsite": + $cor = $layer->offsite; + $c = explode(",",$valor); + if(count($c) < 3) + $c = explode(" ",$valor); + $cor->setrgb($c[0],$c[1],$c[2]); + $ok = true; + break; + case "filter": + $layer->setfilter($valor); + $ok = true; + break; + default: + if(!$ok)$layer->set($parametro,$valor); + } + $mapa->save($mapfile); + removeCabecalho($mapfile); + return "ok"; +} +function removeCabecalho($arq) +{ + global $postgis_mapa; + restauraCon($arq,$postgis_mapa); + $handle = fopen($arq, "r"); + if ($handle) + { + $final[] = "SYMBOLSET ../symbols/simbolos.sym\n"; + $final[] = "FONTSET ".'"'."../symbols/fontes.txt".'"'."\n"; + $grava = false; + while (!feof($handle)) + { + $linha = fgets($handle); + if(strtoupper(trim($linha)) == "LAYER") + {$grava = true;} + if($grava) + {$final[] = $linha."\n";} + } + fclose($handle); + } + $handle = fopen($arq, "w+"); + foreach ($final as $f) + { + if(($f != "") && ($f != 'FILTERITEM ""') && ($f != 'LABELITEM ""')) + fwrite($handle,$f); + } + fclose($handle); +} +function pegaLayers() +{ + global $codigoMap; + $dados = array(); + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layers = $mapa->getalllayernames(); + $dados["layers"] = $layers; + return $dados; +} +function pegaCaracteristicasGerais() +{ + global $codigoMap,$codigoLayer; + $dados = array(); + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $dados["connection"] = $layer->connection; + $dados["connectiontype"] = $layer->connectiontype; + $dados["data"] = $layer->data; + $dados["type"] = $layer->type; + $dados["filter"] = $layer->getfilter(); + if($dados["filter"]== ""){$dados["filter"] = "";} + $dados["filteritem"] = $layer->filteritem; + $dados["group"] = $layer->group; + $dados["labelangleitem"] = $layer->labelangleitem; + $dados["labelitem"] = $layer->labelitem; + $dados["labelmaxscale"] = $layer->labelmaxscale; + $dados["labelmaxscale"] = $layer->labelmaxscale; + $dados["labelminscale"] = $layer->labelminscale; + $dados["labelsizeitem"] = $layer->labelsizeitem; + $dados["maxscale"] = $layer->maxscale; + $dados["minscale"] = $layer->minscale; + $dados["offsite"] = $layer->offsite->red.",".$layer->offsite->green.",".$layer->offsite->blue; + $dados["opacity"] = $layer->opacity; + $dados["symbolscale"] = $layer->symbolscale; + $dados["tileindex"] = $layer->tileindex; + $dados["tileitem"] = $layer->tileitem; + $dados["tolerance"] = $layer->tolerance; + $dados["toleranceunits"] = $layer->toleranceunits; + $dados["status"] = $layer->status; + $dados["sizeunits"] = $layer->sizeunits; + $dados["projection"] = $layer->getProjection; + $dados["name"] = $layer->name; + if($dados["type"] < 3) + { + $layer->open(); + $colunas = implode(", ",$layer->getitems()); + $layer->close(); + } + $dados["colunas"] = $colunas; + return $dados; +} +function pegaMetadados() +{ + global $codigoMap,$codigoLayer; + $dados = array(); + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $dados["itens"] = $layer->getmetadata("itens"); + $dados["itensdesc"] = $layer->getmetadata("itensdesc"); + $dados["itenslink"] = $layer->getmetadata("itenslink"); + $dados["tip"] = $layer->getmetadata("tip"); + $dados["tema"] = mb_convert_encoding(($layer->getmetadata("tema")),"UTF-8","ISO-8859-1"); + $dados["classe"] = $layer->getmetadata("classe"); + $dados["escala"] = $layer->getmetadata("escala"); + $dados["download"] = $layer->getmetadata("download"); + $dados["escondido"] = $layer->getmetadata("escondido"); + $dados["extensao"] = $layer->getmetadata("extensao"); + $dados["identifica"] = $layer->getmetadata("identifica"); + $dados["mensagem"] = mb_convert_encoding(($layer->getmetadata("mensagem")),"UTF-8","ISO-8859-1"); + $dados["classesitem"] = $layer->getmetadata("classesitem"); + $dados["classesnome"] = $layer->getmetadata("classesnome"); + $dados["classescor"] = $layer->getmetadata("classescor"); + $dados["classessimbolo"] = $layer->getmetadata("classessimbolo"); + $dados["classestamanho"] = $layer->getmetadata("classestamanho"); + $dados["aplicaextensao"] = $layer->getmetadata("aplicaextensao"); + return $dados; +} +function pegaClasses() +{ + global $codigoMap,$codigoLayer; + $dados = array(); + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $nclasses = $layer->numclasses; + for($i=0;$i<$nclasses;++$i) + { + $classe = $layer->getclass($i); + $temp["name"] = mb_convert_encoding(($classe->name),"UTF-8","ISO-8859-1"); + $temp["expression"] = $classe->getExpression(); + $temp["keyimage"] = $classe->keyimage; + $temp["maxscale"] = $classe->maxscale; + $temp["minscale"] = $classe->minscale; + $temp["maxsize"] = $classe->maxsize; + $temp["minsize"] = $classe->minsize; + $temp["size"] = $classe->size; + $temp["status"] = $classe->status; + $temp["symbolname"] = $classe->symbolname; + $temp["text"] = mb_convert_encoding(($classe->getTextString()),"UTF-8","ISO-8859-1"); + $temp["type"] = $classe->type; + $label = $classe->label; + if ($label != "") + { + $t["font"] = $label->font; + $t["type"] = $label->type; + $t["backgroundcolor"] = $label->backgroundcolor->red.",".$label->backgroundcolor->green.",".$label->backgroundcolor->blue; + $t["backgroundshadowcolor"] = $label->backgroundshadowcolor->red.",".$label->backgroundshadowcolor->green.",".$label->backgroundshadowcolor->blue; + $t["color"] = $label->color->red.",".$label->color->green.",".$label->color->blue; + $t["outlinecolor"] = $label->outlinecolor->red.",".$label->outlinecolor->green.",".$label->outlinecolor->blue; + $t["shadowcolor"] = $label->shadowcolor->red.",".$label->shadowcolor->green.",".$label->shadowcolor->blue; + $t["shadowsizex"] = $label->shadowsizex; + $t["shadowsizey"] = $label->shadowsizey; + $t["backgroundshadowsizex"] = $label->backgroundshadowsizex; + $t["backgroundshadowsizey"] = $label->backgroundshadowsizey; + $t["size"] = $label->size; + $t["minsize"] = $label->minsize; + $t["maxsize"] = $label->maxsize; + $t["position"] = $label->position; + $t["offsetx"] = $label->offsetx; + $t["offsety"] = $label->offsety; + $t["angle"] = $label->angle; + $t["autoangle"] = $label->autoangle; + $t["buffer"] = $label->buffer; + $t["antialias"] = $label->antialias; + $t["wrap"] = $label->wrap; + $t["minfeaturesize"] = $label->minfeaturesize; + $t["autominfeaturesize"] = $label->autominfeaturesize; + $t["mindistance"] = $label->mindistance; + $t["partials"] = $label->partials; + $t["force"] = $label->force; + $t["encoding"] = $label->encoding; + $temp["label"] = $t; + } + else + $temp["label"] = array(); + $dados[] = array("id"=>$i,"dados"=>$temp); + } + return $dados; +} +function pegaEstilos() +{ + global $codigoMap,$codigoLayer; + $dados = array(); + $mapfile = "../temas/".$codigoMap.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname($codigoLayer); + $nclasses = $layer->numclasses; + for($i=0;$i<$nclasses;++$i) + { + $classe = $layer->getclass($i); + $numestilos = $classe->numstyles; + $estilos = array(); + for($j=0;$j<$numestilos;++$j) + { + $estilo = $classe->getstyle($j); + $temp["symbolname"] = $estilo->symbolname; + $temp["color"] = $estilo->color->red.",".$estilo->color->green.",".$estilo->color->blue; + $temp["size"] = $estilo->size; + $temp["minsize"] = $estilo->minsize; + $temp["maxsize"] = $estilo->maxsize; + $temp["offsetx"] = $estilo->offsetx; + $temp["offsety"] = $estilo->offsety; + $temp["antialias"] = $estilo->antialias; + $temp["backgroundcolor"] = $estilo->backgroundcolor->red.",".$estilo->backgroundcolor->green.",".$estilo->backgroundcolor->blue; + $temp["outlinecolor"] = $estilo->outlinecolor->red.",".$estilo->outlinecolor->green.",".$estilo->outlinecolor->blue; + $temp["width"] = $estilo->width; + $temp["minwidth"] = $estilo->minwidth; + $temp["maxwidth"] = $estilo->maxwidth; + $temp["angle"] = $estilo->angle; + $temp["angleitem"] = $estilo->angleitem; + $temp["sizeitem"] = $estilo->sizeitem; + $temp["minvalue"] = $estilo->minvalue; + $temp["maxvalue"] = $estilo->maxvalue; + $estilos[] = array("estilo"=>$j,"dados"=>$temp); + } + $dados[] = array("classe"=>$i,"estilos"=>$estilos); + } + return $dados; +} +function criarNovoMap() +{ + global $nome,$codigo; + if(!file_exists("../temas/".$codigo.".map")) + { + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + copy("base.map","../temas/".$codigo.".map"); + $mapfile = "../temas/".$codigo.".map"; + $mapa = ms_newMapObj($mapfile); + $layer = $mapa->getlayerbyname("base"); + $layer->set("name",$codigo); + $mapa->save($mapfile); + require_once("conexao.php"); + $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')"); + $dbh = null; + + return "ok"; + } + return "erro"; +} +?> \ No newline at end of file diff --git a/admin/php/webservices.php b/admin/php/webservices.php new file mode 100644 index 0000000..725863d --- /dev/null +++ b/admin/php/webservices.php @@ -0,0 +1,138 @@ +set_data(verificaEditores($editores)); + $cp->return_data(); + break; + + case "pegaWS": + $cp->set_data(pegaDados('SELECT * from i3geoadmin_ws order by tipo_ws')); + $cp->return_data(); + break; + + case "alterarWS": + alterarWS(); + if($id_ws == "") + $cp->set_data(pegaDados('SELECT * from i3geoadmin_ws')); + else + $cp->set_data(pegaDados('SELECT * from i3geoadmin_ws where id_ws = '.$id_ws)); + $cp->return_data(); + break; + + case "excluir": + $cp->set_data(excluirWS()); + $cp->return_data(); + break; + + case "importarXmlWS": + $cp->set_data(importarXmlWS()); + $cp->return_data(); + break; +} +/* +Function: alterarWS + +Altera o registro de um WS +*/ +function alterarWS() +{ + global $id_ws,$desc,$nome,$link,$autor,$tipo; + try + { + require_once("conexao.php"); + $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); + $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); + $autor = mb_convert_encoding($autor,"UTF-8","ISO-8859-1"); + if($id_ws != "") + $dbh->query("UPDATE i3geoadmin_ws SET desc_ws = '$desc',nome_ws = '$nome', link_ws = '$link', autor_ws = '$autor', tipo_ws = '$tipo' WHERE id_ws = $id_ws"); + else + $dbh->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,tipo_ws,link_ws) VALUES ('','','','','')"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function excluirWS() +{ + global $id; + try + { + include("conexao.php"); + $dbh->query("DELETE from i3geoadmin_ws WHERE id_ws = $id"); + $dbh = null; + return "ok"; + } + catch (PDOException $e) + { + return "Error!: " . $e->getMessage(); + } +} +function importarXmlWS() +{ + global $xml,$tipo; + if(!file_exists($xml)) + {return "
Arquivo $xml não encontrado";} + include_once("../../classesphp/funcoes_gerais.php"); + include("conexao.php"); + $xml = simplexml_load_file($xml); + // + //importa os grupos + // + $wsExistentes = array(); + $q = $dbh->query("select * from i3geoadmin_ws"); + $resultado = $q->fetchAll(); + foreach($resultado as $r) + {$wsExistentes[$r["nome_ws"]] = 0;} + foreach($xml->channel as $c) + { + foreach($c->item as $item) + { + $descricao = ixml($item,"description"); + $nome = ixml($item,"title"); + $autor = ixml($item,"author"); + $link = ixml($item,"link"); + if(!isset($wsExistentes[$nome])) + $dbh->query("INSERT INTO i3geoadmin_ws (nome_ws,desc_ws,autor_ws,link_ws,tipo_ws) VALUES ('$nome','$desc','$autor','$link','$tipo')"); + $wsExistentes[$nome] = 0; + } + } + $dbh = null; + return "Dados importados."; +} +?> \ No newline at end of file diff --git a/admin/xmlatlas.php b/admin/xmlatlas.php new file mode 100644 index 0000000..a1c182c --- /dev/null +++ b/admin/xmlatlas.php @@ -0,0 +1,72 @@ +"; +//echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">"; +echo "\n\n"; +if (!isset($perfil)){$perfil = "";} + +$q = "select * from i3geoadmin_atlas "; +$qatlas = $dbh->query($q); +foreach($qatlas as $row) +{ + echo "\n"; + echo " ".$row["id_atlas"]."\n"; + echo " ".xmlmenu_prepara($row["titulo_atlas"])."\n"; + echo " ".xmlmenu_prepara($row["desc_atlas"])."\n"; + echo " ".$row["icone_atlas"]."\n"; + echo " ".xmlmenu_prepara($row["link_atlas"])."\n"; + echo " ".xmlmenu_prepara($row["template_atlas"])."\n"; + echo " ".$row["w_atlas"]."\n"; + echo " ".$row["h_atlas"]."\n"; + echo " ".$row["pranchadefault_atlas"]."\n"; + echo " ".$row["tipoguias_atlas"]."\n"; + echo " ".$row["basemapfile_atlas"]."\n"; + echo " \n"; + xmlmenu_pegapranchas($row["id_atlas"]); + echo " \n"; + echo " \n"; +} +echo "\n"; +$dbh = null; +function xmlmenu_pegapranchas($id_atlas) +{ + global $dbh; + $q = "select * from i3geoadmin_atlasp as p where p.id_atlas = $id_atlas "; + $qpranchas = $dbh->query($q); + foreach($qpranchas as $row) + { + echo " \n"; + echo " ".$row["id_prancha"]."\n"; + echo " ".xmlmenu_prepara($row["titulo_prancha"])."\n"; + echo " ".xmlmenu_prepara($row["desc_prancha"])."\n"; + echo " ".$row["icone_prancha"]."\n"; + echo " ".xmlmenu_prepara($row["link_prancha"])."\n"; + echo " ".$row["w_prancha"]."\n"; + echo " ".$row["h_prancha"]."\n"; + echo " ".$row["mapext_prancha"]."\n"; + echo " \n"; + xmlmenu_pegatemas($row["id_prancha"]); + echo " \n"; + echo " \n"; + } +} +function xmlmenu_pegatemas($id_prancha) +{ + global $dbh; + $q = "select * from i3geoadmin_atlast as t where t.id_prancha = $id_prancha "; + $qpranchas = $dbh->query($q); + foreach($qpranchas as $row) + { + echo "\n"; + echo "\n"; + } +} +function xmlmenu_prepara($texto) +{ + return str_replace("&","&",$texto); +} +?> diff --git a/admin/xmlmenutemas.php b/admin/xmlmenutemas.php new file mode 100644 index 0000000..764a711 --- /dev/null +++ b/admin/xmlmenutemas.php @@ -0,0 +1,126 @@ +"; +//echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">"; +echo "\n\n"; +echo "\n"; +if (!isset($perfil)){$perfil = "";} +// +//pega os temas na raiz +// +$q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema from i3geoadmin_raiz as r,i3geoadmin_temas as temas where r.id_nivel = 0 and r.id_tema = temas.id_tema and r.id_menu = $id_menu "; +if($perfil == "") +$q .= "and r.perfil = ''"; +else +{ + $perfis = explode(" ",$perfil); + foreach ($perfis as $p) + {$q .= "and r.perfil = '$p' ";} +} +$qtemasraiz = $dbh->query($q); +xmlmenu_notema($qtemasraiz); + + +$q = "select nome_grupo,desc_grupo,n1.id_grupo,n1.id_n1 from i3geoadmin_n1 as n1,i3geoadmin_grupos as grupos where n1.id_menu = $id_menu and n1.id_grupo = grupos.id_grupo "; +if($perfil == "") +$q .= "and n1_perfil = ''"; +else +{ + $perfis = explode(" ",$perfil); + foreach ($perfis as $p) + { + $q .= "and n1_perfil = '$p' "; + } +} +$qgrupos = $dbh->query($q); +foreach($qgrupos as $row) +{ + echo "\n"; + echo " ".xmlmenu_prepara($row["nome_grupo"])."\n"; + // + //pega temas na raiz + // + $q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema from i3geoadmin_raiz as r,i3geoadmin_temas as temas where r.nivel = 1 and r.id_nivel = ".$row["id_n1"]." and r.id_tema = temas.id_tema and r.id_menu = $id_menu "; + if($perfil == "") + $q .= "and r.perfil = ''"; + else + { + $perfis = explode(" ",$perfil); + foreach ($perfis as $p) + {$q .= "and r.perfil = '$p' ";} + } + $qtemasraiz = $dbh->query($q); + xmlmenu_notema($qtemasraiz); + if(isset($tipo) && ($tipo == "subgrupos") || ($tipo == "")) + xmlmenu_pegasubgrupos($row["id_n1"]); + echo " ".xmlmenu_prepara($row["desc_grupo"])."\n"; + echo "\n"; +} +echo "\n"; +$dbh = null; +function xmlmenu_pegasubgrupos($id_n1) +{ + global $dbh,$perfis,$tipo; + $q = "select subgrupos.id_subgrupo,nome_subgrupo,id_n2 from i3geoadmin_n2 as n2,i3geoadmin_subgrupos as subgrupos where n2.id_n2 = $id_n1 and n2.id_subgrupo = subgrupos.id_subgrupo "; + if(count($perfis) == 0) + $q .= "and n2_perfil = ''"; + else + { + foreach ($perfis as $p) + { + $q .= "and n2_perfil = '$p' "; + } + } + $qsgrupos = $dbh->query($q); + foreach($qsgrupos as $row) + { + echo "\n"; + echo "".xmlmenu_prepara($row["nome_subgrupo"])."\n"; + if(isset($tipo) && ($tipo == "temas") || ($tipo == "")) + xmlmenu_pegatemas($row["id_n2"]); + echo "\n"; + } +} +function xmlmenu_pegatemas($id_n2) +{ + global $dbh,$perfis; + $q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema from i3geoadmin_n3 as n3,i3geoadmin_temas as temas where n3.id_n2 = $id_n2 and n3.id_tema = temas.id_tema "; + if(count($perfis) == 0) + $q .= "and n3_perfil = ''"; + else + { + foreach ($perfis as $p) + { + $q .= "and n3_perfil = '$p' "; + } + } + $qtemas = $dbh->query($q); + xmlmenu_notema($qtemas); +} +function xmlmenu_notema($qtemas) +{ + foreach($qtemas as $row) + { + echo "\n"; + echo "".$row["codigo_tema"]."\n"; + echo "".xmlmenu_prepara($row["nome_tema"])."\n"; + echo "".xmlmenu_prepara($row["desc_tema"])."\n"; + echo "".xmlmenu_prepara($row["link_tema"])."\n"; + echo "".$row["tipoa_tema"]."\n"; + echo "".xmlmenu_prepara($row["tags_tema"])."\n"; + echo "".$row["kml_tema"]."\n"; + echo "".$row["ogc_tema"]."\n"; + echo "".$row["download_tema"]."\n"; + echo "\n"; + } +} +function xmlmenu_prepara($texto) +{ + return str_replace("&","&",$texto); +} +?> -- libgit2 0.21.2