=================================================================== RCS file: lib/TWiki/Plugins/VotePlugin/Core.pm,v retrieving revision 1.1 diff -u -r1.1 lib/TWiki/Plugins/VotePlugin/Core.pm --- lib/TWiki/Plugins/VotePlugin/Core.pm 2006/12/14 11:15:04 1.1 +++ lib/TWiki/Plugins/VotePlugin/Core.pm 2006/12/14 18:19:32 @@ -31,6 +31,20 @@ } ############################################################################### +# Stole this from TWiki.pm. Should be in Func.pm +sub isTrue { + my( $value, $default ) = @_; + + $default ||= 0; + + return $default unless defined( $value ); + + $value =~ s/^\s*(.*?)\s*$/$1/gi; + $value =~ s/off//gi; + $value =~ s/no//gi; + return ( $value ) ? 1 : 0; +} + sub handleVote { my ($web, $topic, $args) = @_; @@ -43,6 +57,8 @@ my $theColor = &TWiki::Func::extractNameValuePair($args, 'color') || ''; my $theBgColor = &TWiki::Func::extractNameValuePair($args, 'bgcolor') || ''; my $theLimit = &TWiki::Func::extractNameValuePair($args, 'limit') || '-1'; + my $theFreq = &TWiki::Func::extractNameValuePair($args, 'freq') || 'once'; + my $isAnon = isTrue(&TWiki::Func::extractNameValuePair($args, 'anon') || 'on'); my @theSelects = (); my @theOptions = (); @@ -85,6 +101,8 @@ $result .= "