Commit f5735d7b7b788f60e963d1a0e6760eecb3261897

Authored by Edmar Moretti
1 parent ceeb974a

Inclusão da janela de abertura na árvore hiperbólica para os nós do tipo TAG

admin/hiperbolica.php
@@ -5,41 +5,60 @@ $xml .= "<capa>"; @@ -5,41 +5,60 @@ $xml .= "<capa>";
5 include("../ms_configura.php"); 5 include("../ms_configura.php");
6 include("$locaplic/admin/php/admin.php"); 6 include("$locaplic/admin/php/admin.php");
7 $menus = pegaDados("SELECT * from i3geoadmin_menus order by nome_menu ",$locaplic); 7 $menus = pegaDados("SELECT * from i3geoadmin_menus order by nome_menu ",$locaplic);
8 -$xml .= '<termo id="00" nome="i3Geo">'; 8 +$xml .= '<termo id="00" nome="Disseminação de dados">';
9 $contador = 0; 9 $contador = 0;
10 $xml .= '<item id="'.$contador.'" tipo="TE1" nome="Menus" familia="1" /> '."\n"; 10 $xml .= '<item id="'.$contador.'" tipo="TE1" nome="Menus" familia="1" /> '."\n";
11 foreach ($menus as $menu) 11 foreach ($menus as $menu)
12 { 12 {
13 $id = $menu["id_menu"]; 13 $id = $menu["id_menu"];
14 - $nome = str_replace("&","&amp;",$menu["nome_menu"]); 14 + $nome = html_entity_decode($menu["nome_menu"]);
  15 + //menu
15 $xml .= '<item id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; 16 $xml .= '<item id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n";
16 $grupos = pegaDados("select i3geoadmin_grupos.nome_grupo,id_n1,id_menu from i3geoadmin_n1 LEFT JOIN i3geoadmin_grupos ON i3geoadmin_n1.id_grupo = i3geoadmin_grupos.id_grupo where id_menu='$id' order by ordem",$locaplic); 17 $grupos = pegaDados("select i3geoadmin_grupos.nome_grupo,id_n1,id_menu from i3geoadmin_n1 LEFT JOIN i3geoadmin_grupos ON i3geoadmin_n1.id_grupo = i3geoadmin_grupos.id_grupo where id_menu='$id' order by ordem",$locaplic);
17 for($i=0;$i < count($grupos);++$i) 18 for($i=0;$i < count($grupos);++$i)
18 { 19 {
19 $contador++; 20 $contador++;
20 - $nome = str_replace("&","&amp;",$grupos[$i]["nome_grupo"]); 21 + $nome = html_entity_decode($grupos[$i]["nome_grupo"]);
21 $idgrupo = $grupos[$i]["id_n1"]; 22 $idgrupo = $grupos[$i]["id_n1"];
  23 + //grupo
22 $xml .= '<item id="'.$contador.'" tipo="TE3" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; 24 $xml .= '<item id="'.$contador.'" tipo="TE3" nome="'.$nome.'" familia="'.$id.'" /> '."\n";
  25 + $contador++;
  26 + $xml .= '<item id="'.$contador.'" tipo="TE4" nome="SUBGRUPOS" familia="'.$id.'" /> '."\n";
  27 +
23 $subgrupos = pegaDados("select i3geoadmin_subgrupos.nome_subgrupo,i3geoadmin_n2.id_n2 from i3geoadmin_n2 LEFT JOIN i3geoadmin_subgrupos ON i3geoadmin_n2.id_subgrupo = i3geoadmin_subgrupos.id_subgrupo where i3geoadmin_n2.id_n1='$idgrupo' order by ordem",$locaplic); 28 $subgrupos = pegaDados("select i3geoadmin_subgrupos.nome_subgrupo,i3geoadmin_n2.id_n2 from i3geoadmin_n2 LEFT JOIN i3geoadmin_subgrupos ON i3geoadmin_n2.id_subgrupo = i3geoadmin_subgrupos.id_subgrupo where i3geoadmin_n2.id_n1='$idgrupo' order by ordem",$locaplic);
24 for($j=0;$j < count($subgrupos);++$j) 29 for($j=0;$j < count($subgrupos);++$j)
25 { 30 {
26 $contador++; 31 $contador++;
27 - $nome = str_replace("&","&amp;",$subgrupos[$j]["nome_subgrupo"]);  
28 - $xml .= '<item id="'.$contador.'" tipo="TE4" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; 32 + $nome = html_entity_decode($subgrupos[$j]["nome_subgrupo"]);
  33 + //subgrupo
  34 + $xml .= '<item id="'.$contador.'" tipo="TE5" nome="'.$nome.'" familia="'.$id.'" /> '."\n";
  35 + $contador++;
  36 + $xml .= '<item id="'.$contador.'" tipo="TE6" nome="TEMAS" familia="'.$id.'" /> '."\n";
29 $id_n2 = $subgrupos[$j]["id_n2"]; 37 $id_n2 = $subgrupos[$j]["id_n2"];
30 - $temas = pegaDados("select i3geoadmin_temas.tags_tema,i3geoadmin_temas.nome_tema,i3geoadmin_n3.id_n3 from i3geoadmin_n3 LEFT JOIN i3geoadmin_temas ON i3geoadmin_n3.id_tema = i3geoadmin_temas.id_tema where i3geoadmin_n3.id_n2='$id_n2' order by ordem",$locaplic); 38 + $temas = pegaDados("select i3geoadmin_temas.tags_tema,i3geoadmin_temas.nome_tema,i3geoadmin_temas.codigo_tema,i3geoadmin_n3.id_n3 from i3geoadmin_n3 LEFT JOIN i3geoadmin_temas ON i3geoadmin_n3.id_tema = i3geoadmin_temas.id_tema where i3geoadmin_n3.id_n2='$id_n2' order by ordem",$locaplic);
31 for($k=0;$k < count($temas);++$k) 39 for($k=0;$k < count($temas);++$k)
32 { 40 {
33 $contador++; 41 $contador++;
34 - $nome = str_replace("&","&amp;",$temas[$k]["nome_tema"]);  
35 - $xml .= '<item id="'.$contador.'" tipo="TE5" nome="'.$nome.'" familia="'.$id.'" /> '."\n";  
36 - $tags = explode(" ",$temas[$k]["tags_tema"]);  
37 - foreach($tags as $tag) 42 + $nome = html_entity_decode($temas[$k]["nome_tema"]);
  43 + $nid = "tema,".$temas[$k]["codigo_tema"];
  44 + if($nome != "")
38 { 45 {
  46 + //tema
  47 + $xml .= '<item id="'.$contador.'" tipo="TE7" nome="'.$nome.'" familia="'.$nid.'" /> '."\n";
39 $contador++; 48 $contador++;
40 - $tag = str_replace("&","&amp;",$tag);  
41 - if($tag != "")  
42 - $xml .= '<item id="'.$contador.'" tipo="TE6" nome="'.$tag.'" familia="'.$id.'" /> '."\n"; 49 + $tags = explode(" ",$temas[$k]["tags_tema"]);
  50 + if(count($tags) > 0)
  51 + {
  52 + //tags
  53 + $xml .= '<item id="'.$contador.'" tipo="TE8" nome="TAGs" familia="'.$id.'" /> '."\n";
  54 + foreach($tags as $tag)
  55 + {
  56 + $contador++;
  57 + $tag = html_entity_decode($tag);
  58 + if($tag != "")
  59 + $xml .= '<item id="'.$contador.'" tipo="TE9" nome="'.$tag.'" familia="tag,'.$tag.'" /> '."\n";
  60 + }
  61 + }
43 } 62 }
44 } 63 }
45 } 64 }
@@ -52,7 +71,7 @@ $grupos = pegaDados(&quot;select i3geoadmin_grupos.nome_grupo,id_n1,id_menu from i3ge @@ -52,7 +71,7 @@ $grupos = pegaDados(&quot;select i3geoadmin_grupos.nome_grupo,id_n1,id_menu from i3ge
52 for($i=0;$i < count($grupos);++$i) 71 for($i=0;$i < count($grupos);++$i)
53 { 72 {
54 $contador++; 73 $contador++;
55 - $nome = str_replace("&","&amp;",$grupos[$i]["nome_grupo"]); 74 + $nome = html_entity_decode($grupos[$i]["nome_grupo"]);
56 $idgrupo = $grupos[$i]["id_n1"]; 75 $idgrupo = $grupos[$i]["id_n1"];
57 $xml .= '<item id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n"; 76 $xml .= '<item id="'.$contador.'" tipo="TE2" nome="'.$nome.'" familia="'.$id.'" /> '."\n";
58 $temastag = pegaDados("select d.tags_tema as tags,d.id_tema as tema from i3geoadmin_n2 as b,i3geoadmin_n1 as a,i3geoadmin_n3 as c,i3geoadmin_temas as d where a.id_grupo = '$idgrupo' and a.id_n1 = b.id_n1 and c.id_n2 = b.id_n2 and c.id_tema = d.id_tema group by tema",$locaplic); 77 $temastag = pegaDados("select d.tags_tema as tags,d.id_tema as tema from i3geoadmin_n2 as b,i3geoadmin_n1 as a,i3geoadmin_n3 as c,i3geoadmin_temas as d where a.id_grupo = '$idgrupo' and a.id_n1 = b.id_n1 and c.id_n2 = b.id_n2 and c.id_tema = d.id_tema group by tema",$locaplic);
@@ -63,12 +82,17 @@ for($i=0;$i &lt; count($grupos);++$i) @@ -63,12 +82,17 @@ for($i=0;$i &lt; count($grupos);++$i)
63 } 82 }
64 $arrayTag = array_unique($arrayTag); 83 $arrayTag = array_unique($arrayTag);
65 //var_dump($arrayTag); 84 //var_dump($arrayTag);
66 - foreach($arrayTag as $tag) 85 + if(count($arrayTag > 0))
67 { 86 {
68 - $tag = str_replace("&","&amp;",$tag);  
69 $contador++; 87 $contador++;
70 - if($tag != "")  
71 - $xml .= '<item id="'.$contador.'" tipo="TE3" nome="'.$tag.'" familia="'.$id.'" /> '."\n"; 88 + $xml .= '<item id="'.$contador.'" tipo="TE4" nome="TAGs" familia="'.$id.'" /> '."\n";
  89 + foreach($arrayTag as $tag)
  90 + {
  91 + $tag = html_entity_decode($tag);
  92 + $contador++;
  93 + if($tag != "")
  94 + $xml .= '<item id="'.$contador.'" tipo="TE5" nome="'.$tag.'" familia="tag,'.$tag.'" /> '."\n";
  95 + }
72 } 96 }
73 } 97 }
74 $id = $contador; 98 $id = $contador;
@@ -82,7 +106,7 @@ foreach ($tipos as $tipo) @@ -82,7 +106,7 @@ foreach ($tipos as $tipo)
82 foreach($ws as $w) 106 foreach($ws as $w)
83 { 107 {
84 $contador++; 108 $contador++;
85 - $nome = str_replace("&","&amp;",$w["nome_ws"]); 109 + $nome = html_entity_decode($w["nome_ws"]);
86 if($nome != "") 110 if($nome != "")
87 $xml .= '<item id="'.$contador.'" tipo="TE3" nome="'.$nome.'" familia="'.$tipo["tipo_ws"].'" /> '."\n"; 111 $xml .= '<item id="'.$contador.'" tipo="TE3" nome="'.$nome.'" familia="'.$tipo["tipo_ws"].'" /> '."\n";
88 } 112 }
admin/index.html
@@ -86,7 +86,6 @@ que por sua vez contém temas.&lt;/p&gt; @@ -86,7 +86,6 @@ que por sua vez contém temas.&lt;/p&gt;
86 <tr onclick="ajuda('a2',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr> 86 <tr onclick="ajuda('a2',this)"><td><div class=ajuda ></div></td><td>Ajuda</td></tr>
87 <tr onclick="abre('html/perfis.html')"><td><div class=aplicar ></div></td><td>Editar a lista de perfis</td></tr> 87 <tr onclick="abre('html/perfis.html')"><td><div class=aplicar ></div></td><td>Editar a lista de perfis</td></tr>
88 <tr onclick="abre('html/tags.html')"><td><div class=aplicar ></div></td><td>Editar a lista de tags (palavras-chave)</td></tr> 88 <tr onclick="abre('html/tags.html')"><td><div class=aplicar ></div></td><td>Editar a lista de tags (palavras-chave)</td></tr>
89 -<tr onclick="abre('html/listatemas.html')"><td><div class=aplicar ></div></td><td>Editar a lista de temas</td></tr>  
90 <tr onclick="abre('html/arvore.html')"><td><div class=aplicar ></div></td><td>Editar a árvore dos menus</td></tr> 89 <tr onclick="abre('html/arvore.html')"><td><div class=aplicar ></div></td><td>Editar a árvore dos menus</td></tr>
91 <tr onclick="abre('html/importarmenu.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr> 90 <tr onclick="abre('html/importarmenu.html')"><td><div class=aplicar ></div></td><td>Importar XML</td></tr>
92 </table> 91 </table>
admin/js/core.js
@@ -864,6 +864,7 @@ funcaoRetorno - funcao que será executada ao terminar a busca pelos dados @@ -864,6 +864,7 @@ funcaoRetorno - funcao que será executada ao terminar a busca pelos dados
864 */ 864 */
865 function core_pegaDados(mensagem,sUrl,funcaoRetorno) 865 function core_pegaDados(mensagem,sUrl,funcaoRetorno)
866 { 866 {
  867 + if("mensagem" != "")
867 core_carregando(mensagem); 868 core_carregando(mensagem);
868 var callback = 869 var callback =
869 { 870 {
@@ -871,7 +872,12 @@ function core_pegaDados(mensagem,sUrl,funcaoRetorno) @@ -871,7 +872,12 @@ function core_pegaDados(mensagem,sUrl,funcaoRetorno)
871 { 872 {
872 try 873 try
873 {eval(funcaoRetorno+"(YAHOO.lang.JSON.parse(o.responseText))");} 874 {eval(funcaoRetorno+"(YAHOO.lang.JSON.parse(o.responseText))");}
874 - catch(e){core_carregando("desativa");core_handleFailure(o,o.responseText);} 875 + catch(e)
  876 + {
  877 + if("mensagem" != "")
  878 + core_carregando("desativa");
  879 + core_handleFailure(o,o.responseText);
  880 + }
875 }, 881 },
876 failure:core_handleFailure, 882 failure:core_handleFailure,
877 argument: { foo:"foo", bar:"bar" } 883 argument: { foo:"foo", bar:"bar" }
admin/php/menutemas.php
@@ -55,6 +55,33 @@ switch ($funcao) @@ -55,6 +55,33 @@ switch ($funcao)
55 exit; 55 exit;
56 break; 56 break;
57 57
  58 + case "pegaTagsPorMapfile":
  59 + $q = pegaDados("select link_tema,tags_tema,codigo_tema,nome_tema from i3geoadmin_temas");
  60 + $temas = array();
  61 + $temaExiste = array();
  62 + foreach($q as $row)
  63 + {
  64 + $ts = html_entity_decode($row['tags_tema']);
  65 + $i = $row['codigo_tema'];
  66 + $nome = $row['nome_tema'];
  67 + $link = $row['link_tema'];
  68 + $tags = explode(" ",$ts);
  69 + foreach($tags as $t)
  70 + {
  71 + if (removeAcentos($t) == $tag)
  72 + {
  73 + if(!isset($temaExiste[$i]))
  74 + {
  75 + $temas[] = array("codigoMap"=>$i,"nome"=>$nome,"link"=>$link);
  76 + $temaExiste[$i] = 0;
  77 + }
  78 + }
  79 + }
  80 + }
  81 + retornaJSON($temas);
  82 + exit;
  83 + break;
  84 +
58 case "pegaPerfis": 85 case "pegaPerfis":
59 $dados = pegaDados('SELECT * from i3geoadmin_perfis order by perfil'); 86 $dados = pegaDados('SELECT * from i3geoadmin_perfis order by perfil');
60 if(count($dados) == 0){$dados = array("id_perfil"=>"","perfil"=>"");} 87 if(count($dados) == 0){$dados = array("id_perfil"=>"","perfil"=>"");}
@@ -561,7 +588,7 @@ function alteraTags() @@ -561,7 +588,7 @@ function alteraTags()
561 //exclui os registros do tag alterado nos temas 588 //exclui os registros do tag alterado nos temas
562 if($original != "") 589 if($original != "")
563 { 590 {
564 - $q = $dbh->query("select * from i3geoadmin_temas"); 591 + $q = $dbh->query("select tags_tema,id_tema from i3geoadmin_temas");
565 foreach($q as $row) 592 foreach($q as $row)
566 { 593 {
567 $ts = $row['tags_tema']; 594 $ts = $row['tags_tema'];