diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-08-03 14:39:34 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-08-03 14:39:34 -0400 |
commit | d00f3edf13ae77aa52cf6f7cd335f6e531cda3c0 (patch) | |
tree | 6571807d944bf1a1d9fc6e4211092aa8303876b3 | |
parent | 0f06504422792d7132b7644caf4dabf19d957659 (diff) |
properly support all types of data in arrays
-rw-r--r-- | IkiWiki/Plugin/websetup.pm | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 8ef336b03..d087b4863 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -111,21 +111,14 @@ sub showfields ($$$@) { #{{{ } my $value=$config{$key}; + if (ref $config{$key} eq 'ARRAY' || ref $info{example} eq 'ARRAY') { + push @{$value}, "", ""; # blank items for expansion + } + # multiple plugins can have the same field my $name=defined $plugin ? $plugin.".".$key : $key; - if (ref $config{$key} eq 'ARRAY' || ref $info{example} eq 'ARRAY') { - $form->field( - name => $name, - label => $description, - comment => formatexample($info{example}, $value), - type => "text", - value => [ref $value eq 'ARRAY' ? @{$value} : "", , "", ""], - size => 60, - fieldset => $section, - ); - } - elsif ($info{type} eq "string") { + if ($info{type} eq "string") { $form->field( name => $name, label => $description, |