]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
properly support all types of data in arrays
authorJoey Hess <joey@kodama.kitenet.net>
Sun, 3 Aug 2008 18:39:34 +0000 (14:39 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 3 Aug 2008 18:39:34 +0000 (14:39 -0400)
IkiWiki/Plugin/websetup.pm

index 8ef336b036802647ef3edeff80d26b0353f850d9..d087b4863148c19797d6cd1c6f7aa38398e04c4a 100644 (file)
@@ -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,