aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-28 23:08:48 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-28 23:08:48 -0500
commit0d2894711c6aeadcee0d4f2799a0956f7beed499 (patch)
tree9593ea1fc1ca0b104065c53094acbe9ef33ab455 /IkiWiki/CGI.pm
parent29f3082772095030895111f199d6420ef1835250 (diff)
downloadikiwiki-0d2894711c6aeadcee0d4f2799a0956f7beed499.tar
ikiwiki-0d2894711c6aeadcee0d4f2799a0956f7beed499.tar.gz
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.
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 5de90e1a8..5062a448f 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -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);