Commit edd839c554330403dfadf92a8787c06b27ffbb0f

Authored by Edmar Moretti
1 parent 78dd1b04

Criação de modelo para substituição dos botões baseados na biblioteca YUI

classesphp/classe_mapa.php
@@ -1382,31 +1382,24 @@ class Mapa @@ -1382,31 +1382,24 @@ class Mapa
1382 */ 1382 */
1383 function excluiTemas($temas) 1383 function excluiTemas($temas)
1384 { 1384 {
1385 - if (file_exists($this->qyfile))  
1386 - { 1385 + if (file_exists($this->qyfile)){
1387 unlink($this->qyfile); 1386 unlink($this->qyfile);
1388 } 1387 }
1389 $temas = explode(",",$temas); 1388 $temas = explode(",",$temas);
1390 - foreach ($temas as $nome)  
1391 - {  
1392 - if ($layer = @$this->mapa->getlayerbyname($nome))  
1393 - { 1389 + foreach ($temas as $nome){
  1390 + if ($layer = @$this->mapa->getlayerbyname($nome)){
1394 $grupo = $layer->group; 1391 $grupo = $layer->group;
1395 $layer->set("status",MS_DELETE); 1392 $layer->set("status",MS_DELETE);
1396 $lgs = $this->mapa->getLayersIndexByGroup($grupo); 1393 $lgs = $this->mapa->getLayersIndexByGroup($grupo);
1397 - if($lgs && $grupo != "")  
1398 - {  
1399 - foreach ($lgs as $lg)  
1400 - { 1394 + if($lgs && $grupo != ""){
  1395 + foreach ($lgs as $lg){
1401 $ll = $this->mapa->getlayer($lg); 1396 $ll = $this->mapa->getlayer($lg);
1402 $ll->set("status",MS_DELETE); 1397 $ll->set("status",MS_DELETE);
1403 } 1398 }
1404 } 1399 }
1405 $lgs = $this->mapa->getLayersIndexByGroup($nome); 1400 $lgs = $this->mapa->getLayersIndexByGroup($nome);
1406 - if ($lgs)  
1407 - {  
1408 - foreach ($lgs as $lg)  
1409 - { 1401 + if ($lgs){
  1402 + foreach ($lgs as $lg){
1410 $ll = $this->mapa->getlayer($lg); 1403 $ll = $this->mapa->getlayer($lg);
1411 $ll->set("status",MS_DELETE); 1404 $ll->set("status",MS_DELETE);
1412 } 1405 }
classesphp/classe_temas.php
@@ -684,6 +684,7 @@ Copia um tema @@ -684,6 +684,7 @@ Copia um tema
684 $layer->setmetadata("cache",""); 684 $layer->setmetadata("cache","");
685 $novoname = "copia".nomerandomico(); 685 $novoname = "copia".nomerandomico();
686 $layer->set("name",$novoname); 686 $layer->set("name",$novoname);
  687 + $layer->set("group","");
687 } 688 }
688 return ("ok"); 689 return ("ok");
689 } 690 }
css/i3geo7.css.php 100644 → 100755
ferramentas/atalhoscamada/dependencias.php
@@ -20,6 +20,7 @@ echo "\n"; @@ -20,6 +20,7 @@ echo "\n";
20 /** 20 /**
21 * Inclui o template mustache do HTML usado para criar o conteudo da janela 21 * Inclui o template mustache do HTML usado para criar o conteudo da janela
22 */ 22 */
  23 +/*
23 echo 'i3GEOF.atalhoscamada.MUSTACHE = "'; 24 echo 'i3GEOF.atalhoscamada.MUSTACHE = "';
24 $texto = file_get_contents("template_mst.html"); 25 $texto = file_get_contents("template_mst.html");
25 $texto = str_replace("\n", "", $texto); 26 $texto = str_replace("\n", "", $texto);
@@ -28,6 +29,7 @@ $texto = str_replace("\t", "", $texto); @@ -28,6 +29,7 @@ $texto = str_replace("\t", "", $texto);
28 $texto = str_replace('"', "'", $texto); 29 $texto = str_replace('"', "'", $texto);
29 echo $texto; 30 echo $texto;
30 echo '";'; 31 echo '";';
  32 +*/
31 if(extension_loaded('zlib')){ 33 if(extension_loaded('zlib')){
32 ob_end_flush(); 34 ob_end_flush();
33 } 35 }
ferramentas/atalhoscamada/dicionario.js
@@ -25,7 +25,7 @@ i3GEOF.atalhoscamada.dicionario = { @@ -25,7 +25,7 @@ i3GEOF.atalhoscamada.dicionario = {
25 ], 25 ],
26 "copia" : [ 26 "copia" : [
27 { 27 {
28 - pt : "Cria uma cópia da camada", 28 + pt : "cópia da camada",
29 en : "", 29 en : "",
30 es : "Crea una copia de la capa", 30 es : "Crea una copia de la capa",
31 it : "" 31 it : ""
ferramentas/atalhoscamada/index.js
@@ -19,7 +19,25 @@ i3GEOF.atalhoscamada = @@ -19,7 +19,25 @@ i3GEOF.atalhoscamada =
19 * Susbtitutos para o template 19 * Susbtitutos para o template
20 */ 20 */
21 mustacheHash : function(idjanela) { 21 mustacheHash : function(idjanela) {
22 - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.atalhoscamada.dicionario); 22 + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.atalhoscamada.dicionario),
  23 + tema = i3GEOF.atalhoscamada.propJanelas[idjanela].tema,
  24 + ltema = i3GEO.arvoreDeCamadas.pegaTema(tema),
  25 + funcoes,vetor=false;
  26 +
  27 + if ((ltema.type < 3) && (ltema.connectiontype !== 7)){
  28 + vetor = true;
  29 + }
  30 + //
  31 + // ajusta as propriedades e funcoes caso a camada seja um plugin
  32 + //
  33 + ltema = i3GEO.pluginI3geo.aplicaPropriedades(ltema);
  34 + // inclui no objeto o parametro de verificacao
  35 + // e necessario clonar para nao alterar o original
  36 + funcoes = i3GEO.util.cloneObj(i3GEO.arvoreDeCamadas.FUNCOES);
  37 + funcoes.plugini3geo = ltema.plugini3geo;
  38 + funcoes = i3GEO.pluginI3geo.aplicaPropriedades(funcoes);
  39 +
  40 + //constroi o hash para substituir no template
23 dicionario["locaplic"] = i3GEO.configura.locaplic; 41 dicionario["locaplic"] = i3GEO.configura.locaplic;
24 dicionario["procurar"] = $trad("t23"); 42 dicionario["procurar"] = $trad("t23");
25 dicionario["topo"] = $trad("t25"); 43 dicionario["topo"] = $trad("t25");
@@ -35,8 +53,25 @@ i3GEOF.atalhoscamada = @@ -35,8 +53,25 @@ i3GEOF.atalhoscamada =
35 dicionario["wms"] = "WMS-OGC"; 53 dicionario["wms"] = "WMS-OGC";
36 dicionario["salvamapfile"] = $trad("t44"); 54 dicionario["salvamapfile"] = $trad("t44");
37 dicionario["tme"] = $trad("t49"); 55 dicionario["tme"] = $trad("t49");
  56 + dicionario["topo"] = $trad("x56");
38 dicionario["idjanela"] = idjanela; 57 dicionario["idjanela"] = idjanela;
39 dicionario["idjanelaA"] = '"'+idjanela+'"'; 58 dicionario["idjanelaA"] = '"'+idjanela+'"';
  59 + dicionario["tema"] = tema;
  60 +
  61 + //decide se o botao deve aparecer ou nao
  62 + dicionario["procurarHidden"] = (vetor == true) ? "":"hidden";
  63 + dicionario["topoHidden"] = (vetor == true) ? "":"hidden";
  64 + dicionario["topoHidden"] = (vetor == true) ? "":"hidden";
  65 + dicionario["etiquetasHidden"] = (vetor == true) ? "":"hidden";
  66 + dicionario["filtroHidden"] = (vetor == true) ? "":"hidden";
  67 + dicionario["tabelaHidden"] = (vetor == true) ? "":"hidden";
  68 + dicionario["selecaoHidden"] = (vetor == true) ? "":"hidden";
  69 + dicionario["graficoHidden"] = (vetor == true) ? "":"hidden";
  70 + dicionario["StoryMapHidden"] = (vetor == true) ? "":"hidden";
  71 + dicionario["legendaHidden"] = (ltema.type < 4 || ltema.type === 8) ? "":"hidden";
  72 + dicionario["destacaHidden"] = (i3GEO.Interface.ATUAL == "openlayers") ? "":"hidden";
  73 + dicionario["wmsHidden"] = (ltema.permiteogc.toLowerCase() !== "nao") ? "":"hidden";
  74 +
40 return dicionario; 75 return dicionario;
41 }, 76 },
42 /* 77 /*
@@ -49,209 +84,13 @@ i3GEOF.atalhoscamada = @@ -49,209 +84,13 @@ i3GEOF.atalhoscamada =
49 * iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta 84 * iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta
50 */ 85 */
51 inicia : function(iddiv, idjanela) { 86 inicia : function(iddiv, idjanela) {
52 - var tema, temp, b, ltema, funcoes = i3GEO.arvoreDeCamadas.FUNCOES;  
53 -  
54 - tema = i3GEOF.atalhoscamada.propJanelas[idjanela].tema;  
55 - ltema = i3GEO.arvoreDeCamadas.pegaTema(tema);  
56 -  
57 - //  
58 - // ajusta as propriedades e funcoes caso a camada seja um plugin  
59 - //  
60 - ltema = i3GEO.pluginI3geo.aplicaPropriedades(ltema);  
61 - // inclui no objeto o parametro de verificacao  
62 - // e necessario clonar para nao alterar o original  
63 - funcoes = i3GEO.util.cloneObj(funcoes);  
64 - funcoes.plugini3geo = ltema.plugini3geo;  
65 - funcoes = i3GEO.pluginI3geo.aplicaPropriedades(funcoes);  
66 -  
67 - $i(iddiv).innerHTML = i3GEOF.atalhoscamada.html(idjanela);  
68 -  
69 - if( i3GEO.login.verificaCookieLogin()){  
70 - if (funcoes.sql === true) {  
71 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaSql", {  
72 - onclick : {  
73 - fn : function() {  
74 - i3GEO.tema.dialogo.editorsql(tema);  
75 - }  
76 - }  
77 - });  
78 - b.addClass("abrir");  
79 - }  
80 - if (i3GEO.parametros.editor.toLowerCase() === "sim" && i3GEO.configura.optUsuarioLogado == true ) {  
81 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaSalva", {  
82 - onclick : {  
83 - fn : function() {  
84 - i3GEO.tema.dialogo.salvaMapfile(tema);  
85 - }  
86 - }  
87 - });  
88 - b.addClass("abrir");  
89 - }  
90 - }  
91 -  
92 - if (funcoes.tme === true) {  
93 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaTme", {  
94 - onclick : {  
95 - fn : function() {  
96 - i3GEO.tema.dialogo.tme(tema);  
97 - }  
98 - }  
99 - });  
100 - b.addClass("abrir");  
101 - }  
102 -  
103 - if (funcoes.wms === true  
104 - && ltema.permiteogc.toLowerCase() !== "nao") {  
105 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaWms", {  
106 - onclick : {  
107 - fn : function() {  
108 - i3GEO.tema.dialogo.mostraWms(tema);  
109 - }  
110 - }  
111 - });  
112 - b.addClass("abrir");  
113 - }  
114 -  
115 - if (funcoes.comentar === true  
116 - && ltema.permitecomentario.toLowerCase() !== "nao"  
117 - && i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios === true) {  
118 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaComentar", {  
119 - onclick : {  
120 - fn : function() {  
121 - i3GEO.tema.dialogo.comentario(tema);  
122 - }  
123 - }  
124 - });  
125 - b.addClass("abrir");  
126 - }  
127 -  
128 - if (funcoes.destacar === true  
129 - && i3GEO.Interface.ATUAL !== "googlemaps"  
130 - && i3GEO.Interface.ATUAL !== "googleearth") {  
131 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaDestaca", {  
132 - onclick : {  
133 - fn : function() {  
134 - i3GEO.navega.destacaTema.inicia(tema);  
135 - }  
136 - }  
137 - });  
138 - b.addClass("abrir");  
139 - }  
140 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaCopia", {  
141 - onclick : {  
142 - fn : function() {  
143 - i3GEO.tema.copia(tema);  
144 - }  
145 - }  
146 - });  
147 - b.addClass("rodar");  
148 -  
149 - if ((ltema.type < 3) && (ltema.connectiontype !== 7)){  
150 - if (funcoes.procurar === true) {  
151 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaProcurar", {  
152 - onclick : {  
153 - fn : function() {  
154 - i3GEO.tema.dialogo.procuraratrib(tema);  
155 - }  
156 - }  
157 - });  
158 - b.addClass("abrir");  
159 - }  
160 - if (funcoes.toponimia === true) {  
161 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaTopo", {  
162 - onclick : {  
163 - fn : function() {  
164 - i3GEO.tema.dialogo.toponimia(tema);  
165 - }  
166 - }  
167 - });  
168 - b.addClass("abrir");  
169 - }  
170 - if (funcoes.etiquetas === true) {  
171 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaEtiquetas", {  
172 - onclick : {  
173 - fn : function() {  
174 - i3GEO.tema.dialogo.etiquetas(tema);  
175 - }  
176 - }  
177 - });  
178 - b.addClass("abrir");  
179 - }  
180 - if (funcoes.filtrar === true) {  
181 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaFiltro", {  
182 - onclick : {  
183 - fn : function() {  
184 - i3GEO.tema.dialogo.filtro(tema);  
185 - }  
186 - }  
187 - });  
188 - b.addClass("abrir");  
189 - }  
190 - if (funcoes.tabela === true) {  
191 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaTabela", {  
192 - onclick : {  
193 - fn : function() {  
194 - i3GEO.tema.dialogo.tabela(tema);  
195 - }  
196 - }  
197 - });  
198 - b.addClass("abrir");  
199 - }  
200 - if (funcoes.selecao === true) {  
201 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaSelecao", {  
202 - onclick : {  
203 - fn : function() {  
204 - i3GEO.mapa.dialogo.selecao();  
205 - }  
206 - }  
207 - });  
208 - b.addClass("abrir");  
209 - }  
210 - if (funcoes.grafico === true) {  
211 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaGrafico", {  
212 - onclick : {  
213 - fn : function() {  
214 - i3GEO.tema.dialogo.graficotema(tema);  
215 - }  
216 - }  
217 - });  
218 - b.addClass("abrir");  
219 - }  
220 - if (funcoes.storymap === true) {  
221 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaStoryMap", {  
222 - onclick : {  
223 - fn : function() {  
224 - i3GEO.tema.dialogo.storymap(tema);  
225 - }  
226 - }  
227 - });  
228 - b.addClass("abrir");  
229 - }  
230 - }  
231 - if ((ltema.type < 4 || ltema.type === 8)  
232 - && funcoes.editorlegenda === true) {  
233 - b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaEditaLegenda", {  
234 - onclick : {  
235 - fn : function() {  
236 - i3GEO.tema.dialogo.editaLegenda(tema);  
237 - }  
238 - } 87 + if(i3GEOF.atalhoscamada.MUSTACHE == ""){
  88 + $.get(i3GEO.configura.locaplic + "/ferramentas/atalhoscamada/template_mst.html", function(template) {
  89 + i3GEOF.atalhoscamada.MUSTACHE = template;
  90 + i3GEOF.atalhoscamada.inicia(iddiv, idjanela);
239 }); 91 });
240 - b.addClass("abrir");  
241 - }  
242 - if (funcoes.compartilhar === true  
243 - && ltema.permitecomentario.toLowerCase() !== "nao") {  
244 - temp = i3GEO.configura.locaplic  
245 - + "/ms_criamapa.php?layers="  
246 - + ltema.name  
247 - + "&temasa="  
248 - + ltema.name;  
249 - $i("i3GEOFatalhoscamadaCompartilhar").innerHTML = i3GEO.social.compartilhar(  
250 - "",  
251 - temp,  
252 - temp,  
253 - "semtotal");  
254 } 92 }
  93 + $i(iddiv).innerHTML = i3GEOF.atalhoscamada.html(idjanela);
255 }, 94 },
256 /* 95 /*
257 * Function: html 96 * Function: html
ferramentas/atalhoscamada/template_mst.html
@@ -29,55 +29,17 @@ @@ -29,55 +29,17 @@
29 </div> 29 </div>
30 <br> 30 <br>
31 <div id='i3GEOFatalhoscamadaMenu' ></div> 31 <div id='i3GEOFatalhoscamadaMenu' ></div>
32 - <p class='paragrafo'>  
33 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaProcurar' type='button' value='{{{procurar}}}' style='display:none;'/>  
34 - </p>  
35 - <p class='paragrafo'>  
36 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaCopia' type='button' value='{{{copia}}}' />  
37 - </p>  
38 - <p class='paragrafo'>  
39 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaTopo' type='button' value='{{{topo}}}' style='display:none;'/>  
40 - </p>  
41 - <p class='paragrafo'>  
42 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaEtiquetas' type='button' value='{{{etiquetas}}}' style='display:none;'/>  
43 - </p>  
44 - <p class='paragrafo'>  
45 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaFiltro' type='button' value='{{{filtro}}}' style='display:none;'/>  
46 - </p>  
47 - <p class='paragrafo'>  
48 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaTabela' type='button' value='{{{tabela}}}' style='display:none;'/>  
49 - </p>  
50 - <p class='paragrafo'>  
51 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaSelecao' type='button' value='{{{selecao}}}' style='display:none;'/>  
52 - </p>  
53 - <p class='paragrafo'>  
54 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaGrafico' type='button' value='{{{grafico}}}' style='display:none;'/>  
55 - </p>  
56 - <p class='paragrafo'>  
57 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaEditaLegenda' type='button' value='{{{editaLegenda}}}' style='display:none;'/>  
58 - </p>  
59 - <p class='paragrafo'>  
60 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaDestaca' type='button' value='{{{destaca}}}' style='display:none;'/>  
61 - </p>  
62 - <p class='paragrafo'>  
63 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaComentar' type='button' value='{{{comentar}}}' style='display:none;'/>  
64 - </p>  
65 - <p class='paragrafo'>  
66 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaWms' type='button' value='{{{wms}}}' style='display:none;'/>  
67 - </p>  
68 - <p class='paragrafo'>  
69 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaTme' type='button' value='{{{tme}}}' style='display:none;'/>  
70 - </p>  
71 - <p class='paragrafo'>  
72 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaStoryMap' type='button' value='StoryMap' style='display:none;'/>  
73 - </p>  
74 - <hr>  
75 - <p>Login:</p>  
76 - <br>  
77 - <p class='paragrafo'>  
78 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaSql' type='button' value='{{{sql}}}' style='display:none;'/>  
79 - </p>  
80 - <p class='paragrafo'>  
81 - <input id='{{{idjanela}}}i3GEOFatalhoscamadaSalva' type='button' value='{{{salvamapfile}}}' style='display:none;'/>  
82 - </p> 32 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.procuraratrib('{{tema}}')" class='{{procurarHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{procurar}}}</a>
  33 + <a href='javascript:void(0)' onclick="i3GEO.tema.copia('{{tema}}')" class='btn btn-primary btn-lg btn-block btn-raised'>{{{copia}}}</a>
  34 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.toponimia('{{tema}}')" class='{{topoHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{topo}}}</a>
  35 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.etiquetas('{{tema}}')" class='{{etiquetasHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{etiquetas}}}</a>
  36 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.filtro('{{tema}}')" class='{{filtroHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{filtro}}}</a>
  37 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.tabela('{{tema}}')" class='{{tabelaHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{tabela}}}</a>
  38 + <a href='javascript:void(0)' onclick="i3GEO.mapa.dialogo.selecao()" class='{{selecaoHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{selecao}}}</a>
  39 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.graficotema('{{tema}}')" class='{{graficoHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{grafico}}}</a>
  40 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.editaLegenda('{{tema}}')" class='{{legendaHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{editaLegenda}}}</a>
  41 + <a href='javascript:void(0)' onclick="i3GEO.navega.destacaTema.inicia('{{tema}}')" class='{{destacaHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{destaca}}}</a>
  42 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.mostraWms('{{tema}}')" class='{{wmsHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{wms}}}</a>
  43 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.tme('{{tema}}')" class='{{tmeHidden}} btn btn-primary btn-lg btn-block btn-raised'>{{{tme}}}</a>
  44 + <a href='javascript:void(0)' onclick="i3GEO.tema.dialogo.storymap('{{tema}}')" class='{{StoryMapHidden}} btn btn-primary btn-lg btn-block btn-raised'>StoryMap</a>
83 </div> 45 </div>
84 \ No newline at end of file 46 \ No newline at end of file
js/i3geo_tudo_compacto7.js.php 100644 → 100755