Commit e7ecdaed22d3c429773b252d5661490f5a80e325
1 parent
009f17fd
Exists in
master
and in
7 other branches
Adaptação para uso com múltiplos menus
Showing
2 changed files
with
23 additions
and
15 deletions
Show diff stats
mobile/adicionatema.php
@@ -70,6 +70,7 @@ h1 | @@ -70,6 +70,7 @@ h1 | ||
70 | <input id='grupo' type=hidden name='grupo' value='' /> | 70 | <input id='grupo' type=hidden name='grupo' value='' /> |
71 | <input id='subgrupo' type=hidden name='subgrupo' value='' /> | 71 | <input id='subgrupo' type=hidden name='subgrupo' value='' /> |
72 | <input id='tid' type=hidden name='tid' value='' /> | 72 | <input id='tid' type=hidden name='tid' value='' /> |
73 | + <input id='idmenu' type=hidden name='idmenu' value='' /> | ||
73 | </form> | 74 | </form> |
74 | <input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br> | 75 | <input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br> |
75 | <?php | 76 | <?php |
@@ -81,8 +82,8 @@ $protocolo = $protocolo[0] . '://'.$_SERVER['SERVER_NAME'] .":". $_SERVER['SERVE | @@ -81,8 +82,8 @@ $protocolo = $protocolo[0] . '://'.$_SERVER['SERVER_NAME'] .":". $_SERVER['SERVE | ||
81 | $urli3geo = str_replace("/mobile/adicionatema.php","",$protocolo.$_SERVER["PHP_SELF"]); | 82 | $urli3geo = str_replace("/mobile/adicionatema.php","",$protocolo.$_SERVER["PHP_SELF"]); |
82 | if ($tipo == "listatemas") | 83 | if ($tipo == "listatemas") |
83 | { | 84 | { |
84 | - $m = new Menutemas("","",$locsistemas,$locaplic,$menutemas,$urli3geo); | ||
85 | - $r = $m->pegaListaDeTemas($grupo,$subgrupo,""); | 85 | + $m = new Menutemas("","",$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); |
86 | + $r = $m->pegaListaDeTemas($grupo,$subgrupo,$idmenu); | ||
86 | echo "<h1>Escolha o tema:</h1>"; | 87 | echo "<h1>Escolha o tema:</h1>"; |
87 | foreach($r as $l) | 88 | foreach($r as $l) |
88 | { | 89 | { |
@@ -100,23 +101,28 @@ if($tipo == "adicionatema") | @@ -100,23 +101,28 @@ if($tipo == "adicionatema") | ||
100 | } | 101 | } |
101 | if ($tipo == "adicionar") | 102 | if ($tipo == "adicionar") |
102 | { | 103 | { |
103 | - $m = new Menutemas("","",$locsistemas,$locaplic,$menutemas,$urli3geo); | ||
104 | - $r = $m->pegaListaDeGrupos("","","sim"); | ||
105 | echo "<h1>Escolha o sub-grupo:</h1>"; | 104 | echo "<h1>Escolha o sub-grupo:</h1>"; |
106 | - for($rid=0;$rid<count($r);$rid++) | 105 | + $m = new Menutemas("","",$locsistemas,$locaplic,$menutemas,$urli3geo,$editores); |
106 | + $menus = $m->pegaListaDeMenus(); | ||
107 | + foreach ($menus as $menu) | ||
107 | { | 108 | { |
108 | - $g = $r[$rid]; | ||
109 | - echo $g["nome"]."<br>"; | ||
110 | - $sub = $g["subgrupos"]; | ||
111 | - for($sid=0;$sid<count($sub);$sid++) | 109 | + if($menu["publicado"] != "NAO") |
112 | { | 110 | { |
113 | - $s = $sub[$sid]; | ||
114 | - echo "<input type='radio' onclick='listatemas(\"".$rid."\",\"".$sid."\")' /><span style='color:gray;font-size:12pt;'>".$s["nome"]."</span><br>"; | 111 | + $r = $m->pegaListaDeGrupos($menu["idmenu"],"","sim"); |
112 | + for($rid=0;$rid<count($r);$rid++) | ||
113 | + { | ||
114 | + $g = $r[$rid]; | ||
115 | + echo $g["nome"]."<br>"; | ||
116 | + $sub = $g["subgrupos"]; | ||
117 | + for($sid=0;$sid<count($sub);$sid++) | ||
118 | + { | ||
119 | + $s = $sub[$sid]; | ||
120 | + echo "<input type='radio' onclick='listatemas(\"".$rid."\",\"".$sid."\",\"".$menu["idmenu"]."\")' /><span style='color:gray;font-size:12pt;'>".$s["nome"]."</span><br>"; | ||
121 | + } | ||
122 | + } | ||
115 | } | 123 | } |
116 | } | 124 | } |
117 | } | 125 | } |
118 | - | ||
119 | - | ||
120 | ?> | 126 | ?> |
121 | <input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br> | 127 | <input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br> |
122 | </body> | 128 | </body> |
@@ -127,11 +133,12 @@ function retorno() | @@ -127,11 +133,12 @@ function retorno() | ||
127 | document.getElementById('f').action = 'mobile.php'; | 133 | document.getElementById('f').action = 'mobile.php'; |
128 | document.getElementById('f').submit(); | 134 | document.getElementById('f').submit(); |
129 | } | 135 | } |
130 | -function listatemas(grupo,sub) | 136 | +function listatemas(grupo,sub,menu) |
131 | { | 137 | { |
132 | document.getElementById("tipo").value = "listatemas"; | 138 | document.getElementById("tipo").value = "listatemas"; |
133 | document.getElementById("grupo").value = grupo; | 139 | document.getElementById("grupo").value = grupo; |
134 | document.getElementById("subgrupo").value = sub; | 140 | document.getElementById("subgrupo").value = sub; |
141 | + document.getElementById("idmenu").value = menu; | ||
135 | document.getElementById('f').submit(); | 142 | document.getElementById('f').submit(); |
136 | } | 143 | } |
137 | function adicionatema(tid) | 144 | function adicionatema(tid) |
mobile/index.php
@@ -69,7 +69,8 @@ include("../ms_configura.php"); | @@ -69,7 +69,8 @@ include("../ms_configura.php"); | ||
69 | echo $tituloInstituicao; | 69 | echo $tituloInstituicao; |
70 | if (!isset($temasa)){$temasa = "";} | 70 | if (!isset($temasa)){$temasa = "";} |
71 | if (!isset($layers)){$layers = $temasa;} | 71 | if (!isset($layers)){$layers = $temasa;} |
72 | -$m = new Menutemas($tmpfname,""); | 72 | +error_reporting(E_ALL); |
73 | +$m = new Menutemas("","","",$locaplic,$menutemas,"",$editores); | ||
73 | $mapas = $m->pegaListaDeMapas($locmapas); | 74 | $mapas = $m->pegaListaDeMapas($locmapas); |
74 | echo "<h1>Escolha um dos mapas:</h1>"; | 75 | echo "<h1>Escolha um dos mapas:</h1>"; |
75 | foreach($mapas["mapas"] as $obj) | 76 | foreach($mapas["mapas"] as $obj) |