root / phpfspot_tmpl.php
View | Annotate | Download (2.3 KB)
| 1 | 61f2970e | Andreas | <?php |
|---|---|---|---|
| 2 | 61f2970e | Andreas | |
| 3 | 6e2d319e | Andreas | /***************************************************************************
|
| 4 | 6e2d319e | Andreas | * |
| 5 | 7617d447 | Andreas | * phpfspot, presents your F-Spot photo collection in Web browsers. |
| 6 | 7617d447 | Andreas | * |
| 7 | 7617d447 | Andreas | * Copyright (c) by Andreas Unterkircher |
| 8 | 6e2d319e | Andreas | * |
| 9 | 6e2d319e | Andreas | * This program is free software; you can redistribute it and/or modify |
| 10 | 6e2d319e | Andreas | * it under the terms of the GNU General Public License as published by |
| 11 | 6e2d319e | Andreas | * the Free Software Foundation; either version 2 of the License, or |
| 12 | 6e2d319e | Andreas | * any later version. |
| 13 | 6e2d319e | Andreas | * |
| 14 | 6e2d319e | Andreas | * This program is distributed in the hope that it will be useful, |
| 15 | 6e2d319e | Andreas | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | 6e2d319e | Andreas | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | 6e2d319e | Andreas | * GNU General Public License for more details. |
| 18 | 6e2d319e | Andreas | * |
| 19 | 6e2d319e | Andreas | * You should have received a copy of the GNU General Public License |
| 20 | 6e2d319e | Andreas | * along with this program; if not, write to the Free Software |
| 21 | 6e2d319e | Andreas | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | 6e2d319e | Andreas | * |
| 23 | 6e2d319e | Andreas | ***************************************************************************/ |
| 24 | 6e2d319e | Andreas | |
| 25 | 7688cbcd | Andreas | /**
|
| 26 | 7688cbcd | Andreas | * PHPFSPOT_TMPL class |
| 27 | 7688cbcd | Andreas | * |
| 28 | 7688cbcd | Andreas | * Extends Smarty base class with some additional functions |
| 29 | 7688cbcd | Andreas | * @package phpfspot |
| 30 | 7688cbcd | Andreas | */ |
| 31 | 61f2970e | Andreas | class PHPFSPOT_TMPL extends Smarty { |
| 32 | 61f2970e | Andreas | |
| 33 | 7688cbcd | Andreas | /**
|
| 34 | b583a04e | Andreas | * PHPFSPOT_TMPL constructor |
| 35 | b583a04e | Andreas | * @access public |
| 36 | 7688cbcd | Andreas | */ |
| 37 | ae99d62d | Andreas | public function __construct() |
| 38 | 61f2970e | Andreas | {
|
| 39 | ae99d62d | Andreas | global $phpfspot;
|
| 40 | ae99d62d | Andreas | |
| 41 | ae99d62d | Andreas | if(!file_exists($phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates')) { |
| 42 | ae99d62d | Andreas | print "No templates found in ". $phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates'; |
| 43 | 75a329ec | Andreas | exit(1); |
| 44 | 75a329ec | Andreas | } |
| 45 | 75a329ec | Andreas | |
| 46 | 61f2970e | Andreas | $this->Smarty();
|
| 47 | ae99d62d | Andreas | $this->template_dir = $phpfspot->cfg->base_path .'/themes/'. $phpfspot->cfg->theme_name .'/templates'; |
| 48 | ae99d62d | Andreas | $this->compile_dir = $phpfspot->cfg->base_path .'/templates_c'; |
| 49 | ae99d62d | Andreas | $this->config_dir = $phpfspot->cfg->base_path .'/smarty_config'; |
| 50 | ae99d62d | Andreas | $this->cache_dir = $phpfspot->cfg->base_path .'/smarty_cache'; |
| 51 | 61f2970e | Andreas | |
| 52 | ae99d62d | Andreas | if(isset($phpfspot->cfg->use_lightbox) && $phpfspot->cfg->use_lightbox == true) |
| 53 | 2b589908 | Andreas | $this->assign('use_lightbox', 'true'); |
| 54 | ae99d62d | Andreas | if(isset($phpfspot->cfg->use_autocomplete) && $phpfspot->cfg->use_autocomplete == true) |
| 55 | c3342635 | Andreas | $this->assign('use_autocomplete', 'true'); |
| 56 | 33c1f8bc | Andreas | |
| 57 | 61f2970e | Andreas | } // __construct()
|
| 58 | 61f2970e | Andreas | |
| 59 | 7688cbcd | Andreas | /**
|
| 60 | 7688cbcd | Andreas | * show template |
| 61 | 7688cbcd | Andreas | * |
| 62 | 7688cbcd | Andreas | * outputs the requested template |
| 63 | 7688cbcd | Andreas | * @param string $template |
| 64 | 7688cbcd | Andreas | */ |
| 65 | 61f2970e | Andreas | public function show($template) |
| 66 | 61f2970e | Andreas | {
|
| 67 | 61f2970e | Andreas | $this->display($template);
|
| 68 | 61f2970e | Andreas | |
| 69 | 61f2970e | Andreas | } // show()
|
| 70 | 61f2970e | Andreas | |
| 71 | 7688cbcd | Andreas | } // PHPFSPOT_TMPL()
|
| 72 | 61f2970e | Andreas | |
| 73 | 61f2970e | Andreas | ?> |