support for internal-use page types

If a page type starts with an underscore, hide it from the list of page types
in the edit form, and don't allow editing pages of that type. This allows
for plugins to add page types for internal use.
master
Joey Hess 2008-01-28 23:08:48 -05:00
parent 29f3082772
commit 0d2894711c
1 changed files with 3 additions and 2 deletions

View File

@ -341,7 +341,7 @@ sub cgi_editpage ($$) { #{{{
if (exists $pagesources{$page} && $form->field("do") ne "create") {
$file=$pagesources{$page};
$type=pagetype($file);
if (! defined $type) {
if (! defined $type || $type=~/^_/) {
error(sprintf(gettext("%s is not an editable page"), $page));
}
if (! $form->submitted) {
@ -470,7 +470,8 @@ sub cgi_editpage ($$) { #{{{
my @page_types;
if (exists $hooks{htmlize}) {
@page_types=keys %{$hooks{htmlize}};
@page_types=grep { !/^_/ }
keys %{$hooks{htmlize}};
}
$form->tmpl_param("page_select", 1);