Skip to content
Snippets Groups Projects
Commit a15ce62d authored by Esther Brunner's avatar Esther Brunner
Browse files

Replacement Patterns for pageTemplate()

darcs-hash:20050830194701-283c4-cee46936501b270fc8e5def2ea53ee7dbe13b7ef.gz
parent 89541d4b
No related branches found
No related tags found
No related merge requests found
......@@ -504,7 +504,17 @@ function rawWiki($id,$rev=''){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function pageTemplate($id){
return io_readFile(dirname(wikiFN($id)).'/_template.txt');
global $conf;
global $INFO;
$tpl = io_readFile(dirname(wikiFN($id)).'/_template.txt');
$tpl = str_replace('@ID@',$id,$tpl);
$tpl = str_replace('@NS@',getNS($id),$tpl);
$tpl = str_replace('@PAGE@',strtr(noNS($id),'_',' '),$tpl);
$tpl = str_replace('@USER@',$_SERVER['REMOTE_USER'],$tpl);
$tpl = str_replace('@NAME@',$INFO['userinfo']['name'],$tpl);
$tpl = str_replace('@MAIL@',$INFO['userinfo']['mail'],$tpl);
$tpl = str_replace('@DATE@',date($conf['dformat']),$tpl);
return $tpl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment