3 require_once("library/Smarty/libs/Smarty.class.php");
5 class FriendicaSmarty extends Smarty {
9 function __construct() {
10 parent::__construct();
13 $theme = current_theme();
15 // setTemplateDir can be set to an array, which Smarty will parse in order.
16 // The order is thus very important here
17 $template_dirs = array('theme' => "view/theme/$theme/smarty3/");
18 if( x($a->theme_info,"extends") )
19 $template_dirs = $template_dirs + array('extends' => "view/theme/".$a->theme_info["extends"]."/smarty3/");
20 $template_dirs = $template_dirs + array('base' => 'view/smarty3/');
21 $this->setTemplateDir($template_dirs);
23 $this->setCompileDir('view/smarty3/compiled/');
24 $this->setConfigDir('view/smarty3/config/');
25 $this->setCacheDir('view/smarty3/cache/');
27 $this->left_delimiter = $a->get_template_ldelim('smarty3');
28 $this->right_delimiter = $a->get_template_rdelim('smarty3');
30 // Don't report errors so verbosely
31 $this->error_reporting = E_ALL & ~E_NOTICE;
34 function parsed($template = '') {
36 return $this->fetch('string:' . $template);
38 return $this->fetch('file:' . $this->filename);