1 rizwank 1.1 #!/usr/bin/perl -wT
2 #
3 # TWiki Collaboration Platform, http://TWiki.org/
4 #
5 # Copyright (C) 1999-2004 Peter Thoeny, peter@thoeny.com
6 #
7 # Based on parts of Ward Cunninghams original Wiki and JosWiki.
8 # Copyright (C) 1998 Markus Peter - SPiN GmbH (warpi@spin.de)
9 # Some changes by Dave Harris (drh@bhresearch.co.uk) incorporated
10 #
11 # For licensing info read license.txt file in the TWiki root.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License
14 # as published by the Free Software Foundation; either version 2
15 # of the License, or (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details, published at
21 # http://www.gnu.org/copyleft/gpl.html
22 rizwank 1.1
23 # A thought on design. Information is passed to the preview script via various form variables.
24 # Much of the meta data could have been passed by an extra hidden field, instead individual items such
25 # as parent information is passed by individual form variables, hopefully giving a clear "API".
26
27 BEGIN {
28 # Set default current working directory
29 if( $ENV{"SCRIPT_FILENAME"} && $ENV{"SCRIPT_FILENAME"} =~ /^(.+)\/[^\/]+$/ ) {
30 chdir $1;
31 }
32 # Set library paths in @INC at compile time
33 unshift @INC, '.';
34 require 'setlib.cfg';
35 }
36
37 use strict;
38 use CGI::Carp qw(fatalsToBrowser);
39 use CGI;
40 use TWiki::UI::Edit;
41
42 my $query = new CGI;
43 rizwank 1.1
44 my $thePathInfo = $query->path_info();
45 my $theRemoteUser = $query->remote_user();
46 my $theUrl = $query->url;
47 my $theTopic = $query->param( 'topic' ) || "";
48
49 my( $topic, $webName, $dummy, $userName ) =
50 TWiki::initialize( $thePathInfo, $theRemoteUser, $theTopic,
51 $theUrl, $query );
52 $dummy = ""; # to suppress warning
53
54 TWiki::UI::Edit::edit( $webName, $topic, $userName, $query );
55
|