3 /***************************************************************************
5 * phpfspot, presents your F-Spot photo collection in Web browsers.
7 * Copyright (c) by Andreas Unterkircher
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 ***************************************************************************/
28 * Extends Smarty base class with some additional functions
31 class PHPFSPOT_TMPL extends Smarty {
34 * PHPFSPOT_TMPL constructor
37 public function __construct()
41 if(!file_exists($phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates')) {
42 print "No templates found in ". $phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates';
47 $this->template_dir = $phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates';
48 $this->compile_dir = $phpfspot->cfg->base_path .'/templates_c';
49 $this->config_dir = $phpfspot->cfg->base_path .'/smarty_config';
50 $this->cache_dir = $phpfspot->cfg->base_path .'/smarty_cache';
52 if(isset($phpfspot->cfg->use_lightbox) && $phpfspot->cfg->use_lightbox == true)
53 $this->assign('use_lightbox', 'true');
54 if(isset($phpfspot->cfg->use_autocomplete) && $phpfspot->cfg->use_autocomplete == true)
55 $this->assign('use_autocomplete', 'true');
62 * outputs the requested template
63 * @param string $template
65 public function show($template)
67 $this->display($template);