summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-07-18 19:38:42 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-07-18 19:38:42 +0200
commit7146cee21edfdc97ce25d1b5536817f301dc916b (patch)
treec64f55166fe9111c133f8385ba0f9b4769f0abbd /inc/common.php
parent87c434ceeeeb15fff4bbada53294c4dd63ecd9f6 (diff)
downloadrpg-7146cee21edfdc97ce25d1b5536817f301dc916b.tar.gz
rpg-7146cee21edfdc97ce25d1b5536817f301dc916b.tar.bz2
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
Diffstat (limited to 'inc/common.php')
-rw-r--r--inc/common.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/inc/common.php b/inc/common.php
index af0123fcd..f40c8f1fd 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -397,6 +397,16 @@ function rawWiki($id,$rev=''){
}
/**
+ * Returns the pagetemplate contents for the ID's namespace
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+function pageTemplate($id){
+ return io_readFile(dirname(wikiFN($id)).'/_template.txt');
+}
+
+
+/**
* Returns the raw Wiki Text in three slices.
*
* The range parameter needs to have the form "from-to"