Commit 8a246e140da7a18ee87d58ee8be3dec1bcfa4116
1 parent
2f550020
Exists in
master
and in
7 other branches
--no commit message
Showing
3 changed files
with
47 additions
and
48 deletions
Show diff stats
classesphp/classe_menutemas.php
@@ -2,7 +2,10 @@ | @@ -2,7 +2,10 @@ | ||
2 | /* | 2 | /* |
3 | Title: classe_menutemas.php | 3 | Title: classe_menutemas.php |
4 | 4 | ||
5 | -Manipulação dos temas do arquivo menutemas.xml. | 5 | +Manipulação dos temas do arquivo menutemas.xml ou sistema de administração |
6 | + | ||
7 | +Quando o i3Geo está configurado para acessar o sistema de administração, os métodos desta classe | ||
8 | +passam a utilizar a classe i3geo/admin/php/classe_arvore.php | ||
6 | 9 | ||
7 | Lista temas, grupos,etc. | 10 | Lista temas, grupos,etc. |
8 | 11 | ||
@@ -28,7 +31,6 @@ Free Software Foundation, Inc., no endereço | @@ -28,7 +31,6 @@ Free Software Foundation, Inc., no endereço | ||
28 | 31 | ||
29 | File: i3geo/classesphp/classe_menutemas.php | 32 | File: i3geo/classesphp/classe_menutemas.php |
30 | 33 | ||
31 | -19/6/2007 | ||
32 | */ | 34 | */ |
33 | /* | 35 | /* |
34 | Class: Menutemas | 36 | Class: Menutemas |
@@ -112,34 +114,10 @@ array | @@ -112,34 +114,10 @@ array | ||
112 | { | 114 | { |
113 | if(!isset($this->locaplic)) | 115 | if(!isset($this->locaplic)) |
114 | {return "locaplic nao foi definido";} | 116 | {return "locaplic nao foi definido";} |
115 | - $locaplic = $this->locaplic; | ||
116 | - include($this->locaplic."/admin/php/conexao.php"); | ||
117 | - if($this->editor) | ||
118 | - $sql = 'SELECT * from i3geoadmin_menus order by nome_menu'; | ||
119 | - else | ||
120 | - $sql = "SELECT * from i3geoadmin_menus where publicado_menu != 'NAO' or publicado_menu isnull order by nome_menu"; | ||
121 | - $q = $dbh->query($sql,PDO::FETCH_ASSOC); | ||
122 | - $regs = $q->fetchAll(); | ||
123 | - $dbh = null; | ||
124 | - $resultado = array(); | ||
125 | - foreach($regs as $reg) | ||
126 | - { | ||
127 | - $perfis = str_replace(","," ",$reg["perfil_menu"]); | ||
128 | - $perfis = explode(" ",$perfis); | ||
129 | - if (($this->array_in_array($this->perfil,$perfis)) || ($reg["perfil_menu"] == "")) | ||
130 | - { | ||
131 | - if(!in_array("publicado_menu",array_keys($reg))) | ||
132 | - {$reg["publicado_menu"] = "sim";} | ||
133 | - if(strtolower($reg["publicado_menu"]) != "nao" || $this->editor) | ||
134 | - { | ||
135 | - $status = "fechado"; | ||
136 | - if(strtolower($reg["aberto"]) == "sim") | ||
137 | - $status = "aberto"; | ||
138 | - $url = $this->urli3geo."/admin/xmlmenutemas.php?id_menu=".$reg["id_menu"]; | ||
139 | - $resultado[] = array("desc"=>$reg["desc_menu"],"publicado"=>$reg["publicado_menu"],"nomemenu"=>$reg["nome_menu"],"idmenu"=>$reg["id_menu"],"arquivo"=>"","status"=>$status,"url"=>$url); | ||
140 | - } | ||
141 | - } | ||
142 | - } | 117 | + include_once("../admin/php/classe_arvore.php"); |
118 | + $arvore = new Arvore($this->locaplic); | ||
119 | + $resultado = $arvore->pegaListaDeMenus($this->perfil); | ||
120 | + unset($arvore); | ||
143 | } | 121 | } |
144 | else | 122 | else |
145 | {$resultado = $this->menutemas;} | 123 | {$resultado = $this->menutemas;} |
@@ -193,15 +171,19 @@ array | @@ -193,15 +171,19 @@ array | ||
193 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo | 171 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo |
194 | $ondexml = $menu["arquivo"]; | 172 | $ondexml = $menu["arquivo"]; |
195 | if(!isset($menu["publicado"])){$ondexml = $menu["url"];} | 173 | if(!isset($menu["publicado"])){$ondexml = $menu["url"];} |
196 | - if($ondexml != "") | 174 | + if($ondexml != "" && $this->menutemas != "") |
197 | { | 175 | { |
198 | $xml = simplexml_load_file($ondexml); | 176 | $xml = simplexml_load_file($ondexml); |
199 | $grupos = $this->retornaGrupos($xml,$listasistemas,$idmenu,$listasgrupos); | 177 | $grupos = $this->retornaGrupos($xml,$listasistemas,$idmenu,$listasgrupos); |
200 | } | 178 | } |
201 | else //pega o xml do sistema de administração | 179 | else //pega o xml do sistema de administração |
202 | { | 180 | { |
203 | - $xml = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic)); | ||
204 | - $grupos = $this->retornaGrupos($xml,$listasistemas,$idmenu,$listasgrupos); | 181 | + //$xml = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic)); |
182 | + //$grupos = $this->retornaGrupos($xml,$listasistemas,$idmenu,$listasgrupos); | ||
183 | + include_once("../admin/php/classe_arvore.php"); | ||
184 | + $arvore = new Arvore($this->locaplic); | ||
185 | + $grupos = $arvore->formataGruposMenu($idmenu,$this->perfil,$listasgrupos); | ||
186 | + unset($arvore); | ||
205 | } | 187 | } |
206 | } | 188 | } |
207 | } | 189 | } |
@@ -362,12 +344,17 @@ array | @@ -362,12 +344,17 @@ array | ||
362 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo | 344 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo |
363 | $ondexml = $menu["arquivo"]; | 345 | $ondexml = $menu["arquivo"]; |
364 | if($menu["url"] != ""){$ondexml = $menu["url"];} | 346 | if($menu["url"] != ""){$ondexml = $menu["url"];} |
365 | - if($ondexml != "") | 347 | + if($ondexml != "" && $this->menutemas != "") |
366 | {$this->xml = simplexml_load_file($ondexml);} | 348 | {$this->xml = simplexml_load_file($ondexml);} |
367 | else //pega o xml do sistema de administração | 349 | else //pega o xml do sistema de administração |
368 | { | 350 | { |
369 | - $this->xml = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic)); | 351 | + //$this->xml = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic)); |
370 | //echo geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic);exit; | 352 | //echo geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic);exit; |
353 | + include_once("../admin/php/classe_arvore.php"); | ||
354 | + $arvore = new Arvore($this->locaplic); | ||
355 | + $subGrupos = $arvore->formataSubgruposGrupo($idmenu,$codgrupo,$this->perfil); | ||
356 | + unset($arvore); | ||
357 | + return($subGrupos); | ||
371 | } | 358 | } |
372 | } | 359 | } |
373 | } | 360 | } |
@@ -470,11 +457,16 @@ array | @@ -470,11 +457,16 @@ array | ||
470 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo | 457 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo |
471 | $ondexml = $menu["arquivo"]; | 458 | $ondexml = $menu["arquivo"]; |
472 | if($menu["url"] != ""){$ondexml = $menu["url"];} | 459 | if($menu["url"] != ""){$ondexml = $menu["url"];} |
473 | - if($ondexml != "") | 460 | + if($ondexml != "" && $this->menutemas != "") |
474 | {$this->xml = simplexml_load_file($ondexml);} | 461 | {$this->xml = simplexml_load_file($ondexml);} |
475 | else //pega o xml do sistema de administração | 462 | else //pega o xml do sistema de administração |
476 | { | 463 | { |
477 | - $this->xml = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic)); | 464 | + //$this->xml = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$idmenu,$tipo,$this->locaplic)); |
465 | + include_once("../admin/php/classe_arvore.php"); | ||
466 | + $arvore = new Arvore($this->locaplic); | ||
467 | + $temas = $arvore->formataTemasSubgrupo($subgrupo,$this->perfil); | ||
468 | + unset($arvore); | ||
469 | + return($temas); | ||
478 | } | 470 | } |
479 | } | 471 | } |
480 | } | 472 | } |
@@ -663,18 +655,25 @@ $procurar - String que será procurada. | @@ -663,18 +655,25 @@ $procurar - String que será procurada. | ||
663 | include_once($this->locaplic."/admin/php/xml.php"); | 655 | include_once($this->locaplic."/admin/php/xml.php"); |
664 | $tipo = ""; | 656 | $tipo = ""; |
665 | $this->xml = ""; | 657 | $this->xml = ""; |
666 | - foreach($this->pegaListaDeMenus() as $menu) | 658 | + if($this->menutemas != "") |
667 | { | 659 | { |
668 | - if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo | ||
669 | - $ondexml = $menu["arquivo"]; | ||
670 | - if($menu["url"] != ""){$ondexml = $menu["url"];} | ||
671 | - if($ondexml != "") | ||
672 | - {$this->xml[] = simplexml_load_file($ondexml);} | ||
673 | - else //pega o xml do sistema de administração | 660 | + foreach($this->pegaListaDeMenus() as $menu) |
674 | { | 661 | { |
675 | - $this->xml[] = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$menu["idmenu"],$tipo,$this->locaplic)); | 662 | + if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo |
663 | + $ondexml = $menu["arquivo"]; | ||
664 | + if($menu["url"] != ""){$ondexml = $menu["url"];} | ||
665 | + $this->xml[] = simplexml_load_file($ondexml); | ||
676 | } | 666 | } |
677 | } | 667 | } |
668 | + else | ||
669 | + { | ||
670 | + //$this->xml[] = simplexml_load_string(geraXmlMenutemas(implode(" ",$this->perfil),$menu["idmenu"],$tipo,$this->locaplic)); | ||
671 | + include_once("../admin/php/classe_arvore.php"); | ||
672 | + $arvore = new Arvore($this->locaplic); | ||
673 | + $temas = $arvore->procuraTemas($procurar,$this->perfil); | ||
674 | + unset($arvore); | ||
675 | + return($temas); | ||
676 | + } | ||
678 | $resultado = array(); | 677 | $resultado = array(); |
679 | $texto = array(); | 678 | $texto = array(); |
680 | foreach ($this->xml as $xml) | 679 | foreach ($this->xml as $xml) |
classesphp/funcoes_gerais.php
@@ -1251,11 +1251,11 @@ function buscaRapida($servico,$palavra) | @@ -1251,11 +1251,11 @@ function buscaRapida($servico,$palavra) | ||
1251 | include_once('../pacotes/SOAP/nusoap.php'); | 1251 | include_once('../pacotes/SOAP/nusoap.php'); |
1252 | //include_once("../pacotes/SOAP/easy_parser.inc"); | 1252 | //include_once("../pacotes/SOAP/easy_parser.inc"); |
1253 | $soapclient = new Xsoapclient($servico."?wsdl","wsdl"); | 1253 | $soapclient = new Xsoapclient($servico."?wsdl","wsdl"); |
1254 | + $vv = "erro"; | ||
1254 | if (@$p = $soapclient->getproxy()) | 1255 | if (@$p = $soapclient->getproxy()) |
1255 | { | 1256 | { |
1256 | - //$vv = $p->procurar(array("palavra"=>$palavra,"tipoBusca"=>"qualquer")); | ||
1257 | $vv = $soapclient->call("procurar",array("palavra"=>$palavra,"tipoBusca"=>"qualquer")); | 1257 | $vv = $soapclient->call("procurar",array("palavra"=>$palavra,"tipoBusca"=>"qualquer")); |
1258 | - //print_r($vv); | 1258 | + if($vv == ""){$vv = "erro";} |
1259 | return ($vv); | 1259 | return ($vv); |
1260 | } | 1260 | } |
1261 | else | 1261 | else |
classesphp/mapa_controle.php
@@ -167,7 +167,7 @@ include_once("funcoes_gerais.php"); | @@ -167,7 +167,7 @@ include_once("funcoes_gerais.php"); | ||
167 | //identifica qual a url do i3geo | 167 | //identifica qual a url do i3geo |
168 | // | 168 | // |
169 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | 169 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |
170 | -$protocolo = strtolower($protocolo[0]) . '://'.$_SERVER['SERVER_NAME'] .":". $_SERVER['SERVER_PORT']; | 170 | +$protocolo = strtolower($protocolo[0]) . '://'.$_SERVER['HTTP_HOST'];//$_SERVER['SERVER_NAME'] .":". $_SERVER['SERVER_PORT']; |
171 | $urli3geo = str_replace("/classesphp/mapa_controle.php","",$protocolo.$_SERVER["PHP_SELF"]); | 171 | $urli3geo = str_replace("/classesphp/mapa_controle.php","",$protocolo.$_SERVER["PHP_SELF"]); |
172 | // | 172 | // |
173 | //substitui a string de conexão | 173 | //substitui a string de conexão |