diff options
author | Jon Dowland <jon@alcopop.org> | 2009-05-16 13:56:25 +0100 |
---|---|---|
committer | Jon Dowland <jon@alcopop.org> | 2009-05-16 13:56:25 +0100 |
commit | 30248df40a19dc03c0d8c07e136105f3c2299191 (patch) | |
tree | 747688c37a672d4265b220149426212ca0f7a702 /IkiWiki/Plugin | |
parent | 36b1aa8af357e3f987ff6a4b350665297d663a76 (diff) | |
download | ikiwiki-30248df40a19dc03c0d8c07e136105f3c2299191.tar ikiwiki-30248df40a19dc03c0d8c07e136105f3c2299191.tar.gz |
check for longname for each syntax plugin
We build an array of [ plugin name, long name ] pairs, where long name
is an optional argument to hook(). So, a syntax plugin could define
long "friendly" name, such as "Markdown" instead of mdwn, and we would
then pass this array to formbuilder to populate the drop-down on the
edit page.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/editpage.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 0068a6b11..eb6a7bbcb 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -276,8 +276,14 @@ sub cgi_editpage ($$) { my @page_types; if (exists $hooks{htmlize}) { - @page_types=grep { !/^_/ } - keys %{$hooks{htmlize}}; + foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) { + my $pluginref = ${$hooks{htmlize}}{$key}; + if(${$pluginref}{'longname'}) { + push @page_types, [$key, ${$pluginref}{'longname'}]; + } else { + push @page_types, [$key, $key]; + } + } } $form->tmpl_param("page_select", 1); |