-} #}}}
-
-sub formbuilder_setup (@) { #{{{
- my %params=@_;
-
- my $form=$params{form};
- if ($form->title eq "preferences") {
- my $session=$params{session};
- my $cgi=$params{cgi};
- my $user_name=$session->param("name");
-
- $form->field(name => "locked_pages", size => 50,
- fieldset => "admin",
- comment => "(".htmllink("", "", "ikiwiki/PageSpec", noimageinline => 1).")");
- if (! IkiWiki::is_admin($user_name)) {
- $form->field(name => "locked_pages", type => "hidden");
- }
- if (! $form->submitted) {
- $form->field(name => "locked_pages", force => 1,
- value => IkiWiki::userinfo_get($user_name, "locked_pages"));
- }
- if ($form->submitted && $form->submitted eq 'Save Preferences') {
- if (defined $form->field("locked_pages")) {
- IkiWiki::userinfo_set($user_name, "locked_pages",
- $form->field("locked_pages")) ||
- error("failed to set locked_pages");
- }
- }
- }
-} #}}}