Merge pull request #15649 from JMAConsulting/core-1346
[civicrm-core.git] / CRM / Core / Smarty / plugins / block.htxt.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 * CiviCRM's Smarty gettext plugin
14 *
15 * @package CRM
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 * $Id$
18 */
19
20 /**
21 * Smarty block function providing support for
22 * CiviCRM's helptext mechanism
23 *
24 * @param array $params
25 * Template call's parameters.
26 * @param string $text
27 * {ts} block contents from the template.
28 * @param CRM_Core_Smarty $smarty
29 * The Smarty object.
30 *
31 * @return string
32 * the string, translated by gettext
33 */
34 function smarty_block_htxt($params, $text, &$smarty) {
35 if ($params['id'] == $smarty->_tpl_vars['id']) {
36 $smarty->assign('override_help_text', !empty($params['override']));
37 return $text;
38 }
39 else {
40 return NULL;
41 }
42 }