Commit 8be09e2d397a15a8973a1dae5347e23d1a5bc90f

Authored by Edmar Moretti
1 parent 4fbe2220

Inclusão de opção para abrir um mapa salvo anteriormente utilizando-se seu id (aplicativo linkperm)

classesphp/classe_menutemas.php
@@ -239,7 +239,7 @@ locmapas - endereço do arquivo xml. @@ -239,7 +239,7 @@ locmapas - endereço do arquivo xml.
239 return: 239 return:
240 array 240 array
241 */ 241 */
242 - function pegaListaDeMapas($locmapas) 242 + function pegaListaDeMapas($locmapas,$id_mapa="")
243 { 243 {
244 //necessário por conta da inclusao do conexao.php 244 //necessário por conta da inclusao do conexao.php
245 $locaplic = $this->locaplic; 245 $locaplic = $this->locaplic;
@@ -269,8 +269,11 @@ array @@ -269,8 +269,11 @@ array
269 $p = $this->ixml($s,"PUBLICADO"); 269 $p = $this->ixml($s,"PUBLICADO");
270 $m = $this->ixml($s,"CONTEMMAPFILE"); 270 $m = $this->ixml($s,"CONTEMMAPFILE");
271 $id = $this->ixml($s,"ID_MAPA"); 271 $id = $this->ixml($s,"ID_MAPA");
272 - echo $p;  
273 - if(strtoupper($p) != "NAO"){ 272 + //echo $p;
  273 + if($id_mapa != "" && $id == $id_mapa && strtoupper($p) != "NAO"){
  274 + return array("mapas"=>array("ID_MAPA"=>$id,"PUBLICADO"=>$p,"NOME"=>$n,"IMAGEM"=>$i,"TEMAS"=>$t,"LIGADOS"=>$l,"EXTENSAO"=>$e,"OUTROS"=>$o,"LINK"=>$k,"CONTEMMAPFILE"=>$m));
  275 + }
  276 + if($id_mapa == "" && strtoupper($p) != "NAO"){
274 $mapas[] = array("ID_MAPA"=>$id,"PUBLICADO"=>$p,"NOME"=>$n,"IMAGEM"=>$i,"TEMAS"=>$t,"LIGADOS"=>$l,"EXTENSAO"=>$e,"OUTROS"=>$o,"LINK"=>$k,"CONTEMMAPFILE"=>$m); 277 $mapas[] = array("ID_MAPA"=>$id,"PUBLICADO"=>$p,"NOME"=>$n,"IMAGEM"=>$i,"TEMAS"=>$t,"LIGADOS"=>$l,"EXTENSAO"=>$e,"OUTROS"=>$o,"LINK"=>$k,"CONTEMMAPFILE"=>$m);
275 } 278 }
276 } 279 }
classesphp/mapa_controle.php
@@ -1829,13 +1829,18 @@ switch (strtoupper($funcao)) { @@ -1829,13 +1829,18 @@ switch (strtoupper($funcao)) {
1829 } else { 1829 } else {
1830 $perfil = ""; 1830 $perfil = "";
1831 } 1831 }
  1832 + if (isset($_pg["id_mapa"])) {
  1833 + $id_mapa = $_pg["id_mapa"];
  1834 + } else {
  1835 + $id_mapa = "";
  1836 + }
1832 if (isset($_pg["idioma"])) { 1837 if (isset($_pg["idioma"])) {
1833 $idioma = $_pg["idioma"]; 1838 $idioma = $_pg["idioma"];
1834 } else { 1839 } else {
1835 $idioma = "pt"; 1840 $idioma = "pt";
1836 } 1841 }
1837 $m = new Menutemas($map_file, $perfil, $locaplic, $urli3geo, $idioma); 1842 $m = new Menutemas($map_file, $perfil, $locaplic, $urli3geo, $idioma);
1838 - $retorno = $m->pegaListaDeMapas($locmapas); 1843 + $retorno = $m->pegaListaDeMapas($locmapas,$id_mapa);
1839 break; 1844 break;
1840 /* 1845 /*
1841 * Section: Webservices 1846 * Section: Webservices
mapas/index.js
@@ -33,7 +33,7 @@ function mostraBotoesBT(){ @@ -33,7 +33,7 @@ function mostraBotoesBT(){
33 }); 33 });
34 }; 34 };
35 //cpJSON vem de classe_php.js 35 //cpJSON vem de classe_php.js
36 - cpJSON.call("../classesphp/mapa_controle.php?map_file=&funcao=pegaMapas&g_sid=", "foo", r); 36 + cpJSON.call("../classesphp/mapa_controle.php?id_mapa=&map_file=&funcao=pegaMapas&g_sid=", "foo", r);
37 } 37 }
38 //define os links adicionais conforme o tipo de mapa 38 //define os links adicionais conforme o tipo de mapa
39 function verificaMapa(mapa){ 39 function verificaMapa(mapa){
mapas/link.php 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +<?php
  2 +if(empty($_GET["id"])){
  3 + exit;
  4 +}
  5 +include_once ("../classesphp/classe_menutemas.php");
  6 +$m = new Menutemas();
  7 +$mapas = $m->pegaListaDeMapas("",(int) $_GET["id"]);
  8 +if(count($mapas["mapas"]) > 0){
  9 + $mapa = $mapas["mapas"];
  10 + $link = $mapa["LINK"];
  11 + if($mapa["LINK"] == ""){
  12 + $link = "../ms_criamapa.php?temasa=" . $mapa["TEMAS"] . "&layers=" . $mapa["LIGADOS"];
  13 + if ($mapa["EXTENSAO"] !== "") {
  14 + $link .= "&mapext=" . $mapa["EXTENSAO"];
  15 + }
  16 + if ($mapa["OUTROS"] !== "") {
  17 + $link .= "&" . $mapa["OUTROS"];
  18 + }
  19 + }
  20 + echo "<meta http-equiv='refresh' content='0;url=$link'>";
  21 +}
  22 +?>
0 \ No newline at end of file 23 \ No newline at end of file
mapas/templates/templatelinks.php
1 <script id="templateLinks" type="x-tmpl-mustache"> 1 <script id="templateLinks" type="x-tmpl-mustache">
2 <div class="list-group"> 2 <div class="list-group">
3 <div class="list-group-separator"></div> 3 <div class="list-group-separator"></div>
4 - <div class="row-content" > 4 + <div class="row-content" style="word-wrap: break-word;">
5 <h4 class="list-group-item-heading"> 5 <h4 class="list-group-item-heading">
6 <a href="{{{link}}}" target="_blank">{{{nome}}}</a> 6 <a href="{{{link}}}" target="_blank">{{{nome}}}</a>
7 </h4> 7 </h4>
mapas/templates/templatelista.php
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 <span class="glyphicon glyphicon-qrcode" aria-hidden="true"></span> 16 <span class="glyphicon glyphicon-qrcode" aria-hidden="true"></span>
17 </a> 17 </a>
18 </div> 18 </div>
19 - <a href="{{{LINK}}}" ><img class="img-rounded hidden-xs" src="{{{IMAGEM}}}" />&nbsp;{{{NOME}}}</a> 19 + <a href="link.php?id={{{ID_MAPA}}}" target="_blank"><img class="img-rounded hidden-xs" src="{{{IMAGEM}}}" />&nbsp;{{{NOME}}} <i class="material-icons md-18">link</i></a>
20 </h4> 20 </h4>
21 </div> 21 </div>
22 <div class="list-group-separator"></div> 22 <div class="list-group-separator"></div>