Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
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 | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 TO |
11 | |
12 | /** | |
13 | * CiviCRM's Smarty gettext plugin | |
14 | * | |
15 | * @package CRM | |
ca5cec67 | 16 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
17 | * $Id$ |
18 | */ | |
19 | ||
20 | /** | |
21 | * Smarty block function providing support for | |
22 | * CiviCRM's helptext mechanism | |
23 | * | |
6a0b768e TO |
24 | * @param array $params |
25 | * Template call's parameters. | |
26 | * @param string $text | |
27 | * {ts} block contents from the template. | |
16b10e64 | 28 | * @param CRM_Core_Smarty $smarty |
6a0b768e | 29 | * The Smarty object. |
6a488035 | 30 | * |
a6c01b45 | 31 | * @return string |
353ffa53 | 32 | * the string, translated by gettext |
6a488035 TO |
33 | */ |
34 | function smarty_block_htxt($params, $text, &$smarty) { | |
23d7e1c1 CW |
35 | if ($params['id'] == $smarty->_tpl_vars['id']) { |
36 | $smarty->assign('override_help_text', !empty($params['override'])); | |
6a488035 TO |
37 | return $text; |
38 | } | |
39 | else { | |
40 | return NULL; | |
41 | } | |
42 | } |