From d51bcc6c23bf1f1e794539db30608d3d1df55f9c Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 15 Oct 2013 19:47:24 +0000 Subject: [PATCH] $1 --- admin/admin.db | Bin 214016 -> 0 bytes admin/menu.html | 85 +++++++++++++++++++++++++++++++++++++++++++++---------------------------------------- admin/php/xml.php | 34 ++++++++++++++++++++++------------ 3 files changed, 67 insertions(+), 52 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index 0e738c3..0a9217c 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/admin/menu.html b/admin/menu.html index bebe866..035fc4d 100644 --- a/admin/menu.html +++ b/admin/menu.html @@ -4,7 +4,7 @@ - +
 
- +
- + diff --git a/admin/php/xml.php b/admin/php/xml.php index 4d8b556..ab6d38c 100644 --- a/admin/php/xml.php +++ b/admin/php/xml.php @@ -299,7 +299,7 @@ function geraXmlWMS($locaplic) return geraXmlRSS($locaplic,$sql,"Web services WMS-OGC"); } /* - Function: geraXmlWMSmetaestat +Function: geraXmlWMSmetaestat RSS com a lista de WMS das variaveis cadastradas no sistema de metadados estatisticos @@ -619,6 +619,8 @@ function geraXmlMapas($perfil,$locaplic,$editores) $q = "select * from ".$esquemaadmin."i3geoadmin_mapas"; $q = $dbh->query($q); $editor = "nao";//$editor = "nao";//verificaEditores($editores); + $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); + $url = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST']."/".(basename(str_replace("/admin/php/xml.php","",__FILE__))); foreach($q as $row) { $mostraMapa = false; @@ -637,15 +639,23 @@ function geraXmlMapas($perfil,$locaplic,$editores) if($mostraMapa) { $xml .= "\n"; - $xml .= " ".$row["perfil_mapa"]."\n"; + $perfil = $row["perfil_mapa"]; + $xml .= " ".$perfil."\n"; $xml .= " ".xmlTexto_prepara($row["nome_mapa"])."\n"; $xml .= " ".xmlTexto_prepara($row["desc_mapa"])."\n"; $xml .= " ".xmlTexto_prepara($row["imagem_mapa"])."\n"; $xml .= " ".$row["temas_mapa"]."\n"; $xml .= " ".$row["ligados_mapa"]."\n"; - $xml .= " ".$row["ext_mapa"]."\n"; - $xml .= " ".xmlTexto_prepara($row["outros_mapa"])."\n"; - $xml .= " ".xmlTexto_prepara($row["linkdireto_mapa"])."\n"; + $extensao = $row["ext_mapa"]; + $xml .= " ".$extensao."\n"; + $outros = xmlTexto_prepara($row["outros_mapa"]); + $xml .= " ".$outros."\n"; + $linkdireto = xmlTexto_prepara($row["linkdireto_mapa"]); + if(empty($linkdireto)){ + $linkdireto = $url."/ms_criamapa.php?mapext=".$extensao."&perfil=".$perfil."&temasa=".$temas."&layers=".$ligados.$row["outros_mapa"]; + $linkdireto = xmlTexto_prepara($linkdireto); + } + $xml .= " ".$linkdireto."\n"; $xml .= " ".$row["publicado_mapa"]."\n"; if($row["mapfile"] != ""){ $xml .= " sim\n"; @@ -861,13 +871,13 @@ function geraXmlSistemas_pegafuncoes($perfil,$xml,$id_sistema,$dbh) } function array_in_array($needle, $haystack) { - //Make sure $needle is an array for foreach - if(!is_array($needle)) $needle = array($needle); - //For each value in $needle, return TRUE if in $haystack - foreach($needle as $pin) - if(in_array($pin, $haystack)) return TRUE; - //Return FALSE if none of the values from $needle are found in $haystack - return FALSE; + //Make sure $needle is an array for foreach + if(!is_array($needle)) $needle = array($needle); + //For each value in $needle, return TRUE if in $haystack + foreach($needle as $pin) + if(in_array($pin, $haystack)) return TRUE; + //Return FALSE if none of the values from $needle are found in $haystack + return FALSE; } function xmlTexto_prepara($texto) { -- libgit2 0.21.2