From 7146cee21edfdc97ce25d1b5536817f301dc916b Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 18 Jul 2005 19:38:42 +0200 Subject: pagetemplate support #104 This adds very simple pagetemplate support. When a file named _template.txt exists in a namespace this file's contents are loaded into the editor when a new page is added in the namespace. Please note that this file is not editable from within the Wiki as it starts with an underscore. The wiki admin has to create it her self on the filesystem. darcs-hash:20050718173842-7ad00-39b1b76bef4c6243fc00d94673793d68b356aecb.gz --- inc/common.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index af0123fcd..f40c8f1fd 100644 --- a/inc/common.php +++ b/inc/common.php @@ -396,6 +396,16 @@ function rawWiki($id,$rev=''){ return io_readFile(wikiFN($id,$rev)); } +/** + * Returns the pagetemplate contents for the ID's namespace + * + * @author Andreas Gohr + */ +function pageTemplate($id){ + return io_readFile(dirname(wikiFN($id)).'/_template.txt'); +} + + /** * Returns the raw Wiki Text in three slices. * -- cgit v1.2.3