Commit 8c59dd236fc47a8971f10cae044d567e3e2ad95d

Authored by Edmar Moretti
1 parent 4b509519

Inclusão de filtro por letra no editor de mapfiles do sistema de administração

admin/html/editormapfile.html
... ... @@ -46,9 +46,28 @@
46 46 <br><br>
47 47 Além de criar os mapfiles, é necessário definir as características de cada LAYER nas opções abaixo.<br>
48 48 <br>
  49 +<div id="letras" ></div>
  50 +<br>
49 51 <p>Mapfiles (arquivos .map existentes no diretório i3geo/temas):</p>
50 52 <div id="tabela" style="left:-5px;"></div>
51 53 </div>
52 54 <div id=logajax style="display:block" ></div>
53 55 <div id=dialogoContinua style="display:block" ></div>
  56 +<script>
  57 +YAHOO.util.Event.addListener(window, "load", initMenu);
  58 +var letras = "A B C D E F G H I J K L M N O P Q R S T U V X Y Z _ 1 2 3 4 5 6 7 8 9".split(" "),
  59 + nletras = letras.length,
  60 + i,
  61 + ins = "<p>";
  62 +for(i=0;i<nletras;i++){
  63 + ins += "<span onclick='filtraLetra(\""+letras[i]+"\")' style='color:blue;cursor:pointer'>"+letras[i]+" </span>";
  64 +}
  65 +document.getElementById("letras").innerHTML = ins;
  66 +
  67 +function filtraLetra(letra){
  68 + document.getElementById("tabela").innerHTML = "<span style=color:red >Aguarde...</span>";
  69 + core_pegaMapfiles("montaArvore()",letra)
  70 +}
  71 +
  72 +</script>
54 73 </body>
... ...
admin/js/core.js
... ... @@ -342,12 +342,20 @@ Pega a lista de mapfiles
342 342 Parameters:
343 343  
344 344 funcao - (opcional) nome da funcao que será executada ao terminar a busca pelos dados
  345 +
  346 +letra - (opcional) letra inicial utilizada para filtrar a lista
345 347 */
346   -function core_pegaMapfiles(funcaoM)
  348 +function core_pegaMapfiles(funcaoM,letra)
347 349 {
348   - if(arguments.length == 0)
349   - {var funcao = "";}
350   - var sUrl = "../php/menutemas.php?funcao=listaMapsTemas";
  350 + if(arguments.length == 0){
  351 + var funcao = "";
  352 + var letra = "";
  353 + }
  354 + if(arguments.length == 1){
  355 + var letra = "";
  356 + }
  357 +
  358 + var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra;
351 359 var callbackM =
352 360 {
353 361 success:function(o)
... ...
admin/js/editormapfile.js
... ... @@ -1341,4 +1341,4 @@ function sobeDesce(movimento,tipo,codigoMap,codigoLayer,indiceClasse,indiceEstil
1341 1341 core_makeRequest(sUrl,callback)
1342 1342 }
1343 1343 }
1344   -YAHOO.util.Event.addListener(window, "load", initMenu);
1345 1344 \ No newline at end of file
  1345 +//YAHOO.util.Event.addListener(window, "load", initMenu);
1346 1346 \ No newline at end of file
... ...
admin/php/menutemas.php
... ... @@ -857,7 +857,7 @@ locaplic - localização da instalação do I3Geo
857 857 */
858 858 function listaMapsTemas()
859 859 {
860   - global $cp,$locaplic;
  860 + global $cp,$locaplic,$letra;
861 861 $arquivos = array();
862 862 if (is_dir($locaplic."/temas"))
863 863 {
... ... @@ -869,7 +869,13 @@ function listaMapsTemas()
869 869 {
870 870 $file = str_replace(".map","",$file);
871 871 $file = str_replace(".php","",$file);
872   - $arquivos[] = $file;
  872 + if(isset($letra) && $letra != "")
  873 + {
  874 + if(strtolower(substr(basename($file),0,1)) == strtolower($letra))
  875 + {$arquivos[] = $file;}
  876 + }
  877 + else
  878 + {$arquivos[] = $file;}
873 879 }
874 880 }
875 881 }
... ...