use smarty3 as default template engine. add pluggable template system

This commit is contained in:
fabrixxm
2013-05-08 03:51:38 -04:00
parent 51c27579ba
commit 31a21ac24c
7 changed files with 178 additions and 68 deletions

21
include/plugin.php Normal file → Executable file
View File

@@ -569,24 +569,9 @@ function get_intltext_template($s) {
function get_markup_template($s, $root = '') {
$a = get_app();
$template_eng = $a->get_template_engine();
if($template_eng === 'internal') {
$template_file = theme_include($s, $root);
if($template_file)
return file_get_contents($template_file);
}
else {
$template_file = theme_include("$template_eng/$s", $root);
if($template_file) {
$template = new FriendicaSmarty();
$template->filename = $template_file;
return $template;
}
}
$t = $a->template_engine();
$template = $t->get_markup_template($s, $root);
return $template;
}