Merge pull request #550 from fermionic/20121222-use-smarty-template-engine

only use Smarty if the view/smarty3/ directory is writable
This commit is contained in:
fermionic
2012-12-23 05:19:02 -08:00
20 changed files with 34 additions and 19 deletions
+15
View File
@@ -1946,3 +1946,18 @@ function clear_cache($basepath = "", $path = "") {
closedir($dh);
}
}
function set_template_engine(&$a, $engine = 'internal') {
$a->theme['template_engine'] = 'internal';
if(is_writable('view/smarty3/')) {
switch($engine) {
case 'smarty3':
$a->theme['template_engine'] = 'smarty3';
break;
default:
break;
}
}
}