Commit c0e4147778971a5de801f7d815a227c34f13d09e
1 parent
ab540284
Exists in
master
Permite ligar e desligar camadas nos mashups mesmo que o sattus do LAYER seja DEFAULT
Showing
2 changed files
with
37 additions
and
31 deletions
Show diff stats
mashups/openlayers.php
@@ -9,19 +9,6 @@ include_once(dirname(__FILE__)."/../classesphp/sani_request.php"); | @@ -9,19 +9,6 @@ include_once(dirname(__FILE__)."/../classesphp/sani_request.php"); | ||
9 | include_once(dirname(__FILE__)."/../classesphp/carrega_ext.php"); | 9 | include_once(dirname(__FILE__)."/../classesphp/carrega_ext.php"); |
10 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); | 10 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); |
11 | error_reporting(0); | 11 | error_reporting(0); |
12 | -//cria as pastas temporarias caso nao existam | ||
13 | -if (! file_exists ( $dir_tmp )) { | ||
14 | - @mkdir ( $dir_tmp, 0744 ); | ||
15 | -} | ||
16 | -if (file_exists ( $dir_tmp )) { | ||
17 | - @mkdir ( $dir_tmp . "/comum", 0744 ); | ||
18 | - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
19 | - chmod ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
20 | - @mkdir ( $dir_tmp . "/cache", 0744 ); | ||
21 | - chmod ( $dir_tmp . "/cache", 0744 ); | ||
22 | - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
23 | - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
24 | -} | ||
25 | //variaveis utilizadas | 12 | //variaveis utilizadas |
26 | $parurl = array_merge($_GET,$_POST); | 13 | $parurl = array_merge($_GET,$_POST); |
27 | $desligacache = $parurl["desligacache"]; | 14 | $desligacache = $parurl["desligacache"]; |
@@ -52,6 +39,20 @@ $ativalayerswicther = $parurl["ativalayerswicther"]; | @@ -52,6 +39,20 @@ $ativalayerswicther = $parurl["ativalayerswicther"]; | ||
52 | $ativarodadomouse = $parurl["ativarodadomouse"]; | 39 | $ativarodadomouse = $parurl["ativarodadomouse"]; |
53 | $legendahtml = $parurl["legendahtml"]; | 40 | $legendahtml = $parurl["legendahtml"]; |
54 | $nocache = $parurl["nocache"]; | 41 | $nocache = $parurl["nocache"]; |
42 | + | ||
43 | +//cria as pastas temporarias caso nao existam | ||
44 | +if (! file_exists ( $dir_tmp )) { | ||
45 | + @mkdir ( $dir_tmp, 0744 ); | ||
46 | +} | ||
47 | +if (file_exists ( $dir_tmp )) { | ||
48 | + @mkdir ( $dir_tmp . "/comum", 0744 ); | ||
49 | + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
50 | + chmod ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
51 | + @mkdir ( $dir_tmp . "/cache", 0744 ); | ||
52 | + chmod ( $dir_tmp . "/cache", 0744 ); | ||
53 | + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
54 | + chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
55 | +} | ||
55 | if(!empty($desligacache)){ | 56 | if(!empty($desligacache)){ |
56 | $DESLIGACACHE = $desligacache; | 57 | $DESLIGACACHE = $desligacache; |
57 | } | 58 | } |
@@ -312,8 +313,7 @@ if($temas != ""){ | @@ -312,8 +313,7 @@ if($temas != ""){ | ||
312 | //ferramentas customizaveis e que seraco incluidas na propriedade do layer | 313 | //ferramentas customizaveis e que seraco incluidas na propriedade do layer |
313 | // | 314 | // |
314 | $listaFerramentas = array("tme","storymap","animagif"); | 315 | $listaFerramentas = array("tme","storymap","animagif"); |
315 | - $dadosTemas = pegaDadosAdminKey("SELECT codigo_tema,link_tema FROM __esq__i3geoadmin_temas WHERE codigo_tema IN('".implode($temas,',')."')","__esq__"); | ||
316 | - | 316 | + $dadosTemas = pegaDadosAdminKey("SELECT codigo_tema,link_tema FROM __esq__i3geoadmin_temas WHERE codigo_tema IN('".implode($temas,',')."')","__esq__"); |
317 | foreach($temas as $tema){ | 317 | foreach($temas as $tema){ |
318 | // | 318 | // |
319 | //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER | 319 | //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER |
@@ -436,7 +436,8 @@ if($temas != ""){ | @@ -436,7 +436,8 @@ if($temas != ""){ | ||
436 | $link_tema = $dadosTemas[$nomeLayer]; | 436 | $link_tema = $dadosTemas[$nomeLayer]; |
437 | $link_tema = $link_tema["link_tema"]; | 437 | $link_tema = $link_tema["link_tema"]; |
438 | $visivel = "false"; | 438 | $visivel = "false"; |
439 | - if($l->status == MS_DEFAULT || in_array($tema,$visiveis)){ | 439 | + //if($l->status == MS_DEFAULT || in_array($tema,$visiveis)){ |
440 | + if(in_array($tema,$visiveis)){ | ||
440 | $visivel = "true"; | 441 | $visivel = "true"; |
441 | } | 442 | } |
442 | if($l->type != 2 && $l->type != 3){ | 443 | if($l->type != 2 && $l->type != 3){ |
mashups/osm.php
@@ -9,19 +9,6 @@ include_once(dirname(__FILE__)."/../classesphp/sani_request.php"); | @@ -9,19 +9,6 @@ include_once(dirname(__FILE__)."/../classesphp/sani_request.php"); | ||
9 | include_once(dirname(__FILE__)."/../classesphp/carrega_ext.php"); | 9 | include_once(dirname(__FILE__)."/../classesphp/carrega_ext.php"); |
10 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); | 10 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); |
11 | error_reporting(0); | 11 | error_reporting(0); |
12 | -//cria as pastas temporarias caso nao existam | ||
13 | -if (! file_exists ( $dir_tmp )) { | ||
14 | - @mkdir ( $dir_tmp, 0744 ); | ||
15 | -} | ||
16 | -if (file_exists ( $dir_tmp )) { | ||
17 | - @mkdir ( $dir_tmp . "/comum", 0744 ); | ||
18 | - @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
19 | - chmod ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
20 | - @mkdir ( $dir_tmp . "/cache", 0744 ); | ||
21 | - chmod ( $dir_tmp . "/cache", 0744 ); | ||
22 | - @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
23 | - chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
24 | -} | ||
25 | //variaveis utilizadas | 12 | //variaveis utilizadas |
26 | $parurl = array_merge($_GET,$_POST); | 13 | $parurl = array_merge($_GET,$_POST); |
27 | $desligacache = $parurl["desligacache"]; | 14 | $desligacache = $parurl["desligacache"]; |
@@ -52,6 +39,20 @@ $ativalayerswicther = $parurl["ativalayerswicther"]; | @@ -52,6 +39,20 @@ $ativalayerswicther = $parurl["ativalayerswicther"]; | ||
52 | $ativarodadomouse = $parurl["ativarodadomouse"]; | 39 | $ativarodadomouse = $parurl["ativarodadomouse"]; |
53 | $legendahtml = $parurl["legendahtml"]; | 40 | $legendahtml = $parurl["legendahtml"]; |
54 | $nocache = $parurl["nocache"]; | 41 | $nocache = $parurl["nocache"]; |
42 | + | ||
43 | +//cria as pastas temporarias caso nao existam | ||
44 | +if (! file_exists ( $dir_tmp )) { | ||
45 | + @mkdir ( $dir_tmp, 0744 ); | ||
46 | +} | ||
47 | +if (file_exists ( $dir_tmp )) { | ||
48 | + @mkdir ( $dir_tmp . "/comum", 0744 ); | ||
49 | + @mkdir ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
50 | + chmod ( $dir_tmp . "/saiku-datasources", 0744 ); | ||
51 | + @mkdir ( $dir_tmp . "/cache", 0744 ); | ||
52 | + chmod ( $dir_tmp . "/cache", 0744 ); | ||
53 | + @mkdir ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
54 | + chmod ( $dir_tmp . "/cache/googlemaps", 0744 ); | ||
55 | +} | ||
55 | if(!empty($desligacache)){ | 56 | if(!empty($desligacache)){ |
56 | $DESLIGACACHE = $desligacache; | 57 | $DESLIGACACHE = $desligacache; |
57 | } | 58 | } |
@@ -267,6 +268,9 @@ if(isset($botoes)){ | @@ -267,6 +268,9 @@ if(isset($botoes)){ | ||
267 | if(in_array("texto",$botoes)){ | 268 | if(in_array("texto",$botoes)){ |
268 | $objBotoes[] = "'texto':true"; | 269 | $objBotoes[] = "'texto':true"; |
269 | } | 270 | } |
271 | + if(in_array("novaaba",$botoes)){ | ||
272 | + $objBotoes[] = "'novaaba':true"; | ||
273 | + } | ||
270 | $botoes = "{".implode(",",$objBotoes)."}"; | 274 | $botoes = "{".implode(",",$objBotoes)."}"; |
271 | } | 275 | } |
272 | 276 | ||
@@ -310,7 +314,6 @@ if($temas != ""){ | @@ -310,7 +314,6 @@ if($temas != ""){ | ||
310 | // | 314 | // |
311 | $listaFerramentas = array("tme","storymap","animagif"); | 315 | $listaFerramentas = array("tme","storymap","animagif"); |
312 | $dadosTemas = pegaDadosAdminKey("SELECT codigo_tema,link_tema FROM __esq__i3geoadmin_temas WHERE codigo_tema IN('".implode($temas,',')."')","__esq__"); | 316 | $dadosTemas = pegaDadosAdminKey("SELECT codigo_tema,link_tema FROM __esq__i3geoadmin_temas WHERE codigo_tema IN('".implode($temas,',')."')","__esq__"); |
313 | - | ||
314 | foreach($temas as $tema){ | 317 | foreach($temas as $tema){ |
315 | // | 318 | // |
316 | //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER | 319 | //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER |
@@ -430,7 +433,8 @@ if($temas != ""){ | @@ -430,7 +433,8 @@ if($temas != ""){ | ||
430 | $link_tema = $dadosTemas[$nomeLayer]; | 433 | $link_tema = $dadosTemas[$nomeLayer]; |
431 | $link_tema = $link_tema["link_tema"]; | 434 | $link_tema = $link_tema["link_tema"]; |
432 | $visivel = "false"; | 435 | $visivel = "false"; |
433 | - if($l->status == MS_DEFAULT || in_array($tema,$visiveis)){ | 436 | + //if($l->status == MS_DEFAULT || in_array($tema,$visiveis)){ |
437 | + if(in_array($tema,$visiveis)){ | ||
434 | $visivel = "true"; | 438 | $visivel = "true"; |
435 | } | 439 | } |
436 | if($l->type != 2 && $l->type != 3){ | 440 | if($l->type != 2 && $l->type != 3){ |
@@ -560,6 +564,7 @@ function ajuda(){ | @@ -560,6 +564,7 @@ function ajuda(){ | ||
560 | fecha | 564 | fecha |
561 | corta | 565 | corta |
562 | legenda | 566 | legenda |
567 | + novaaba | ||
563 | 568 | ||
564 | Para ver a lista de códigos de temas, que podem ser utilizados no parâmetro 'temas', acesse: | 569 | Para ver a lista de códigos de temas, que podem ser utilizados no parâmetro 'temas', acesse: |
565 | <a href='../ogc.php?lista=temas' >lista de temas</a>. Os códigos são mostrados em vermelho. | 570 | <a href='../ogc.php?lista=temas' >lista de temas</a>. Os códigos são mostrados em vermelho. |