#!/usr/bin/perl -wI. # # TWiki WikiClone (see wiki.pm for $wikiversion and other info) # # Based on parts of Ward Cunninghams original Wiki and JosWiki. # Copyright (C) 1998 Markus Peter - SPiN GmbH (warpi@spin.de) # Some changes by Dave Harris (drh@bhresearch.co.uk) incorporated # Copyright (C) 1999 Peter Thoeny, peter@thoeny.com # Additional mess by Patrick Ohl - Biomax Bioinformatics AG # January 2003 # # 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.org/copyleft/gpl.html use CGI::Carp qw( fatalsToBrowser ); use CGI; use lib ( '.' ); use lib ( '../lib' ); use TWiki; use IO::File; use POSIX qw(tmpnam); use strict; my $tmpFile; # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Please define your paths here # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # local path to your twiki data my $localWebDir = "/usr/local/apache2/twiki/"; # web URL of your twiki instalation my $webDirUrl = "https://ike.nzqa.solnet.co.nz/twiki/"; # specify path to htmldoc my $htmldocCmd = "/usr/local/bin/htmldoc"; &main(); sub main { my $query = new CGI; # # Create temporary file: # my $fh; do{ $tmpFile = tmpnam() } until $fh = IO::File->new("$tmpFile.html", O_RDWR|O_CREAT|O_EXCL); # # fill temporary file: # # run the view stuff if( $query->param( 'skin') eq 'pdf'){ $query->param( 'skin','plain'); } my ( $htmlData, $theTopic ) = doView( $query ); # # do some html processing # $htmlData = transformHTMLData($htmlData); # do special 'custom' processing? if( $query->param( 'special' ) ){ $htmlData = projectTransform($htmlData); } if( $query->param( 'shiftHeaders') ){ $htmlData = shiftHeaders($htmlData); } # htmldoc does not correctly support sgml comments # so we filter them here: $htmlData =~ s&&&gs; # htmldoc failes if there is no