From 4774ace4a7dab1f31330d1eb0468fa81e39a3f9c Mon Sep 17 00:00:00 2001 From: Simon DELAGE Date: Sat, 6 Sep 2014 20:39:56 +0200 Subject: [PATCH] Improved template one more step Localized "Private Namespace" and "Public Page" strings --- action.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.php b/action.php index 56bdddf..723a0f1 100644 --- a/action.php +++ b/action.php @@ -140,7 +140,9 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{ } function _template_private() { global $INFO; + global $lang; $content = io_readFile($this->private_page_template, false); + $content = str_replace('@PRIVATENAMESPACE@',$this->getLang('privatenamespace'),$content); // Improved template process to use any replacement patterns from https://www.dokuwiki.org/namespace_templates // Code by Christian Nancy // Build a fake data structure for the parser @@ -151,11 +153,13 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{ } function _template_public() { global $INFO; + global $lang; $content = io_readFile($this->public_page_template, false); + $content = str_replace('@PUBLICPAGE@',$this->getLang('publicpage'),$content); // Improved template process to use any replacement patterns from https://www.dokuwiki.org/namespace_templates // Code by Christian Nancy // Build a fake data structure for the parser - $data = array('tpl' => $content, 'id' => $this->public_page); + $data = array('tpl' => $content, 'id' => $this->private_page); // Use the built-in parser $content = parsePageTemplate($data); return $content;