diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2013-05-08 03:51:38 -0400 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2013-05-08 03:51:38 -0400 |
commit | 31a21ac24cd5cbe19e40ab3838fcc179d812da13 (patch) | |
tree | d556822e261cb2b8ff10452a7c5b07b0c2c793c7 /include/template_processor.php | |
parent | 51c27579ba79d32c26052c0d1f1218a16315234b (diff) | |
download | volse-hubzilla-31a21ac24cd5cbe19e40ab3838fcc179d812da13.tar.gz volse-hubzilla-31a21ac24cd5cbe19e40ab3838fcc179d812da13.tar.bz2 volse-hubzilla-31a21ac24cd5cbe19e40ab3838fcc179d812da13.zip |
use smarty3 as default template engine. add pluggable template system
Diffstat (limited to 'include/template_processor.php')
-rwxr-xr-x[-rw-r--r--] | include/template_processor.php | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/include/template_processor.php b/include/template_processor.php index 0b4b4142f..794155f84 100644..100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -1,7 +1,11 @@ -<?php /** @file */ +<?php + require_once 'include/ITemplateEngine.php'; + define ("KEY_NOT_EXISTS", '^R_key_not_Exists^'); - class Template { + class Template implements ITemplateEngine { + static $name ="internal"; + var $r; var $search; var $replace; @@ -245,8 +249,8 @@ return $s; } - public function replace($s, $r) { - $t1 = dba_timer(); + // TemplateEngine interface + public function replace_macros($s, $r) { $this->r = $r; $s = $this->_build_nodes($s); @@ -265,14 +269,19 @@ $os=$s; $count++; $s = $this->var_replace($s); } - $t3 = dba_timer(); -// logger('macro timer: ' . sprintf('%01.4f %01.4f',$t3 - $t2, $t2 - $t1)); - return $s; } + + public function get_markup_template($file, $root='') { + $template_file = theme_include($file, $root); + $template_file = ""; + if ($template_file) { + $content = file_get_contents($template_file); + } + return $content; + } } - $t = new Template; |