Tags:
create new tag
view all tags
ALERT! NOTE: This is a DistributionDocument. This document is generated, please do not change it. Put questions, error notes, and suggestions concerning the documentation of this topic in the comments section below. Use the Support web for problems you are having using TWiki.

Package TWiki::Compatibility

Support for compatibility with old TWiki versions. Packaged separately because 99.999999% of the time this won't be needed.

=end

sub _upgradeCategoryItem { my ( $catitems, $ctext ) = @_; my $catname = ''; my $scatname = ''; my $catmodifier = ''; my $catvalue = ''; my @cmd = split( /\|/, $catitems ); my $src = ''; my $len = @cmd; if( $len < '2' ) { # FIXME return ( $catname, $catmodifier, $catvalue ) } my $svalue = '';

my $i; my $itemsPerLine;

# check for CategoryName=CategoryValue parameter my $paramCmd = ''; my $cvalue = ''; # was$query->param( $cmd[1] ); if( $cvalue ) { $src = "$cvalue"; } elsif( $ctext ) { foreach( split( /\r?\n/, $ctext ) ) { if( /$cmd[1]/ ) { $src = $_; last; } } }

if( $cmd[0] eq 'select' || $cmd[0] eq 'radio') { $catname = $cmd[1]; $scatname = $catname; #$scatname =~ s/[^a-zA-Z0-9]//g; my $size = $cmd[2]; for( $i = 3; $i < $len; $i++ ) { my $value = $cmd[$i]; $svalue = $value; if( $src =~ /$value/ ) { $catvalue = $svalue; } }

} 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 = 1; } $itemsPerLine = $cmd[3]; for( $i = 4; $i < $len; $i++ ) { my $value = $cmd[$i]; $svalue = $value; # I18N: FIXME - need to look at this, but since it's upgrading # old forms that probably didn't use I18N, it's not a high # priority. if( $src =~ /$value[^a-zA-Z0-9\.]/ ) { $catvalue .= ", " if( $catvalue ); $catvalue .= $svalue; } }

} elsif( $cmd[0] eq 'text' ) { $catname = $cmd[1]; $scatname = $catname; #$scatname =~ s/[^a-zA-Z0-9]//g; $src =~ /(.*)/; if( $1 ) { $src = $1; } else { $src = ''; } $catvalue = $src; }

return ( $catname, $catmodifier, $catvalue ) }

StaticMethod upgradeCategoryTable ($session,$web,$topic,$meta,$text) -> $text

Upgrade old style category table

May throw TWiki::OopsException



Comments & Questions about this Distribution Document Topic

Please use the Support forum if you have questions about TWiki features. This comment section is about the documentation of this topic.
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2006-05-01 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.