#!/usr/bin/perl -wT -I.
#
# TWiki WikiClone (see $wikiversion in wiki.pm for version)
#
# 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@takefive.com ,
# TakeFive Software Inc.
#
# 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;
&main();
sub buildCategoryItem
{
my ( $catitems, $ctext ) = @_;
my $catname = "", $scatname = "", $catmodifier = "", $catvalue = "";
my @cmd = split( /\|/, $catitems );
my $src = "";
my $len = @cmd;
if( $len < "2" ) {
return ( $catname, $catmodifier, $catvalue )
}
# check for CategoryName=CategoryValue parameter
my $cvalue = $query->param( $cmd[1] );
if( $cvalue ) {
$src = "$cvalue";
} elsif( $ctext ) {
foreach( split( /\n/, $ctext ) ) {
if( /$cmd[1]/ ) {
$src = $_;
last;
}
}
}
if( $cmd[0] eq "select" ) {
$catname = $cmd[1];
$scatname = $catname;
$scatname =~ s/[^a-zA-z0-9]//g;
my $size = $cmd[2];
$catvalue = "";
} elsif( $cmd[0] eq "checkbox" ) {
$catname = $cmd[1];
$scatname = $catname;
$scatname =~ s/[^a-zA-z0-9]//g;
if( $cmd[2] eq "true" || $cmd[2] eq "1" ) {
$i = $len - 4;
$catmodifier = "$catmodifier\n ";
$catmodifier = "$catmodifier\n ";
}
$itemsPerLine = $cmd[3];
$catvalue = "\n