]> git.agnieray.net Git - galette.git/blob - galette/includes/smarty.inc.php
dfbdfbd80cdd0c5b26438f5b719e969a1ed90d86
[galette.git] / galette / includes / smarty.inc.php
1 <?php
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 /**
6 * Smarty main initialisation
7 *
8 * PHP version 5
9 *
10 * Copyright © 2006-2014 The Galette Team
11 *
12 * This file is part of Galette (http://galette.tuxfamily.org).
13 *
14 * Galette is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * Galette is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
26 *
27 * @category Main
28 * @package Galette
29 *
30 * @author Frédéric Jaqcuot <unknown@unknow.com>
31 * @author Georges Khaznadar (i18n using gettext) <unknown@unknow.com>
32 * @author Johan Cwiklinski <johan@x-tnd.be>
33 * @copyright 2006-2014 The Galette Team
34 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
35 * @version SVN: $Id$
36 * @link http://galette.tuxfamily.org
37 * @since Available since 0.63
38 */
39
40 if (!defined('GALETTE_ROOT')) {
41 die("Sorry. You can't access directly to this file");
42 }
43
44 $smarty->muteExpectedErrors();
45 $smarty->registerClass('GaletteMail', '\Galette\Core\GaletteMail');
46
47 /**
48 * Return member name. Smarty cannot directly use static functions
49 *
50 * @param array $params Parameters
51 *
52 * @return Adherent::getSName
53 * @see Adherent::getSName
54 */
55 function getMemberName($params)
56 {
57 global $container;
58 extract($params);
59 return Galette\Entity\Adherent::getSName($container->get('zdb'), $id);
60 }
61 $smarty->registerPlugin(
62 'function',
63 'memberName',
64 'getMemberName'
65 );
66
67 $s = new Galette\Entity\Status($container->get('zdb'));
68 $statuses_list = $s->getList();
69
70 /**
71 * Return status label
72 *
73 * @param array $params Parameters
74 *
75 * @return string
76 */
77 function getStatusLabel($params)
78 {
79 extract($params);
80 global $statuses_list;
81 return $statuses_list[$id];
82 }
83 $smarty->registerPlugin(
84 'function',
85 'statusLabel',
86 'getStatusLabel'
87 );