diff --git a/classesphp/graficos.php b/classesphp/graficos.php index 90dbe25..18eb6f6 100644 --- a/classesphp/graficos.php +++ b/classesphp/graficos.php @@ -495,8 +495,13 @@ function dadosLinhaDoTempo($map_file,$tema,$ext="") $itemlink = $layer->getmetadata("ltempoitemlink"); $itens[] = $itemlink; } + $converteE = "sim"; + if($layer->getmetadata("ltempoconvencode") != ""){ + $converteE = $layer->getmetadata("ltempoconvencode"); + } $dados = pegaValoresM($map,$layer,$itens,$exclui,$selecionados,true,true); $eventos = array(); + $anos = array(); foreach($dados as $dado){ if($itemi == "") {$image = '';} @@ -512,7 +517,7 @@ function dadosLinhaDoTempo($map_file,$tema,$ext="") else {$link = $dado[$link];} $titulo = $dado[$itemtitulo]; $desc = $dado[$itemdescricao]; - if (function_exists("mb_convert_encoding")){ + if(function_exists("mb_convert_encoding") && $converteE == "sim"){ $titulo = mb_convert_encoding($titulo,"UTF-8","ISO-8859-1"); $desc = mb_convert_encoding($desc,"UTF-8","ISO-8859-1"); } @@ -526,6 +531,8 @@ function dadosLinhaDoTempo($map_file,$tema,$ext="") 'image'=>$image, 'link'=>$link ); + $anos[] = $fim; + $anos[] = $dado[$iteminicio]; } } //echo "
";
@@ -533,7 +540,9 @@ function dadosLinhaDoTempo($map_file,$tema,$ext="")
 		"dateTimeFormat"=>$layer->getmetadata("ltempoformatodata"),
 		"wikiURL"=>"",
 		"wikiSection"=>"",		
-		"events"=>$eventos
+		"events"=>$eventos,
+		"menorano"=>min($anos),
+		"maiorano"=>max($anos)
 	);
 }
 //
diff --git a/ferramentas/linhadotempo/index.php b/ferramentas/linhadotempo/index.php
index 1e2f952..9ea3a6f 100644
--- a/ferramentas/linhadotempo/index.php
+++ b/ferramentas/linhadotempo/index.php
@@ -173,7 +173,8 @@ function carregaDados(){
 		$i("totaleventos").innerHTML = retorno.data.events.length+" eventos";
 		tl = Timeline.create(tl_el, bandInfos, Timeline.HORIZONTAL);
 		eventSource1.loadJSON(retorno.data, '.'); // The data was stored into the 
-		tl.layout(); // display the Timeline	
+		tl.layout(); // display the Timeline
+		tl.getBand(0).scrollToCenter(Timeline.DateTime.parseGregorianDateTime(retorno.data.maiorano));		
 	}
 	var p = window.parent.i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=dadosLinhaDoTempo&g_sid="+window.parent.i3GEO.configura.sid+"&tema="+$i("tema").value+"&ext="+window.parent.i3GEO.parametros.mapexten;
 	cpJSON.call(p,"void",retorna);
--
libgit2 0.21.2