Commit 5cbd9c8653e46944d198e06d0433808d9e6e82fc

Authored by Edmar Moretti
1 parent 6e60bf07

Inclusão do programa xmladminmapas.php para geração do xml mapas.xml usando o ba…

…nco de administracao.
admin/php/admin.php
@@ -166,5 +166,14 @@ function pegaDados($sql) @@ -166,5 +166,14 @@ function pegaDados($sql)
166 return "Error!: " . $e->getMessage(); 166 return "Error!: " . $e->getMessage();
167 } 167 }
168 } 168 }
169 - 169 +function array_in_array($needle, $haystack)
  170 +{
  171 + //Make sure $needle is an array for foreach
  172 + if(!is_array($needle)) $needle = array($needle);
  173 + //For each value in $needle, return TRUE if in $haystack
  174 + foreach($needle as $pin)
  175 + if(in_array($pin, $haystack)) return TRUE;
  176 + //Return FALSE if none of the values from $needle are found in $haystack
  177 + return FALSE;
  178 +}
170 ?> 179 ?>
171 \ No newline at end of file 180 \ No newline at end of file
admin/xmlatlas.php
@@ -2,8 +2,26 @@ @@ -2,8 +2,26 @@
2 // 2 //
3 //$id_menu = id do menu que será montado 3 //$id_menu = id do menu que será montado
4 //$perfil = perfis 4 //$perfil = perfis
5 -include_once("php/admin.php");  
6 -include_once("php/conexao.php"); 5 +if(!isset($locaplic))
  6 +{
  7 + $locaplic = "";
  8 + if(file_exists("../../../ms_configura.php"))
  9 + {include_once("../../../ms_configura.php");}
  10 + else
  11 + {
  12 + if(file_exists("../../ms_configura.php"))
  13 + {include_once("../../ms_configura.php");}
  14 + else
  15 + {
  16 + if(file_exists("../ms_configura.php"))
  17 + {include_once("../ms_configura.php");}
  18 + else
  19 + include_once("ms_configura.php");
  20 + }
  21 + }
  22 +}
  23 +include_once($locaplic."/admin/php/admin.php");
  24 +include_once($locaplic."/admin/php/conexao.php");
7 echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; 25 echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">";
8 //echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">"; 26 //echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">";
9 echo "\n<RAIZ>\n"; 27 echo "\n<RAIZ>\n";
admin/xmlidentifica.php
@@ -2,8 +2,26 @@ @@ -2,8 +2,26 @@
2 // 2 //
3 //$id_menu = id do menu que será montado 3 //$id_menu = id do menu que será montado
4 //$perfil = perfis 4 //$perfil = perfis
5 -include_once("php/admin.php");  
6 -include_once("php/conexao.php"); 5 +if(!isset($locaplic))
  6 +{
  7 + $locaplic = "";
  8 + if(file_exists("../../../ms_configura.php"))
  9 + {include_once("../../../ms_configura.php");}
  10 + else
  11 + {
  12 + if(file_exists("../../ms_configura.php"))
  13 + {include_once("../../ms_configura.php");}
  14 + else
  15 + {
  16 + if(file_exists("../ms_configura.php"))
  17 + {include_once("../ms_configura.php");}
  18 + else
  19 + include_once("ms_configura.php");
  20 + }
  21 + }
  22 +}
  23 +include_once($locaplic."/admin/php/admin.php");
  24 +include_once($locaplic."/admin/php/conexao.php");
7 echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; 25 echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">";
8 //echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">"; 26 //echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">";
9 echo "\n<SISTEMAS>\n"; 27 echo "\n<SISTEMAS>\n";
admin/xmlmapas.php 0 → 100644
@@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
  1 +<?php
  2 +//
  3 +//$perfil = perfis
  4 +//
  5 +if(!isset($locaplic))
  6 +{
  7 + $locaplic = "";
  8 + if(file_exists("../../../ms_configura.php"))
  9 + {include_once("../../../ms_configura.php");}
  10 + else
  11 + {
  12 + if(file_exists("../../ms_configura.php"))
  13 + {include_once("../../ms_configura.php");}
  14 + else
  15 + {
  16 + if(file_exists("../ms_configura.php"))
  17 + {include_once("../ms_configura.php");}
  18 + else
  19 + include_once("ms_configura.php");
  20 + }
  21 + }
  22 +}
  23 +include_once($locaplic."/admin/php/admin.php");
  24 +include_once($locaplic."/admin/php/conexao.php");
  25 +if (!isset($perfil)){$perfil = "";}
  26 +$perfil = str_replace(","," ",$perfil);
  27 +$perfil = explode(" ",$perfil);
  28 +
  29 +echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">";
  30 +//echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">";
  31 +echo "\n<MAPAS>\n";
  32 +$q = "select * from i3geoadmin_mapas";
  33 +$q = $dbh->query($q);
  34 +foreach($q as $row)
  35 +{
  36 + if($row["perfil_mapa"] == "")
  37 + $mostraMapa = true;
  38 + else
  39 + {
  40 + $perfilMapa = explode(" ",str_replace(","," ",$row["perfil_mapa"]));
  41 + $mostraMapa = array_in_array($perfil,$perfilMapa);
  42 + }
  43 + if($mostraMapa)
  44 + {
  45 + echo "<MAPA>\n";
  46 + echo " <PERFIL>".$row["perfil_mapa"]."</PERFIL>\n";
  47 + echo " <NOME>".xmlmenu_prepara($row["nome_mapa"])."</NOME>\n";
  48 + echo " <DESCRICAO>".xmlmenu_prepara($row["desc_mapa"])."</DESCRICAO>\n";
  49 + echo " <IMAGEM>".xmlmenu_prepara($row["imagem_mapa"])."</IMAGEM>\n";
  50 + echo " <TEMAS>".$row["temas_mapa"]."</TEMAS>\n";
  51 + echo " <LIGADOS>".$row["ligados_mapa"]."</LIGADOS>\n";
  52 + echo " <EXTENSAO>".$row["ext_mapa"]."</EXTENSAO>\n";
  53 + echo " <OUTROS>".xmlmenu_prepara($row["outros_mapa"])."</OUTROS>\n";
  54 + echo " <LINKDIRETO>".xmlmenu_prepara($row["linkdireto_mapa"])."</LINKDIRETO>\n";
  55 + echo " </MAPA>\n";
  56 + }
  57 +}
  58 +echo "</MAPAS>\n";
  59 +$dbh = null;
  60 +function xmlmenu_prepara($texto)
  61 +{
  62 + return str_replace("&","&amp;",$texto);
  63 +}
  64 +?>
admin/xmlmenutemas.php
@@ -24,6 +24,10 @@ if(!isset($locaplic)) @@ -24,6 +24,10 @@ if(!isset($locaplic))
24 } 24 }
25 include_once($locaplic."/admin/php/admin.php"); 25 include_once($locaplic."/admin/php/admin.php");
26 include_once($locaplic."/admin/php/conexao.php"); 26 include_once($locaplic."/admin/php/conexao.php");
  27 +if (!isset($perfil)){$perfil = "";}
  28 +$perfil = str_replace(","," ",$perfil);
  29 +$perfil = explode(" ",$perfil);
  30 +
27 echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">"; 31 echo "<"."\x3F"."xml version='1.0' encoding='UTF-8' "."\x3F".">";
28 //echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">"; 32 //echo "<"."\x3F"."xml-stylesheet type='text/xsl' href='../menutemas/menutemas.xsl'"."\x3F".">";
29 echo "\n<TEMASGEO>\n"; 33 echo "\n<TEMASGEO>\n";
@@ -31,117 +35,107 @@ if(!isset($id_menu)) @@ -31,117 +35,107 @@ if(!isset($id_menu))
31 echo "<CABECALHO>Utilize ?id_menu=1 por exemplo</CABECALHO>\n"; 35 echo "<CABECALHO>Utilize ?id_menu=1 por exemplo</CABECALHO>\n";
32 else 36 else
33 echo "<CABECALHO></CABECALHO>\n"; 37 echo "<CABECALHO></CABECALHO>\n";
34 -if (!isset($perfil)){$perfil = "";} 38 +
35 // 39 //
36 //pega os temas na raiz 40 //pega os temas na raiz
37 // 41 //
38 -$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 ";  
39 -if($perfil == "")  
40 -$q .= "and r.perfil = ''";  
41 -else  
42 -{  
43 - $perfis = explode(" ",$perfil);  
44 - foreach ($perfis as $p)  
45 - {$q .= "and r.perfil = '$p' ";}  
46 -} 42 +$q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema,r.perfil as perfil 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 ";
47 $qtemasraiz = $dbh->query($q); 43 $qtemasraiz = $dbh->query($q);
48 xmlmenu_notema($qtemasraiz); 44 xmlmenu_notema($qtemasraiz);
49 45
50 -  
51 -$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 ";  
52 -if($perfil == "")  
53 -$q .= "and n1_perfil = ''";  
54 -else  
55 -{  
56 - $perfis = explode(" ",$perfil);  
57 - foreach ($perfis as $p)  
58 - {  
59 - $q .= "and n1_perfil = '$p' ";  
60 - }  
61 -} 46 +$q = "select nome_grupo,desc_grupo,n1.id_grupo,n1.id_n1,n1.n1_perfil as perfil from i3geoadmin_n1 as n1,i3geoadmin_grupos as grupos where n1.id_menu = $id_menu and n1.id_grupo = grupos.id_grupo ";
62 $qgrupos = $dbh->query($q); 47 $qgrupos = $dbh->query($q);
  48 +
63 foreach($qgrupos as $row) 49 foreach($qgrupos as $row)
64 { 50 {
65 - echo "<GRUPO>\n";  
66 - echo " <GTIPO>".xmlmenu_prepara($row["nome_grupo"])."</GTIPO>\n";  
67 - //  
68 - //pega temas na raiz  
69 - //  
70 - $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 ";  
71 - if($perfil == "")  
72 - $q .= "and r.perfil = ''"; 51 + if($row["perfil"] == "")
  52 + $mostra = true;
73 else 53 else
74 { 54 {
75 - $perfis = explode(" ",$perfil);  
76 - foreach ($perfis as $p)  
77 - {$q .= "and r.perfil = '$p' ";} 55 + $perfilatual = explode(" ",str_replace(","," ",$row["perfil"]));
  56 + $mostra = array_in_array($perfil,$perfilatual);
  57 + }
  58 + if($mostra)
  59 + {
  60 + echo "<GRUPO>\n";
  61 + echo " <GTIPO>".xmlmenu_prepara($row["nome_grupo"])."</GTIPO>\n";
  62 + //
  63 + //pega temas na raiz
  64 + //
  65 + $q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema,r.perfil as perfil 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 ";
  66 + $qtemasraiz = $dbh->query($q);
  67 + xmlmenu_notema($qtemasraiz);
  68 + if(isset($tipo) && ($tipo == "subgrupos") || ($tipo == ""))
  69 + xmlmenu_pegasubgrupos($row["id_n1"]);
  70 + echo " <DTIPO>".xmlmenu_prepara($row["desc_grupo"])."</DTIPO>\n";
  71 + echo " <PERFIL>".$row["perfil"]."</PERFIL>\n";
  72 + echo "</GRUPO>\n";
78 } 73 }
79 - $qtemasraiz = $dbh->query($q);  
80 - xmlmenu_notema($qtemasraiz);  
81 - if(isset($tipo) && ($tipo == "subgrupos") || ($tipo == ""))  
82 - xmlmenu_pegasubgrupos($row["id_n1"]);  
83 - echo " <DTIPO>".xmlmenu_prepara($row["desc_grupo"])."</DTIPO>\n";  
84 - echo "</GRUPO>\n";  
85 } 74 }
86 echo "</TEMASGEO>\n"; 75 echo "</TEMASGEO>\n";
87 $dbh = null; 76 $dbh = null;
88 function xmlmenu_pegasubgrupos($id_n1) 77 function xmlmenu_pegasubgrupos($id_n1)
89 { 78 {
90 - global $dbh,$perfis,$tipo;  
91 - $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 ";  
92 - if(count($perfis) == 0)  
93 - $q .= "and n2_perfil = ''";  
94 - else  
95 - {  
96 - foreach ($perfis as $p)  
97 - {  
98 - $q .= "and n2_perfil = '$p' ";  
99 - }  
100 - } 79 + global $dbh,$tipo,$perfil;
  80 + $q = "select subgrupos.id_subgrupo,nome_subgrupo,id_n2,n2.n2_perfil as perfil from i3geoadmin_n2 as n2,i3geoadmin_subgrupos as subgrupos where n2.id_n2 = $id_n1 and n2.id_subgrupo = subgrupos.id_subgrupo ";
101 $qsgrupos = $dbh->query($q); 81 $qsgrupos = $dbh->query($q);
102 foreach($qsgrupos as $row) 82 foreach($qsgrupos as $row)
103 { 83 {
104 - echo "<SGRUPO>\n";  
105 - echo "<SDTIPO>".xmlmenu_prepara($row["nome_subgrupo"])."</SDTIPO>\n";  
106 - if(isset($tipo) && ($tipo == "temas") || ($tipo == ""))  
107 - xmlmenu_pegatemas($row["id_n2"]);  
108 - echo "</SGRUPO>\n"; 84 + if($row["perfil"] == "")
  85 + $mostra = true;
  86 + else
  87 + {
  88 + $perfilatual = explode(" ",str_replace(","," ",$row["perfil"]));
  89 + $mostra = array_in_array($perfil,$perfilatual);
  90 + }
  91 + if($mostra)
  92 + {
  93 + echo "<SGRUPO>\n";
  94 + echo "<SDTIPO>".xmlmenu_prepara($row["nome_subgrupo"])."</SDTIPO>\n";
  95 + echo "<PERFIL>".xmlmenu_prepara($row["perfil"])."</PERFIL>\n";
  96 + if(isset($tipo) && ($tipo == "temas") || ($tipo == ""))
  97 + xmlmenu_pegatemas($row["id_n2"]);
  98 + echo "</SGRUPO>\n";
  99 + }
109 } 100 }
110 } 101 }
111 function xmlmenu_pegatemas($id_n2) 102 function xmlmenu_pegatemas($id_n2)
112 { 103 {
113 - global $dbh,$perfis;  
114 - $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 ";  
115 - if(count($perfis) == 0)  
116 - $q .= "and n3_perfil = ''";  
117 - else  
118 - {  
119 - foreach ($perfis as $p)  
120 - {  
121 - $q .= "and n3_perfil = '$p' ";  
122 - }  
123 - } 104 + global $dbh,$perfil;
  105 + $q = "select nome_tema,codigo_tema,desc_tema,link_tema,tipoa_tema,tags_tema,kml_tema,ogc_tema,download_tema,n3.n3_perfil as perfil from i3geoadmin_n3 as n3,i3geoadmin_temas as temas where n3.id_n2 = $id_n2 and n3.id_tema = temas.id_tema ";
124 $qtemas = $dbh->query($q); 106 $qtemas = $dbh->query($q);
125 xmlmenu_notema($qtemas); 107 xmlmenu_notema($qtemas);
126 } 108 }
127 function xmlmenu_notema($qtemas) 109 function xmlmenu_notema($qtemas)
128 { 110 {
  111 + global $perfil;
129 foreach($qtemas as $row) 112 foreach($qtemas as $row)
130 { 113 {
131 - echo "<TEMA>\n";  
132 - echo "<TID>".$row["codigo_tema"]."</TID>\n";  
133 - echo "<TNOME>".xmlmenu_prepara($row["nome_tema"])."</TNOME>\n";  
134 - echo "<TDESC>".xmlmenu_prepara($row["desc_tema"])."</TDESC>\n";  
135 - echo "<TLINK>".xmlmenu_prepara($row["link_tema"])."</TLINK>\n";  
136 - echo "<TIPOA>".$row["tipoa_tema"]."</TIPOA>\n";  
137 - echo "<TAGS>".xmlmenu_prepara($row["tags_tema"])."</TAGS>\n";  
138 - echo "<KML>".$row["kml_tema"]."</KML>\n";  
139 - if($row["tipoa_tema"] == "WMS")  
140 - echo "<OGC>nao</OGC>\n"; 114 + if($row["perfil"] == "")
  115 + $mostra = true;
141 else 116 else
142 - echo "<OGC>".$row["ogc_tema"]."</OGC>\n";  
143 - echo "<DOWNLOAD>".$row["download_tema"]."</DOWNLOAD>\n";  
144 - echo "</TEMA>\n"; 117 + {
  118 + $perfilatual = explode(" ",str_replace(","," ",$row["perfil"]));
  119 + $mostra = array_in_array($perfil,$perfilatual);
  120 + }
  121 + if($mostra)
  122 + {
  123 + echo "<TEMA>\n";
  124 + echo "<TID>".$row["codigo_tema"]."</TID>\n";
  125 + echo "<PERFIL>".$row["perfil"]."</PERFIL>\n";
  126 + echo "<TNOME>".xmlmenu_prepara($row["nome_tema"])."</TNOME>\n";
  127 + echo "<TDESC>".xmlmenu_prepara($row["desc_tema"])."</TDESC>\n";
  128 + echo "<TLINK>".xmlmenu_prepara($row["link_tema"])."</TLINK>\n";
  129 + echo "<TIPOA>".$row["tipoa_tema"]."</TIPOA>\n";
  130 + echo "<TAGS>".xmlmenu_prepara($row["tags_tema"])."</TAGS>\n";
  131 + echo "<KML>".$row["kml_tema"]."</KML>\n";
  132 + if($row["tipoa_tema"] == "WMS")
  133 + echo "<OGC>nao</OGC>\n";
  134 + else
  135 + echo "<OGC>".$row["ogc_tema"]."</OGC>\n";
  136 + echo "<DOWNLOAD>".$row["download_tema"]."</DOWNLOAD>\n";
  137 + echo "</TEMA>\n";
  138 + }
145 } 139 }
146 } 140 }
147 function xmlmenu_prepara($texto) 141 function xmlmenu_prepara($texto)
classesphp/classe_menutemas.php
@@ -56,10 +56,9 @@ $urli3geo - (opcional) url onde está o i3geo (p.ex. http://localhost/i3geo @@ -56,10 +56,9 @@ $urli3geo - (opcional) url onde está o i3geo (p.ex. http://localhost/i3geo
56 */ 56 */
57 function __construct($map_file="",$perfil="",$locsistemas="",$locaplic="",$menutemas="",$urli3geo="") 57 function __construct($map_file="",$perfil="",$locsistemas="",$locaplic="",$menutemas="",$urli3geo="")
58 { 58 {
59 - error_reporting(0); 59 + error_reporting(E_ALL);
  60 + $perfil = str_replace(" ",",",$perfil);
60 $this->perfil = explode(",",$perfil); 61 $this->perfil = explode(",",$perfil);
61 - if(count($this->perfil) == 0)  
62 - $this->perfil = explode(" ",$perfil);  
63 $this->xmlsistemas = ""; 62 $this->xmlsistemas = "";
64 $this->locaplic = $locaplic; 63 $this->locaplic = $locaplic;
65 $this->menutemas = $menutemas; 64 $this->menutemas = $menutemas;
@@ -141,13 +140,17 @@ array @@ -141,13 +140,17 @@ array
141 */ 140 */
142 function pegaListaDeMapas($locmapas) 141 function pegaListaDeMapas($locmapas)
143 { 142 {
  143 + $perfilgeral = implode(" ",$this->perfil);
  144 + if($locmapas == "")
  145 + {$locmapas = $this->urli3geo."/admin/xmlmapas.php?perfil=".$perfilgeral;}
144 $this->xml = simplexml_load_file($locmapas); 146 $this->xml = simplexml_load_file($locmapas);
145 $mapas = array(); 147 $mapas = array();
146 //pega os sistemas checando os perfis 148 //pega os sistemas checando os perfis
147 foreach($this->xml->MAPA as $s) 149 foreach($this->xml->MAPA as $s)
148 { 150 {
149 $ps = ixml($s,"PERFIL"); 151 $ps = ixml($s,"PERFIL");
150 - $perfis = explode(",",$ps); 152 + $perfis = str_replace(","," ",$ps);
  153 + $perfis = explode(" ",$perfis);
151 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == "")) 154 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == ""))
152 { 155 {
153 $n = ixml($s,"NOME"); 156 $n = ixml($s,"NOME");
@@ -240,7 +243,8 @@ array @@ -240,7 +243,8 @@ array
240 if ($temp != "") 243 if ($temp != "")
241 { 244 {
242 $incluigrupo = FALSE; 245 $incluigrupo = FALSE;
243 - $perfis = explode(",",$temp); 246 + $perfis = str_replace(","," ",$temp);
  247 + $perfis = explode(" ",$perfis);
244 if ($this->array_in_array($this->perfil,$perfis)) 248 if ($this->array_in_array($this->perfil,$perfis))
245 {$incluigrupo = TRUE;} 249 {$incluigrupo = TRUE;}
246 } 250 }
@@ -276,7 +280,8 @@ array @@ -276,7 +280,8 @@ array
276 if ($temp != "") 280 if ($temp != "")
277 { 281 {
278 $incluisgrupo = FALSE; 282 $incluisgrupo = FALSE;
279 - $perfis = explode(",",$temp); 283 + $perfis = str_replace(","," ",$temp);
  284 + $perfis = explode(" ",$perfis);
280 if ($this->array_in_array($this->perfil,$perfis)) 285 if ($this->array_in_array($this->perfil,$perfis))
281 {$incluisgrupo = TRUE;} 286 {$incluisgrupo = TRUE;}
282 } 287 }
@@ -312,7 +317,8 @@ array @@ -312,7 +317,8 @@ array
312 { 317 {
313 $nomesis = ixml($s,"NOMESIS"); 318 $nomesis = ixml($s,"NOMESIS");
314 $ps = ixml($s,"PERFIL"); 319 $ps = ixml($s,"PERFIL");
315 - $perfis = explode(",",$ps); 320 + $perfis = str_replace(","," ",$ps);
  321 + $perfis = explode(" ",$perfis);
316 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == "")) 322 if (($this->array_in_array($this->perfil,$perfis)) || ($ps == ""))
317 { 323 {
318 $funcoes = array(); 324 $funcoes = array();
@@ -376,7 +382,8 @@ array @@ -376,7 +382,8 @@ array
376 if ($temp != "") 382 if ($temp != "")
377 { 383 {
378 $incluigrupo = FALSE; 384 $incluigrupo = FALSE;
379 - $perfis = explode(",",$temp); 385 + $perfis = str_replace(","," ",$temp);
  386 + $perfis = explode(" ",$perfis);
380 if ($this->array_in_array($this->perfil,$perfis)) 387 if ($this->array_in_array($this->perfil,$perfis))
381 {$incluigrupo = TRUE;} 388 {$incluigrupo = TRUE;}
382 } 389 }
@@ -391,7 +398,8 @@ array @@ -391,7 +398,8 @@ array
391 if ($temp != "") 398 if ($temp != "")
392 { 399 {
393 $incluisgrupo = FALSE; 400 $incluisgrupo = FALSE;
394 - $perfis = explode(",",$temp); 401 + $perfis = str_replace(","," ",$temp);
  402 + $perfis = explode(" ",$perfis);
395 if ($this->array_in_array($this->perfil,$perfis)) 403 if ($this->array_in_array($this->perfil,$perfis))
396 {$incluisgrupo = TRUE;} 404 {$incluisgrupo = TRUE;}
397 } 405 }
@@ -462,7 +470,9 @@ array @@ -462,7 +470,9 @@ array
462 if (ixml($g,"PERFIL") != "") 470 if (ixml($g,"PERFIL") != "")
463 { 471 {
464 $incluigrupo = FALSE; 472 $incluigrupo = FALSE;
465 - $perfis = explode(",",ixml($g,"PERFIL")); 473 + $temp = ixml($g,"PERFIL");
  474 + $perfis = str_replace(","," ",$temp);
  475 + $perfis = explode(" ",$perfis);
466 if ($this->array_in_array($this->perfil,$perfis)) 476 if ($this->array_in_array($this->perfil,$perfis))
467 {$incluigrupo = TRUE;} 477 {$incluigrupo = TRUE;}
468 } 478 }
@@ -477,7 +487,9 @@ array @@ -477,7 +487,9 @@ array
477 if (ixml($s,"PERFIL") != "") 487 if (ixml($s,"PERFIL") != "")
478 { 488 {
479 $incluisgrupo = FALSE; 489 $incluisgrupo = FALSE;
480 - $perfis = explode(",",ixml($s,"PERFIL")); 490 + $temp = ixml($s,"PERFIL");
  491 + $perfis = str_replace(","," ",$temp);
  492 + $perfis = explode(" ",$perfis);
481 if ($this->array_in_array($this->perfil,$perfis)) 493 if ($this->array_in_array($this->perfil,$perfis))
482 {$incluisgrupo = TRUE;} 494 {$incluisgrupo = TRUE;}
483 } 495 }
@@ -492,7 +504,9 @@ array @@ -492,7 +504,9 @@ array
492 { 504 {
493 505
494 $inclui = FALSE; 506 $inclui = FALSE;
495 - $perfis = explode(",",ixml($tema,"PERFIL")); 507 + $temp = ixml($tema,"PERFIL");
  508 + $perfis = str_replace(","," ",$temp);
  509 + $perfis = explode(" ",$perfis);
496 if ($this->array_in_array($this->perfil,$perfis)) 510 if ($this->array_in_array($this->perfil,$perfis))
497 {$inclui = TRUE;} 511 {$inclui = TRUE;}
498 } 512 }
@@ -555,7 +569,8 @@ $procurar - String que será procurada. @@ -555,7 +569,8 @@ $procurar - String que será procurada.
555 if ($temp != "") 569 if ($temp != "")
556 { 570 {
557 $incluigrupo = FALSE; 571 $incluigrupo = FALSE;
558 - $perfis = explode(",",$temp); 572 + $perfis = str_replace(","," ",$temp);
  573 + $perfis = explode(" ",$perfis);
559 if ($this->array_in_array($this->perfil,$perfis)) 574 if ($this->array_in_array($this->perfil,$perfis))
560 {$incluigrupo = TRUE;} 575 {$incluigrupo = TRUE;}
561 } 576 }
@@ -567,7 +582,8 @@ $procurar - String que será procurada. @@ -567,7 +582,8 @@ $procurar - String que será procurada.
567 if ($this->perfil != "") 582 if ($this->perfil != "")
568 { 583 {
569 $temp = ixml($sgrupo,"PERFIL"); 584 $temp = ixml($sgrupo,"PERFIL");
570 - $perfis = explode(",",$temp); 585 + $perfis = str_replace(","," ",$temp);
  586 + $perfis = explode(" ",$perfis);
571 if (!$this->array_in_array($this->perfil,$perfis)) 587 if (!$this->array_in_array($this->perfil,$perfis))
572 {$incluisgrupo = FALSE;} 588 {$incluisgrupo = FALSE;}
573 } 589 }
@@ -579,7 +595,8 @@ $procurar - String que será procurada. @@ -579,7 +595,8 @@ $procurar - String que será procurada.
579 if ($this->perfil != "") 595 if ($this->perfil != "")
580 { 596 {
581 $temp = ixml($tema,"PERFIL"); 597 $temp = ixml($tema,"PERFIL");
582 - $perfis = explode(",",$temp); 598 + $perfis = str_replace(","," ",$temp);
  599 + $perfis = explode(" ",$perfis);
583 if (!$this->array_in_array($this->perfil,$perfis)) 600 if (!$this->array_in_array($this->perfil,$perfis))
584 {$inclui = FALSE;} 601 {$inclui = FALSE;}
585 } 602 }
@@ -691,7 +708,8 @@ nrss - (opcional) número de registros no rss que serão considerados @@ -691,7 +708,8 @@ nrss - (opcional) número de registros no rss que serão considerados
691 if ($this->perfil != "") 708 if ($this->perfil != "")
692 { 709 {
693 $temp = ixml($sgrupo,"PERFIL"); 710 $temp = ixml($sgrupo,"PERFIL");
694 - $perfis = explode(",",$temp); 711 + $perfis = str_replace(","," ",$temp);
  712 + $perfis = explode(" ",$perfis);
695 if (!$this->array_in_array($this->perfil,$perfis)) 713 if (!$this->array_in_array($this->perfil,$perfis))
696 {$incluisgrupo = FALSE;} 714 {$incluisgrupo = FALSE;}
697 } 715 }
@@ -702,8 +720,8 @@ nrss - (opcional) número de registros no rss que serão considerados @@ -702,8 +720,8 @@ nrss - (opcional) número de registros no rss que serão considerados
702 $inclui = TRUE; 720 $inclui = TRUE;
703 if ($this->perfil != "") 721 if ($this->perfil != "")
704 { 722 {
705 - $temp = ixml($tema,"PERFIL");  
706 - $perfis = explode(",",$temp); 723 + $perfis = str_replace(","," ",$temp);
  724 + $perfis = explode(" ",$perfis);
707 if (!$this->array_in_array($this->perfil,$perfis)) 725 if (!$this->array_in_array($this->perfil,$perfis))
708 {$inclui = FALSE;} 726 {$inclui = FALSE;}
709 } 727 }
classesphp/mapa_inicia.php
@@ -199,7 +199,7 @@ function iniciaMapa() @@ -199,7 +199,7 @@ function iniciaMapa()
199 $res .= ";var legimagem='';var legwidth=0;var legheight=0;var legpath='';var legurl='';g_locsistemas='".$locsistemas."';g_locidentifica='".$locidentifica."'"; 199 $res .= ";var legimagem='';var legwidth=0;var legheight=0;var legpath='';var legurl='';g_locsistemas='".$locsistemas."';g_locidentifica='".$locidentifica."'";
200 $r = (isset($R_path)) ? "sim" : "nao"; 200 $r = (isset($R_path)) ? "sim" : "nao";
201 $res .= ";g_r='".$r."'"; //identifica se o r esta instalado 201 $res .= ";g_r='".$r."'"; //identifica se o r esta instalado
202 - $res .= ";g_locmapas='".$locmapas."'"; //identifica se o r esta instalado 202 + $res .= ";g_locmapas='".$locmapas."'";
203 if ((isset($expoeMapfile)) && ($expoeMapfile == "nao")) 203 if ((isset($expoeMapfile)) && ($expoeMapfile == "nao"))
204 {$res .= ";objmapa.mapfile=''";} 204 {$res .= ";objmapa.mapfile=''";}
205 else 205 else
menutemas/admin.db
No preview for this file type
ms_configura.php
@@ -164,8 +164,10 @@ if (strtoupper(substr(PHP_OS, 0, 3) == &#39;WIN&#39;)) @@ -164,8 +164,10 @@ if (strtoupper(substr(PHP_OS, 0, 3) == &#39;WIN&#39;))
164 A guia "Mapas" mostra uma lista de links que permitem abrir mapas específicos. Essa lista é utilizada também pela versão mobile do i3geo. 164 A guia "Mapas" mostra uma lista de links que permitem abrir mapas específicos. Essa lista é utilizada também pela versão mobile do i3geo.
165 165
166 Veja a documentação específica do arquivo mapas.xml para maiores detalhes. 166 Veja a documentação específica do arquivo mapas.xml para maiores detalhes.
  167 +
  168 + Para usar as funções default, utilize apenas $menutemas = ""; nesse caso, as funções serão obtidas do banco de dados de administração.
167 */ 169 */
168 - $locmapas = "../menutemas/mapas.xml"; 170 + $locmapas = "";
169 /* 171 /*
170 Variable: $R_path 172 Variable: $R_path
171 173