translate_path() only needs one parameters. remove unused second one
[phpfspot.git] / phpfspot_tmpl.php
1 <?php
2
3 /***************************************************************************
4  *
5  * phpfspot, presents your F-Spot photo collection in Web browsers.
6  *
7  * Copyright (c) by Andreas Unterkircher
8  *
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
12  *  any later version.
13  *
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.
18  *
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.
22  *
23  ***************************************************************************/
24
25 /**
26  * PHPFSPOT_TMPL class
27  *
28  * Extends Smarty base class with some additional functions
29  * @package phpfspot
30  */
31 class PHPFSPOT_TMPL extends Smarty {
32
33    /**
34     * class constructor
35     */
36    public function __construct()
37    {
38       global $phpfspot;
39
40       if(!file_exists($phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates')) {
41          print "No templates found in ". $phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates';
42          exit(1);
43       }
44
45       $this->Smarty();
46       $this->template_dir = $phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates';
47       $this->compile_dir  = $phpfspot->cfg->base_path .'/templates_c';
48       $this->config_dir   = $phpfspot->cfg->base_path .'/smarty_config';
49       $this->cache_dir    = $phpfspot->cfg->base_path .'/smarty_cache';
50
51       if(isset($phpfspot->cfg->use_lightbox) && $phpfspot->cfg->use_lightbox == true)
52          $this->assign('use_lightbox', 'true');
53       if(isset($phpfspot->cfg->use_autocomplete) && $phpfspot->cfg->use_autocomplete == true)
54          $this->assign('use_autocomplete', 'true');
55
56    } // __construct()
57
58    /**
59     * show template
60     *
61     * outputs the requested template
62     * @param string $template
63     */
64    public function show($template)
65    {
66       $this->display($template);
67
68    } // show()
69
70 } // PHPFSPOT_TMPL()
71
72 ?>