#!perl # # TWiki WikiClone (see $wikiversion in wiki.pm for version) # # Copyright (C) 1999 Peter Thoeny, peter.thoeny@ibm.net # # This program 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. # # This program 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, published at # http://www.gnu.ai.mit.edu/copyleft/gpl.html use CGI; use wiki; $query = new CGI; ##### for debug only: Remove next 3 comments (but redirect does not work) #open(STDERR,'>&STDOUT'); # redirect error to browser #$| = 1; # no buffering #print "Content-type: text/html\n\n"; #print "Hello there"; &main(); sub main { # get all parameters from the form my @paramNames = $query->param(); @formDataName = (); @formDataValue = (); @formDataRequired = (); my $name = ""; my $value = ""; my $topicName = ""; # the name of the template page my $wikiName = ""; # the new pages' name foreach( @paramNames ) { # print "$_"; $name = $_; # $name =~ s/([a-z0-9])([A-Z0-9])/$1 $2/go; $value = $query->param( "$name" ); # $formDataRequired[@formDataRequired] = $2; print "($name = $value)"; $formDataName[@formDataName] = $name; $formDataValue[@formDataValue] = $value; if( $name eq "NewPageName" ) { $wikiName = $value; } elsif( $name eq "TemplateTopic" ) { $topicName = $value; } } print "