icon helpers - allow specification of HTML attributes
[civicrm-core.git] / CRM / Core / Smarty / resources / String.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 * $Id$
17 *
18 * @param $tpl_name
19 * @param $tpl_source
20 * @param $smarty_obj
21 *
22 * @return bool
23 */
24 function civicrm_smarty_resource_string_get_template($tpl_name, &$tpl_source, &$smarty_obj) {
25 $tpl_source = $tpl_name;
26 return TRUE;
27 }
28
29 /**
30 * @param string $tpl_name
31 * @param $tpl_timestamp
32 * @param CRM_Core_Smarty $smarty_obj
33 *
34 * @return bool
35 */
36 function civicrm_smarty_resource_string_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj) {
37 $tpl_timestamp = time();
38 return TRUE;
39 }
40
41 /**
42 * @param string $tpl_name
43 * @param CRM_Core_Smarty $smarty_obj
44 *
45 * @return bool
46 */
47 function civicrm_smarty_resource_string_get_secure($tpl_name, &$smarty_obj) {
48 return TRUE;
49 }
50
51 /**
52 * @param string $tpl_name
53 * @param CRM_Core_Smarty $smarty_obj
54 */
55 function civicrm_smarty_resource_string_get_trusted($tpl_name, &$smarty_obj) {
56
57 }
58
59 function civicrm_smarty_register_string_resource() {
60 $template = CRM_Core_Smarty::singleton();
61 $template->register_resource('string', [
62 'civicrm_smarty_resource_string_get_template',
63 'civicrm_smarty_resource_string_get_timestamp',
64 'civicrm_smarty_resource_string_get_secure',
65 'civicrm_smarty_resource_string_get_trusted',
66 ]);
67 }