1: <?php
2: /**
3: * XOOPS securityToken Smarty compiler plug-in
4: *
5: * @copyright XOOPS Project (http://xoops.org)
6: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
7: * @author Richard Griffith <richard@geekwright.com>
8: */
9:
10: /**
11: * Inserts a XOOPS security token
12: *
13: * Not sure if this is a good idea (sounds like application logic, not presentation,)
14: * but there are several token generations done in {php} tags which don't work with
15: * Smarty 3.1
16: */
17:
18: function smarty_function_securityToken($params, Smarty_Internal_Template $smarty)
19: {
20: return \Xoops::getInstance()->security()->getTokenHTML();
21: }
22: