Skip to content

Commit

Permalink
Item12035: Convert to using (TWiki-compatible) NeedsQuery interface; …
Browse files Browse the repository at this point in the history
…remove private GROUP interface from Valuer.

git-svn-id: http://svn.foswiki.org/trunk@16215 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
TimotheLitt authored and TimotheLitt committed Dec 14, 2012
1 parent 1d6ac2e commit c10b04a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
23 changes: 21 additions & 2 deletions core/lib/Foswiki/Configure/Types/BOOLGROUP.pm
Expand Up @@ -8,6 +8,23 @@ use warnings;
use Foswiki::Configure::Type ();
our @ISA = ('Foswiki::Configure::Type');

sub new {
my ( $class, $id ) = @_;

# Make Valuer.pm call string2value with query and item keys
# This allows retrieval of the multiple values.

my $self = bless(
{
name => $id,
NeedsQuery => 1,
},
$class
);

return $self;
}

sub prompt {
my ( $this, $id, $opts, $value, $class ) = @_;

Expand Down Expand Up @@ -38,9 +55,11 @@ sub prompt {
}

sub string2value {
my ( $this, @vals ) = @_;
my ( $this, $query, $keys ) = @_;

my @values = $query->param($keys);

my $flat = join( ',', @vals );
my $flat = join( ',', @values );
return $flat;
}

Expand Down
6 changes: 1 addition & 5 deletions core/lib/Foswiki/Configure/Valuer.pm
Expand Up @@ -124,11 +124,7 @@ sub loadCGIParams {
undef $newval;
}
else {
if ( $typename =~ m/GROUP/ ) {
my @values = $query->param($keys);
$newval = $type->string2value(@values);
}
elsif ( $type->{NeedsQuery} ) {
if ( $type->{NeedsQuery} ) {
$newval = $type->string2value( $query, $keys );
}
else {
Expand Down

0 comments on commit c10b04a

Please sign in to comment.