3 ($#ARGV >= 2) or die "Usage: index_php.pl <input-php.in-file> <input-html-file> <output-php-file>";
6 my($level,$label,$name);
16 while(defined($line=<FILE>)) {
17 if($line =~/<div id=".*" class="tabs">/) {
19 while(defined($line=<FILE>) && !($line =~/<\/div>/)) {
20 $line =~ s/ class="current"//g;
24 #$onglets.="<center></center><p><br>\n"
26 if($line =~/<!-- ______BODY_BEGIN______ --!>(.*)$/) {
28 if($tmp =~/(.*)<!-- ______BODY_END______ --!>/) {
32 while(defined($line=<FILE>) && !($line =~/<!-- ______BODY_END______ --!>/)) {
35 $line =~/^(.*)<!-- ______BODY_END______ --!>/;
42 # (?!http) : A zero-width negative look-ahead assertion.
43 # For example "/foo(?!bar)/" matches any occurrence of "foo" that isn’t followed by "bar".
45 $onglets =~ s/href=\"(?!http)/href=\"doc\//gi;
46 $onglets =~ s/src=\"(?!http)/src=\"doc\//gi;
48 $body =~ s/href=\"(?!http)/href=\"doc\//gi;
49 $body =~ s/src=\"(?!http)/src=\"doc\//gi;
52 open OUTPUT,"> $output";
54 while(defined($line=<FILE>)) {
56 if($line =~/______ONGLETS______/) {
57 $onglets =~ s/<li><a href=\"http:\/\/simgrid/<li class=\"current\"><a href=\"http:\/\/simgrid/g;
58 $line =~ s/______ONGLETS______/$onglets/g;
59 } elsif($line =~/______BODY______/) {
60 $line =~ s/______BODY______/$body/g;
62 print OUTPUT "$line\n";