コード例 #1
0
 /**
  * @param string $templatePath
  * @param string $compilePath (not used for this render engine)
  */
 function __construct($templatePath = '', $compilePath = '')
 {
     $this->savant = new Savant3(array('exceptions' => true));
     // normalize the path
     if (substr($templatePath, -1) != '/' && substr($templatePath, -1) != '\\') {
         $templatePath .= "/";
     }
     if ($templatePath) {
         $this->savant->setPath('template', $templatePath);
     }
 }
コード例 #2
0
ファイル: search.php プロジェクト: renztoygwapo/openlist
<?php

include 'class/includes.php';
$view = new Savant3();
$service = Service::getInstance();
$view->setPath('template', array(TPL_PATH));
if (isset($_POST['search_term']) && chkid($_POST['city_id'])) {
    //TODO avoid search if term is empty(?)
    $search_term = htmlentities(text_only(trim($_POST['search_term'])), ENT_QUOTES, CONF_ENC);
    if ($search_term == LANG_SEARCH_TEXT) {
        $search_term = '';
    } else {
        //TODO check for other criteria and if none dispaly message - no search term
    }
    $view->search_term = $search_term;
    $search_term = mb_strtoupper($search_term, CONF_ENC);
    $city_id = $_POST['city_id'];
    if (chkid($_POST['cat_id'])) {
        $cat_id = $_POST['cat_id'];
        $field_list = $service->get_searchable_field_list($cat_id);
        if (count($field_list) > 0) {
            foreach ($field_list as $key => $value) {
                switch ($value['type']) {
                    case TYPE_NUMBER:
                        if (isset($_POST[$value['name'] . TYPE_NUMBER_FROM]) && ctype_digit($_POST[$value['name'] . TYPE_NUMBER_FROM]) && $_POST[$value['name'] . TYPE_NUMBER_FROM] >= 0) {
                            $field_list[$key]['from'] = text_only($_POST[$value['name'] . TYPE_NUMBER_FROM]);
                        }
                        if (isset($_POST[$value['name'] . TYPE_NUMBER_TO]) && ctype_digit($_POST[$value['name'] . TYPE_NUMBER_TO]) && $_POST[$value['name'] . TYPE_NUMBER_TO] >= 0) {
                            $field_list[$key]['to'] = text_only($_POST[$value['name'] . TYPE_NUMBER_TO]);
                        }
                        break;
コード例 #3
0
ファイル: output.php プロジェクト: N3X15/ATBBS-Plus
	static function PrepSV3($newinstance=false)
	{
		global $User;
		$tpl=new Savant3();
		if(self::$theme_override)
			$tpl->setPath('template',THISDIR.'/_templates/'.self::$theme_override.'/');
		else if(!empty($User->Theme))
			$tpl->setPath('template',THISDIR.'/_templates/'.$User->Theme.'/');
		else
			$tpl->setPath('template',THISDIR.'/_templates/'.THEME.'/');
		
		
		if($newinstance)
		{
			return $tpl;
		}
		
		self::$tpl=$tpl;
		
	}