Файл: public_html/system/classes/template.php
Строк: 34
<?php
/**********************************
*    @package: PerfCMS              *
*    @year: 2012                      *
*    @author: Artas                  *
*    @link: http://perfcms.net     *
* ------------------------------- *
*    @package: PerfCMS Ultra          *
*    @year: 2013                      *
*   @author: wanya26ua & Tesla    *
*   @link: http://perfclub.ru     *
**********************************/
class Template {
    public $type;
    public $format = '.html';
    public $tpln = 'default';
    public $html;
    public $values = array();
    
    public function __construct() {
        // $this->type = browser_type();
        $this->type = 'wap';
    }
    public function parse($tpl_name)
        {
        global $stylen;
        if(empty($tpl_name) || !file_exists(TPL.'/themes/'.$this->type.'/'. $stylen .'/'.$tpl_name . $this->format))
            {
            return false;
            }
        else
            {
            $this->html = file_get_contents(TPL.'/themes/'.$this->type.'/'. $stylen .'/'.$tpl_name . $this->format);
            }
        }
    public function set_value($key, $var)
        {
        $key = '{'.$key.'}';
        $this->values[$key] = $var;
        }
    public function view()
        {
        foreach($this->values as $find => $replace)
            {
            $this->html = str_replace($find, $replace, $this->html);
            }
        echo @$this->html;
        }
    
    public function div($div, $content)
        {
            echo "<div class="{$div}">{$content}</div>n";
        }
    }