diff options
author | intrigeri <intrigeri@boum.org> | 2009-01-02 12:15:21 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2009-01-02 12:15:21 +0100 |
commit | 0f89ef0579f2bbc385c78a4c22a2a9c44d99396a (patch) | |
tree | df2bf2f94591d6da07e7487c2b73ec836b0689c4 | |
parent | f0e2ce4360a029f53ede032416acb311060aa79b (diff) |
po: test formbuilder_setup hook to warn about new master page's language
Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r-- | IkiWiki/Plugin/po.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 48c3c37e6..2f43c4983 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -43,6 +43,7 @@ sub import { hook(type => "canremove", id => "po", call => \&canremove); hook(type => "canrename", id => "po", call => \&canrename); hook(type => "editcontent", id => "po", call => \&editcontent); + hook(type => "formbuilder_setup", id => "po", call => \&formbuilder_setup); $origsubs{'bestlink'}=\&IkiWiki::bestlink; inject(name => "IkiWiki::bestlink", call => \&mybestlink); @@ -439,6 +440,20 @@ sub editcontent () { return $params{content}; } +sub formbuilder_setup (@) { + my %params=@_; + my $form=$params{form}; + my $q=$params{cgi}; + + return unless (defined $form->field("do") && $form->field("do") eq "create"); + + $form->tmpl_param( + message => sprintf( + gettext('**WARNING: this page must be written in %s**'), + $config{po_master_language}{name}) + ); +} + # ,---- # | Injected functions |