]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/attachment.pm
websetup form display done
[ikiwiki.git] / IkiWiki / Plugin / attachment.pm
index b6327f0c5455fdfe1a622e0e26f36663653357da..27f984c299870b112600b054b7ab0062b3e44612 100644 (file)
@@ -22,7 +22,7 @@ sub getsetup () { #{{{
                        rebuild => 0,
                },
                allowed_attachments => {
-                       type => "string",
+                       type => "pagespec",
                        example => "mimetype(image/*) and maxsize(50kb)",
                        description => "enhanced PageSpec specifying what attachments are allowed",
                        description_html => htmllink("", "", 
@@ -143,6 +143,9 @@ sub formbuilder_setup (@) { #{{{
                                IkiWiki::userinfo_set($user_name, "allowed_attachments",
                                $form->field("allowed_attachments")) ||
                                        error("failed to set allowed_attachments");
+                               if (length $form->field("allowed_attachments")) {
+                                       $form->field(name => "allowed_attachments", type => "hidden");
+                               }
                        }
                }
        }