#!/Perl/5.00502/bin/MSWin32-x86-object/perl
########################################################################
# PWR: PW_Tools RootWeb
########################################################################
# PW_Tools_Ver: 1.0, April 5 16:26 2001 by Peter Wieland
########################################################################
#
# Copyright 1999, 2000, 2001 Peter Wieland.
#
# This file is part of PW_Tools.
#
# PW_Tools is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PW_Tools is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PW_Tools; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
########################################################################
# CONFIGURATION, HAS TO BE EDITED ...
########################################################################
use File::Copy;

$VERBOSE=1;     # 0 is false, 1 is true

#########################################################################
# DO NOT EDIT ABOVE THIS LINE
#########################################################################
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
    localtime(time);
$year += 1900;
$mon++;

$mytime = localtime;

$PWsign = "(<a href=\"http://www.iai.fzk.de/~wieland/PWtools/\">PW_Tools</a>)";

## 
## READ COLOR INFORMATION -----------------------------------------------
##


opendir(DIRHANDLE_E, "../PWR/Input/");
@FILE = grep(/.html$/||/.htm$/, readdir(DIRHANDLE_E));
closedir(DIRHANDLE_E);

foreach $file (@FILE) {
    print "process .. $file\n";
    
    $IndexFile="../../$file";
    open (ToFILE,"> $IndexFile") or die 
	"Can't open InputFile: $InputFile";
    
    $HeaderFile="../Input/header.html";
    $PAGE_LEVEL=".";
    open (HEADERFILE,"< $HeaderFile") or die 
	"Can't open HeaderFile: $HeaderFile";
    while ( <HEADERFILE> ){
        s/PAGE_LEVEL/$PAGE_LEVEL/g;
	print ToFILE"$_";
    }
    close (HEADERFILE);
    
    $InputFile="../PWR/Input/$file";
    open (INPUTFILE,"< $InputFile") or die 
	"Can't open InputFile: $InputFile";
    while ( <INPUTFILE> ){
	print ToFILE"$_";
    }
    close (INPUTFILE);
    print ToFILE"<hr>Generated: <b>$mytime</b> by PWR.pl $PWsign\n";
    print ToFILE"</body></html>\n";
    
    close (ToFILE);		   
    
}



