so that more than one plugin can use this hook.
I believe this is a safe change, since only passwordauth uses this hook.
(If some other plugin already used it, it would have broken passwordauth!)
buttons => $buttons);
});
}
- else {
- printheader($session);
- print misctemplate($form->title, $form->render(submit => $buttons));
- }
+
+ printheader($session);
+ print misctemplate($form->title, $form->render(submit => $buttons));
}
sub redirect ($$) { #{{{
call => \&needsbuild);
hook(type => "preprocess", id => "edittemplate",
call => \&preprocess);
- hook(type => "formbuilder_setup", id => "edittemplate",
- call => \&formbuilder_setup);
+ hook(type => "formbuilder", id => "edittemplate",
+ call => \&formbuilder);
} #}}}
sub needsbuild (@) { #{{{
$params{template}, $params{match});
} # }}}
-sub formbuilder_setup (@) { #{{{
+sub formbuilder (@) { #{{{
my %params=@_;
my $form=$params{form};
}
}
}
-
- IkiWiki::printheader($session);
- print IkiWiki::misctemplate($form->title, $form->render(submit => $buttons));
} #}}}
1
* Fix file pruning code to work if ikiwiki is run with "." as the srcdir.
* Add an edittemplate plugin, allowing registering template pages, that
provide default content for new pages created using the web frontend.
+ * Change formbuilder hook to not be responsible for displaying a form,
+ so that more than one plugin can use this hook.
+ I believe this is a safe change, since only passwordauth uses this hook.
+ (If some other plugin already used it, it would have broken passwordauth!)
-- Joey Hess <joeyh@debian.org> Mon, 03 Dec 2007 14:47:36 -0500
add/remove/change fields, tweak the validation code for the fields, etc. It
will not validate or display the form.
-Form validation and display can be overridden by the formbuilder hook.
-By default, ikiwiki will do a basic validation and display of the form,
-but if this hook is registered, it will stop that and let the hook take
-over.
+Just before a form is displayed to the user, the `formbuilder` hook is
+called. It can be used to validate the form, but should not display it.
### savestate