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 | 2 | /* |
| 3 | 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 | 10 | Lista temas, grupos,etc. |
| 8 | 11 | |
| ... | ... | @@ -28,7 +31,6 @@ Free Software Foundation, Inc., no endereço |
| 28 | 31 | |
| 29 | 32 | File: i3geo/classesphp/classe_menutemas.php |
| 30 | 33 | |
| 31 | -19/6/2007 | |
| 32 | 34 | */ |
| 33 | 35 | /* |
| 34 | 36 | Class: Menutemas |
| ... | ... | @@ -112,34 +114,10 @@ array |
| 112 | 114 | { |
| 113 | 115 | if(!isset($this->locaplic)) |
| 114 | 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 | 122 | else |
| 145 | 123 | {$resultado = $this->menutemas;} |
| ... | ... | @@ -193,15 +171,19 @@ array |
| 193 | 171 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo |
| 194 | 172 | $ondexml = $menu["arquivo"]; |
| 195 | 173 | if(!isset($menu["publicado"])){$ondexml = $menu["url"];} |
| 196 | - if($ondexml != "") | |
| 174 | + if($ondexml != "" && $this->menutemas != "") | |
| 197 | 175 | { |
| 198 | 176 | $xml = simplexml_load_file($ondexml); |
| 199 | 177 | $grupos = $this->retornaGrupos($xml,$listasistemas,$idmenu,$listasgrupos); |
| 200 | 178 | } |
| 201 | 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 | 344 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo |
| 363 | 345 | $ondexml = $menu["arquivo"]; |
| 364 | 346 | if($menu["url"] != ""){$ondexml = $menu["url"];} |
| 365 | - if($ondexml != "") | |
| 347 | + if($ondexml != "" && $this->menutemas != "") | |
| 366 | 348 | {$this->xml = simplexml_load_file($ondexml);} |
| 367 | 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 | 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 | 457 | if(!isset($menu["url"])){$menu["url"] = "";} //para efeitos de compatibilidade entre versões do i3geo |
| 471 | 458 | $ondexml = $menu["arquivo"]; |
| 472 | 459 | if($menu["url"] != ""){$ondexml = $menu["url"];} |
| 473 | - if($ondexml != "") | |
| 460 | + if($ondexml != "" && $this->menutemas != "") | |
| 474 | 461 | {$this->xml = simplexml_load_file($ondexml);} |
| 475 | 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 | 655 | include_once($this->locaplic."/admin/php/xml.php"); |
| 664 | 656 | $tipo = ""; |
| 665 | 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 | 677 | $resultado = array(); |
| 679 | 678 | $texto = array(); |
| 680 | 679 | foreach ($this->xml as $xml) | ... | ... |
classesphp/funcoes_gerais.php
| ... | ... | @@ -1251,11 +1251,11 @@ function buscaRapida($servico,$palavra) |
| 1251 | 1251 | include_once('../pacotes/SOAP/nusoap.php'); |
| 1252 | 1252 | //include_once("../pacotes/SOAP/easy_parser.inc"); |
| 1253 | 1253 | $soapclient = new Xsoapclient($servico."?wsdl","wsdl"); |
| 1254 | + $vv = "erro"; | |
| 1254 | 1255 | if (@$p = $soapclient->getproxy()) |
| 1255 | 1256 | { |
| 1256 | - //$vv = $p->procurar(array("palavra"=>$palavra,"tipoBusca"=>"qualquer")); | |
| 1257 | 1257 | $vv = $soapclient->call("procurar",array("palavra"=>$palavra,"tipoBusca"=>"qualquer")); |
| 1258 | - //print_r($vv); | |
| 1258 | + if($vv == ""){$vv = "erro";} | |
| 1259 | 1259 | return ($vv); |
| 1260 | 1260 | } |
| 1261 | 1261 | else | ... | ... |
classesphp/mapa_controle.php
| ... | ... | @@ -167,7 +167,7 @@ include_once("funcoes_gerais.php"); |
| 167 | 167 | //identifica qual a url do i3geo |
| 168 | 168 | // |
| 169 | 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 | 171 | $urli3geo = str_replace("/classesphp/mapa_controle.php","",$protocolo.$_SERVER["PHP_SELF"]); |
| 172 | 172 | // |
| 173 | 173 | //substitui a string de conexão | ... | ... |