00001 <?php 00002 /* $Id: template.php,v 1.3 2003/09/21 10:33:12 mikko Exp $ */ 00003 /* 00004 * ImaComm - a web based photo album software 00005 * Copyright (C) 2003, Mikko Kokkonen 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or (at 00010 * your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 */ 00021 $__dir = realpath(dirname(__FILE__)."/../"); 00022 require_once "$__dir/Smarty-2.5.0/libs/Smarty.class.php"; 00023 00024 class ThemeEngine 00025 { 00026 var $smarty; 00027 var $template; 00028 00029 function ThemeEngine($tpl, $theme) 00030 { 00031 $this->smarty = new Smarty(); 00032 $this->template = "$theme/templates/$tpl"; 00033 } 00034 00035 function assign($vars) 00036 { 00037 if (is_array($vars)) 00038 { 00039 $this->smarty->assign($vars); 00040 } 00041 } 00042 00043 function render() 00044 { 00045 $this->smarty->display($this->template); 00046 } 00047 } 00048 ?>
1.3