--- burst.pl 2001/05/10 07:08:50 1.15 +++ burst.pl 2001/05/11 14:17:27 1.16 @@ -143,37 +143,46 @@ # of the slidemaker tool #when the parameters were in Makefile or make.bat -# read parameters from infos.txt and put them in @PARAM -if (open(INFOS, $infos)) { - print STDERR "--- Reading parameters file $infos ---\n"; - local(@file); - @file = ; -# @PARAM = (); # don't reset param, use @ARGV +my @file; + +############################################################################## +sub parse_infos { + my @file=@_; do { if ($file[0] && $file[0] =~ /^[^#\n\r]/) { $file[0] =~ s/\n//; # remove UNIX \n $file[0] =~ s/\r//; # remove WINDOWS \r - $file[0] =~ s/ *= */=/; - push @PARAM,$file[0]; + my ($var,$value) = split(/ *= */,$file[0],2); + $value=~s/'/\\'/g; + $cmd="\$$var = \'$value\';"; + if (defined($value)) { + eval($cmd) || warn "problem with eval of: $cmd"; + } else { + die "no value defined for $var"; + } print STDERR "$file[0]\n"; } } while (shift(@file)); } -## @PARAM is now a table with the user preferences for his presentation +############################################################################## -## process arguments -## each preset variable is now re-attributed using the user preferences -foreach (@PARAM) { - my ($var,$value) = split(/ *= */,$_,2); - $value=~s/'/\\'/g; - $cmd="\$$var = \'$value\';"; - if ($value) { - eval($cmd) || die "problem with eval of: $cmd"; - } else { - die "no value defined for $var"; - } +# read parameters from infos.txt and put them in @PARAM +if (open(INFOS, $infos)) { + print STDERR "--- Reading parameters file $infos ---\n"; + @file = ; + parse_infos(@file); } +# try to read local infos.txt for template +if (-f "$template/$infos" && open(INFOS,"$template/$infos")) { + print STDERR "--- Reading template parameters file $template/$infos ---\n"; + @file = ; + parse_infos(@file); + close(INFOS); +} + +## @PARAM is now a table with the user preferences for his presentation + ## use charset if ($charset) { @@ -385,7 +394,8 @@ date => $date, - toc => $loc_toc, + toc_title => $loc_toc, + template => $template, ); } @@ -578,6 +588,7 @@ toc_link => $toc_link, next_link => $next_link, prev_title => $prev_title, + toc_title => $loc_toc, next_title => $next_title, author => $author, @@ -589,6 +600,7 @@ slide_html => $slide_html, + template => $template, ); my $page; @@ -684,7 +696,7 @@ my $pcnt_done=int($nr*100/$total); my $pcnt_left=100-$pcnt_done; - if ($progress_bar) { + if ($progress_bar && uc($progress_bar) ne "NO") { my $l=$r=" "; my $t="$nr of $total"; if ($pcnt_done > 50) {