#!/usr/bin/perl -w
#use strict;
use Template;
use CGI;
use Data::Dumper;
require './lemonldap-lib.pl';
my $tt = Template->new( {# ABSOLUTE => 1,
PREC_CHOMP =>1,
POST_CHOMP =>1, } );
##########################################
# chargement des infos de la page #
##########################################
if (! defined (CGI::param ("submitTtlConfig")) ) {
my $conf = &getXmlPage( "ttlconfig" );
my $filethtml = $conf->{template};
my $title = $text{ &dePourCent( $conf->{title} ) };
my $_style = CGI::param('style')||$config{Style};
my $tabular = [];
$mode = 'Expert' ;
$tabular = &getTab( $conf->{tabs}->{expert} );
$tabular = &polyGlotTab( $tabular, \%text );
$tabular = &ajustLink ($tabular,$mode,$_style);
$flipflop = 'Normal';
$tab_active = '2' ;
$styl = $config{'Style'};
my $composs = &getAllComposants( $conf->{composants}->{expert} );
$composs = &polyGlotTab( $composs, \%text );
my $xmlemon = getXML( $config{'XML_file'} );
my $chapter = getChapterXML( $xmlemon, "cache" );
&TransformVars( $composs, $chapter );
# my $dump1 = Dumper( $composs );
# my $dump2 = Dumper( $chapter );
my $valab = getRefValueInCompo( $composs, "LastModified" );
my @fk = keys( %{$chapter} );
$valab->{ isChecked } = $chapter->{ $fk[0] }->{ LastModified } ? "CHECKED" : "";
$vars= { style => $styl,
title => $title,
mode => $mode,
css => $_style,
label => $flipflop,
parent => $0,
tab_about => $tabular,
langa => \%text,
composall => $composs
};
$vars->{style} = &getStyle($styl, $vars->{checked});
print "Content-type: text/html\n";
$tt->process($filethtml,$vars) || die $tt->error();
# print("