issue15, for now disable the show_tags-checks because it blocks the get_random_tag_ph...
[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     * PHPFSPOT_TMPL constructor
35     * @access public
36     */
37    public function __construct()
38    {
39       global $phpfspot;
40
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';
43          exit(1);
44       }
45
46       $this->Smarty();
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';
51
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');
56
57    } // __construct()
58
59    /**
60     * show template
61     *
62     * outputs the requested template
63     * @param string $template
64     */
65    public function show($template)
66    {
67       $this->display($template);
68
69    } // show()
70
71 } // PHPFSPOT_TMPL()
72
73 ?>