- comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")",
- value => getsubscriptions($session->param("name")));
-}
-
-sub formbuilder (@) {
- my %params=@_;
- my $form=$params{form};
- return unless $form->title eq "preferences" &&
- $form->submitted eq "Save Preferences" && $form->validate &&
- defined $form->field("subscriptions");
- setsubscriptions($form->field('name'), $form->field('subscriptions'));
+ comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")");
+ if (! $form->submitted) {
+ $form->field(name => "subscriptions", force => 1,
+ value => getsubscriptions($username));
+ }
+ elsif ($form->submitted eq "Save Preferences" && $form->validate &&
+ defined $form->field("subscriptions")) {
+ setsubscriptions($username, $form->field('subscriptions'));
+ }