2 class Trackback_Template {
5 function Trackback_Template($file = null, $prefix = '') {
6 $this->file = ($prefix ? $prefix . '/' : '') . $file;
7 $this->prefix = $prefix;
10 function set($name, $value) {
11 $this->vars[$name] = is_object($value) ? $value->fetch() : $value;
14 function template($file = null) {
15 $language = ereg_replace( '[\\|/]', '', getLanguageName());
16 $this->file = (file_exists(($this->prefix ? $this->prefix . '/' : '') . $language.'.'.$file))? ($this->prefix ? $this->prefix . '/' : '') . $language.'.'.$file: ($this->prefix ? $this->prefix . '/' : '') . $file;
19 function fetch($file = null) {
20 if(!$file) $file = $this->file;
21 else ($prefix ? $prefix . '/' : '') . $file;
25 if (is_array($this->vars)) extract($this->vars);
29 $contents = ob_get_contents();